forked from bpftrace/bpftrace
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathasync_event_types.cpp
More file actions
105 lines (91 loc) · 2.42 KB
/
Copy pathasync_event_types.cpp
File metadata and controls
105 lines (91 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/Type.h>
#include "ast/async_event_types.h"
#include "ast/irbuilderbpf.h"
namespace bpftrace::AsyncEvent {
std::vector<llvm::Type*> Print::asLLVMType(ast::IRBuilderBPF& b)
{
return {
b.getInt64Ty(), // asyncid
b.getInt32Ty(), // map id
b.getInt32Ty(), // top
b.getInt32Ty(), // div
};
}
std::vector<llvm::Type*> PrintNonMap::asLLVMType(ast::IRBuilderBPF& b,
size_t size)
{
return {
b.getInt64Ty(), // asyncid
b.getInt64Ty(), // print id
llvm::ArrayType::get(b.getInt8Ty(), size), // content
};
}
std::vector<llvm::Type*> MapEvent::asLLVMType(ast::IRBuilderBPF& b)
{
return {
b.getInt64Ty(), // asyncid
b.getInt32Ty(), // map id
};
}
std::vector<llvm::Type*> Time::asLLVMType(ast::IRBuilderBPF& b)
{
return {
b.getInt64Ty(), // asyncid
b.getInt32Ty(), // time id
};
}
std::vector<llvm::Type*> Strftime::asLLVMType(ast::IRBuilderBPF& b)
{
return {
b.getInt32Ty(), // strftime id
b.getInt32Ty(), // timestamp mode
b.getInt64Ty(), // strftime arg, nanoseconds
};
}
std::vector<llvm::Type*> Buf::asLLVMType(ast::IRBuilderBPF& b, uint32_t length)
{
return {
b.getInt32Ty(), // buffer length
llvm::ArrayType::get(b.getInt8Ty(), length), // buffer content
};
}
std::vector<llvm::Type*> RuntimeError::asLLVMType(ast::IRBuilderBPF& b)
{
return {
b.getInt64Ty(), // asyncid
b.getInt64Ty(), // error_id
b.getInt32Ty(), // return value
};
}
std::vector<llvm::Type*> CgroupPath::asLLVMType(ast::IRBuilderBPF& b)
{
return {
b.getInt64Ty(), // cgroup path (pseudo-event) id
b.getInt64Ty(), // cgroup id
};
}
std::vector<llvm::Type*> SkbOutput::asLLVMType(ast::IRBuilderBPF& b)
{
return {
b.getInt64Ty(), // asyncid
b.getInt64Ty(), // skb_output id
b.getInt64Ty(), // time elapsed since boot
};
}
std::vector<llvm::Type*> Exit::asLLVMType(ast::IRBuilderBPF& b)
{
return {
b.getInt64Ty(), // asyncid
b.getInt8Ty(), // exit_code
};
}
std::vector<llvm::Type*> Join::asLLVMType(ast::IRBuilderBPF& b, uint32_t length)
{
return {
b.getInt64Ty(), // action_id
b.getInt64Ty(), // join_id
llvm::ArrayType::get(b.getInt8Ty(), length), // join content
};
}
} // namespace bpftrace::AsyncEvent