Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -153,6 +153,7 @@ enum class AsyncAction | |
zero, | ||
time, | ||
join, | ||
cat | ||
}; | ||
|
||
uint64_t asyncactionint(AsyncAction a); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include "common.h" | ||
|
||
namespace bpftrace { | ||
namespace test { | ||
namespace codegen { | ||
|
||
TEST(codegen, call_cat) | ||
{ | ||
test("kprobe:f { cat(\"/proc/loadavg\"); }", | ||
|
||
R"EXPECTED(; Function Attrs: nounwind | ||
declare i64 @llvm.bpf.pseudo(i64, i64) #0 | ||
; Function Attrs: argmemonly nounwind | ||
declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1 | ||
define i64 @"kprobe:f"(i8*) local_unnamed_addr section "s_kprobe:f_1" { | ||
entry: | ||
%perfdata = alloca [16 x i8], align 8 | ||
%1 = getelementptr inbounds [16 x i8], [16 x i8]* %perfdata, i64 0, i64 0 | ||
call void @llvm.lifetime.start.p0i8(i64 -1, i8* nonnull %1) | ||
store i64 20006, [16 x i8]* %perfdata, align 8 | ||
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %perfdata, i64 0, i64 8 | ||
store i64 0, i8* %2, align 8 | ||
%pseudo = tail call i64 @llvm.bpf.pseudo(i64 1, i64 1) | ||
%get_cpu_id = tail call i64 inttoptr (i64 8 to i64 ()*)() | ||
%perf_event_output = call i64 inttoptr (i64 25 to i64 (i8*, i8*, i64, i8*, i64)*)(i8* %0, i64 %pseudo, i64 %get_cpu_id, [16 x i8]* nonnull %perfdata, i64 16) | ||
call void @llvm.lifetime.end.p0i8(i64 -1, i8* nonnull %1) | ||
ret i64 0 | ||
} | ||
; Function Attrs: argmemonly nounwind | ||
declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1 | ||
attributes #0 = { nounwind } | ||
attributes #1 = { argmemonly nounwind } | ||
)EXPECTED"); | ||
} | ||
|
||
} // namespace codegen | ||
} // namespace test | ||
} // namespace bpftrace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters