File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 10
10
# Licensed under the Apache License, Version 2.0 (the "License")
11
11
#
12
12
# 30-Jul-2018 Jiri Olsa Created this.
13
+ # 31-Mar-2025 yu410621 Add argument "--ebpf".
13
14
14
15
from __future__ import print_function
15
16
from bcc import ArgString , BPF
42
43
help = "only print process names containing this name" )
43
44
parser .add_argument ("-d" , "--duration" ,
44
45
help = "total duration of trace in seconds" )
46
+ parser .add_argument ("--ebpf" , action = "store_true" ,
47
+ help = argparse .SUPPRESS )
45
48
args = parser .parse_args ()
46
49
debug = 0
47
50
266
269
else :
267
270
bpf_text = bpf_text .replace ('FILTER' , '' )
268
271
272
+ # output eBPF program C code after it is replaced, used by debugging
273
+ if debug or args .ebpf :
274
+ print (bpf_text )
275
+ if args .ebpf :
276
+ exit ()
277
+
269
278
# initialize BPF
270
279
b = BPF (text = bpf_text )
271
280
You can’t perform that action at this time.
0 commit comments