• BCC源码内容概览(5)


    接前一篇文章:BCC源码内容概览(4)

    本文参考官网中的Contents部分的介绍。

    BCC源码根目录的文件,其中一些是同时包含C和Python的单个文件,另一些是.c和.py的成对文件,还有一些是目录。

    工具(Tools)

    eBPF工具概览图如下:

    tools目录下的文件:

    • tools/argdist

    函数参数值显示为直方图或频率计数。 

    bcc/tools/argdist_example.txt文件内容如下:

    1. Demonstrations of argdist.
    2. argdist probes functions you specify and collects parameter values into a
    3. histogram or a frequency count. This can be used to understand the distribution
    4. of values a certain parameter takes, filter and print interesting parameters
    5. without attaching a debugger, and obtain general execution statistics on
    6. various functions.
    7. For example, suppose you want to find what allocation sizes are common in
    8. your application:
    9. # ./argdist -p 2420 -c -C 'p:c:malloc(size_t size):size_t:size'
    10. [01:42:29]
    11. p:c:malloc(size_t size):size_t:size
    12. COUNT EVENT
    13. [01:42:30]
    14. p:c:malloc(size_t size):size_t:size
    15. COUNT EVENT
    16. [01:42:31]
    17. p:c:malloc(size_t size):size_t:size
    18. COUNT EVENT
    19. 1 size = 16
    20. [01:42:32]
    21. p:c:malloc(size_t size):size_t:size
    22. COUNT EVENT
    23. 2 size = 16
    24. [01:42:33]
    25. p:c:malloc(size_t size):size_t:size
    26. COUNT EVENT
    27. 3 size = 16
    28. [01:42:34]
    29. p:c:malloc(size_t size):size_t:size
    30. COUNT EVENT
    31. 4 size = 16
    32. ^C
    33. It seems that the application is allocating blocks of size 16. The COUNT
    34. column contains the number of occurrences of a particular event, and the
    35. EVENT column describes the event. In this case, the "size" parameter was
    36. probed and its value was 16, repeatedly.
    37. Now, suppose you wanted a histogram of buffer sizes passed to the write()
    38. function across the system:
    39. # ./argdist -c -H 'p:c:write(int fd, void *buf, size_t len):size_t:len'
    40. [01:45:22]
    41. p:c:write(int fd, void *buf, size_t len):size_t:len
    42. len : count distribution
    43. 0 -> 1 : 0 | |
    44. 2 -> 3 : 2 |************* |
    45. 4 -> 7 : 0 | |
    46. 8 -> 15 : 2 |************* |
    47. 16 -> 31 : 0 | |
    48. 32 -> 63 : 6 |****************************************|
    49. [01:45:23]
    50. p:c:write(int fd, void *buf, size_t len):size_t:len
    51. len : count distribution
    52. 0 -> 1 : 0 | |
    53. 2 -> 3 : 11 |*************** |
    54. 4 -> 7 : 0 | |
    55. 8 -> 15 : 4 |***** |
    56. 16 -> 31 : 0 | |
    57. 32 -> 63 : 28 |****************************************|
    58. 64 -> 127 : 12 |***************** |
    59. [01:45:24]
    60. p:c:write(int fd, void *buf, size_t len):size_t:len
    61. len : count distribution
    62. 0 -> 1 : 0 | |
    63. 2 -> 3 : 21 |**************** |
    64. 4 -> 7 : 0 | |
    65. 8 -> 15 : 6 |**** |
    66. 16 -> 31 : 0 | |
    67. 32 -> 63 : 52 |****************************************|
    68. 64 -> 127 : 26 |******************** |
    69. ^C
    70. It seems that most writes fall into three buckets: very small writes of 2-3
    71. bytes, medium writes of 32-63 bytes, and larger writes of 64-127 bytes.
    72. But these are writes across the board -- what if you wanted to focus on writes
    73. to STDOUT?
    74. # ./argdist -c -H 'p:c:write(int fd, void *buf, size_t len):size_t:len:fd==1'
    75. [01:47:17]
    76. p:c:write(int fd, void *buf, size_t len):size_t:len:fd==1
    77. len : count distribution
    78. 0 -> 1 : 0 | |
    79. 2 -> 3 : 0 | |
    80. 4 -> 7 : 0 | |
    81. 8 -> 15 : 1 |****************************************|
    82. 16 -> 31 : 0 | |
    83. 32 -> 63 : 1 |****************************************|
    84. [01:47:18]
    85. p:c:write(int fd, void *buf, size_t len):size_t:len:fd==1
    86. len : count distribution
    87. 0 -> 1 : 0 | |
    88. 2 -> 3 : 0 | |
    89. 4 -> 7 : 0 | |
    90. 8 -> 15 : 2 |************* |
    91. 16 -> 31 : 0 | |
    92. 32 -> 63 : 3 |******************** |
    93. 64 -> 127 : 6 |****************************************|
    94. [01:47:19]
    95. p:c:write(int fd, void *buf, size_t len):size_t:len:fd==1
    96. len : count distribution
    97. 0 -> 1 : 0 | |
    98. 2 -> 3 : 0 | |
    99. 4 -> 7 : 0 | |
    100. 8 -> 15 : 3 |********* |
    101. 16 -> 31 : 0 | |
    102. 32 -> 63 : 5 |*************** |
    103. 64 -> 127 : 13 |****************************************|
    104. ^C
    105. The "fd==1" part is a filter that is applied to every invocation of write().
    106. Only if the filter condition is true, the value is recorded.
    107. You can also use argdist to trace kernel functions. For example, suppose you
    108. wanted a histogram of kernel allocation (kmalloc) sizes across the system,
    109. printed twice with 3 second intervals:
    110. # ./argdist -i 3 -n 2 -H 'p::__kmalloc(size_t size):size_t:size'
    111. [01:50:00]
    112. p::__kmalloc(size_t size):size_t:size
    113. size : count distribution
    114. 0 -> 1 : 0 | |
    115. 2 -> 3 : 0 | |
    116. 4 -> 7 : 0 | |
    117. 8 -> 15 : 6 |****************************************|
    118. [01:50:03]
    119. p::__kmalloc(size_t size):size_t:size
    120. size : count distribution
    121. 0 -> 1 : 0 | |
    122. 2 -> 3 : 0 | |
    123. 4 -> 7 : 0 | |
    124. 8 -> 15 : 22 |****************************************|
    125. 16 -> 31 : 0 | |
    126. 32 -> 63 : 0 | |
    127. 64 -> 127 : 5 |********* |
    128. 128 -> 255 : 2 |*** |
    129. Occasionally, numeric information isn't enough and you want to capture strings.
    130. What are the strings printed by puts() across the system?
    131. # ./argdist -i 10 -n 1 -C 'p:c:puts(char *str):char*:str'
    132. [01:53:54]
    133. p:c:puts(char *str):char*:str
    134. COUNT EVENT
    135. 2 str = Press ENTER to start.
    136. It looks like the message "Press ENTER to start." was printed twice during the
    137. 10 seconds we were tracing.
    138. What about reads? You could trace gets() across the system and print the
    139. strings input by the user (note how "r" is used instead of "p" to attach a
    140. probe to the function's return):
    141. # ./argdist -i 10 -n 1 -C 'r:c:gets():char*:(char*)$retval:$retval!=0'
    142. [02:12:23]
    143. r:c:gets():char*:$retval:$retval!=0
    144. COUNT EVENT
    145. 1 (char*)$retval = hi there
    146. 3 (char*)$retval = sasha
    147. 8 (char*)$retval = hello
    148. Similarly, we could get a histogram of the error codes returned by read():
    149. # ./argdist -i 10 -c 1 -H 'r:c:read()'
    150. [02:15:36]
    151. r:c:read()
    152. retval : count distribution
    153. 0 -> 1 : 29 |****************************************|
    154. 2 -> 3 : 11 |*************** |
    155. 4 -> 7 : 0 | |
    156. 8 -> 15 : 3 |**** |
    157. 16 -> 31 : 2 |** |
    158. 32 -> 63 : 22 |****************************** |
    159. 64 -> 127 : 5 |****** |
    160. 128 -> 255 : 0 | |
    161. 256 -> 511 : 1 |* |
    162. 512 -> 1023 : 1 |* |
    163. 1024 -> 2047 : 0 | |
    164. 2048 -> 4095 : 2 |** |
    165. In return probes, you can also trace the latency of the function (unless it is
    166. recursive) and the parameters it had on entry. For example, we can identify
    167. which processes are performing slow synchronous filesystem reads -- say,
    168. longer than 0.1ms (100,000ns):
    169. # ./argdist -C 'r::__vfs_read():u32:$PID:$latency > 100000'
    170. [01:08:48]
    171. r::__vfs_read():u32:$PID:$latency > 100000
    172. COUNT EVENT
    173. 1 $PID = 10457
    174. 21 $PID = 2780
    175. [01:08:49]
    176. r::__vfs_read():u32:$PID:$latency > 100000
    177. COUNT EVENT
    178. 1 $PID = 10457
    179. 21 $PID = 2780
    180. ^C
    181. It looks like process 2780 performed 21 slow reads.
    182. You can print the name of the process. This is helpful for short lived processes
    183. and for easier identification of processes response. For example, we can identify
    184. the process using the epoll I/O multiplexing system call
    185. # ./argdist -C 't:syscalls:sys_exit_epoll_wait():char*:$COMM'
    186. [19:57:56]
    187. t:syscalls:sys_exit_epoll_wait():char*:$COMM
    188. COUNT EVENT
    189. 4 $COMM = b'node'
    190. [19:57:57]
    191. t:syscalls:sys_exit_epoll_wait():char*:$COMM
    192. COUNT EVENT
    193. 2 $COMM = b'open5gs-sgwud'
    194. 3 $COMM = b'open5gs-sgwcd'
    195. 3 $COMM = b'open5gs-nrfd'
    196. 3 $COMM = b'open5gs-udmd'
    197. 4 $COMM = b'open5gs-scpd'
    198. Occasionally, entry parameter values are also interesting. For example, you
    199. might be curious how long it takes malloc() to allocate memory -- nanoseconds
    200. per byte allocated. Let's go:
    201. # ./argdist -H 'r:c:malloc(size_t size):u64:$latency/$entry(size);ns per byte' -n 1 -i 10
    202. [01:11:13]
    203. ns per byte : count distribution
    204. 0 -> 1 : 0 | |
    205. 2 -> 3 : 4 |***************** |
    206. 4 -> 7 : 3 |************* |
    207. 8 -> 15 : 2 |******** |
    208. 16 -> 31 : 1 |**** |
    209. 32 -> 63 : 0 | |
    210. 64 -> 127 : 7 |******************************* |
    211. 128 -> 255 : 1 |**** |
    212. 256 -> 511 : 0 | |
    213. 512 -> 1023 : 1 |**** |
    214. 1024 -> 2047 : 1 |**** |
    215. 2048 -> 4095 : 9 |****************************************|
    216. 4096 -> 8191 : 1 |**** |
    217. It looks like a tri-modal distribution. Some allocations are extremely cheap,
    218. and take 2-15 nanoseconds per byte. Other allocations are slower, and take
    219. 64-127 nanoseconds per byte. And some allocations are slower still, and take
    220. multiple microseconds per byte.
    221. You could also group results by more than one field. For example, __kmalloc
    222. takes an additional flags parameter that describes how to allocate memory:
    223. # ./argdist -c -C 'p::__kmalloc(size_t size, gfp_t flags):gfp_t,size_t:flags,size'
    224. [03:42:29]
    225. p::__kmalloc(size_t size, gfp_t flags):gfp_t,size_t:flags,size
    226. COUNT EVENT
    227. 1 flags = 16, size = 152
    228. 2 flags = 131280, size = 8
    229. 7 flags = 131280, size = 16
    230. [03:42:30]
    231. p::__kmalloc(size_t size, gfp_t flags):gfp_t,size_t:flags,size
    232. COUNT EVENT
    233. 1 flags = 16, size = 152
    234. 6 flags = 131280, size = 8
    235. 19 flags = 131280, size = 16
    236. [03:42:31]
    237. p::__kmalloc(size_t size, gfp_t flags):gfp_t,size_t:flags,size
    238. COUNT EVENT
    239. 2 flags = 16, size = 152
    240. 10 flags = 131280, size = 8
    241. 31 flags = 131280, size = 16
    242. [03:42:32]
    243. p::__kmalloc(size_t size, gfp_t flags):gfp_t,size_t:flags,size
    244. COUNT EVENT
    245. 2 flags = 16, size = 152
    246. 14 flags = 131280, size = 8
    247. 43 flags = 131280, size = 16
    248. ^C
    249. The flags value must be expanded by hand, but it's still helpful to eliminate
    250. certain kinds of allocations or visually group them together.
    251. argdist also has basic support for kernel tracepoints. It is sometimes more
    252. convenient to use tracepoints because they are documented and don't vary a lot
    253. between kernel versions. For example, let's trace the net:net_dev_start_xmit
    254. tracepoint and print out the protocol field from the tracepoint structure:
    255. # argdist -C 't:net:net_dev_start_xmit():u16:args->protocol'
    256. [13:01:49]
    257. t:net:net_dev_start_xmit():u16:args->protocol
    258. COUNT EVENT
    259. 8 args->protocol = 2048
    260. ^C
    261. Note that to discover the format of the net:net_dev_start_xmit tracepoint, you
    262. use the tplist tool (tplist -v net:net_dev_start_xmit).
    263. Occasionally, it is useful to filter certain expressions by string. This is not
    264. trivially supported by BPF, but argdist provides a STRCMP helper you can use in
    265. filter expressions. For example, to get a histogram of latencies opening a
    266. specific file, run this:
    267. # argdist -c -H 'r:c:open(char *file):u64:$latency/1000:STRCMP("test.txt",$entry(file))'
    268. [02:16:38]
    269. [02:16:39]
    270. [02:16:40]
    271. $latency/1000 : count distribution
    272. 0 -> 1 : 0 | |
    273. 2 -> 3 : 0 | |
    274. 4 -> 7 : 0 | |
    275. 8 -> 15 : 0 | |
    276. 16 -> 31 : 2 |****************************************|
    277. [02:16:41]
    278. $latency/1000 : count distribution
    279. 0 -> 1 : 0 | |
    280. 2 -> 3 : 0 | |
    281. 4 -> 7 : 0 | |
    282. 8 -> 15 : 1 |********** |
    283. 16 -> 31 : 4 |****************************************|
    284. [02:16:42]
    285. $latency/1000 : count distribution
    286. 0 -> 1 : 0 | |
    287. 2 -> 3 : 0 | |
    288. 4 -> 7 : 0 | |
    289. 8 -> 15 : 1 |******** |
    290. 16 -> 31 : 5 |****************************************|
    291. [02:16:43]
    292. $latency/1000 : count distribution
    293. 0 -> 1 : 0 | |
    294. 2 -> 3 : 0 | |
    295. 4 -> 7 : 0 | |
    296. 8 -> 15 : 1 |******** |
    297. 16 -> 31 : 5 |****************************************|
    298. Here's a final example that finds how many write() system calls are performed
    299. by each process on the system:
    300. # argdist -c -C 'p:c:write():int:$PID;write per process' -n 2
    301. [06:47:18]
    302. write by process
    303. COUNT EVENT
    304. 3 $PID = 8889
    305. 7 $PID = 7615
    306. 7 $PID = 2480
    307. [06:47:19]
    308. write by process
    309. COUNT EVENT
    310. 9 $PID = 8889
    311. 23 $PID = 7615
    312. 23 $PID = 2480
    313. USAGE message:
    314. # argdist -h
    315. usage: argdist [-h] [-p PID] [-z STRING_SIZE] [-i INTERVAL] [-n COUNT] [-v]
    316. [-c] [-T TOP] [-H specifier] [-C[specifier] [-I header]
    317. Trace a function and display a summary of its parameter values.
    318. optional arguments:
    319. -h, --help show this help message and exit
    320. -p PID, --pid PID id of the process to trace (optional)
    321. -t TID, --tid TID id of the thread to trace (optional)
    322. -z STRING_SIZE, --string-size STRING_SIZE
    323. maximum string size to read from char* arguments
    324. -i INTERVAL, --interval INTERVAL
    325. output interval, in seconds (default 1 second)
    326. -d DURATION, --duration DURATION
    327. total duration of trace, in seconds
    328. -n COUNT, --number COUNT
    329. number of outputs
    330. -v, --verbose print resulting BPF program code before executing
    331. -c, --cumulative do not clear histograms and freq counts at each interval
    332. -T TOP, --top TOP number of top results to show (not applicable to
    333. histograms)
    334. -H specifier, --histogram specifier
    335. probe specifier to capture histogram of (see examples
    336. below)
    337. -C specifier, --count specifier
    338. probe specifier to capture count of (see examples
    339. below)
    340. -I header, --include header
    341. additional header files to include in the BPF program
    342. as either full path, or relative to current working directory,
    343. or relative to default kernel header search path
    344. Probe specifier syntax:
    345. {p,r,t,u}:{[library],category}:function(signature)[:type[,type...]:expr[,expr...][:filter]][#label]
    346. Where:
    347. p,r,t,u -- probe at function entry, function exit, kernel tracepoint,
    348. or USDT probe
    349. in exit probes: can use $retval, $entry(param), $latency
    350. library -- the library that contains the function
    351. (leave empty for kernel functions)
    352. category -- the category of the kernel tracepoint (e.g. net, sched)
    353. signature -- the function's parameters, as in the C header
    354. type -- the type of the expression to collect (supports multiple)
    355. expr -- the expression to collect (supports multiple)
    356. filter -- the filter that is applied to collected values
    357. label -- the label for this probe in the resulting output
    358. EXAMPLES:
    359. argdist -H 'p::__kmalloc(u64 size):u64:size'
    360. Print a histogram of allocation sizes passed to kmalloc
    361. argdist -p 1005 -C 'p:c:malloc(size_t size):size_t:size:size==16'
    362. Print a frequency count of how many times process 1005 called malloc
    363. with an allocation size of 16 bytes
    364. argdist -C 'r:c:gets():char*:$retval#snooped strings'
    365. Snoop on all strings returned by gets()
    366. argdist -H 'r::__kmalloc(size_t size):u64:$latency/$entry(size)#ns per byte'
    367. Print a histogram of nanoseconds per byte from kmalloc allocations
    368. argdist -C 'p::__kmalloc(size_t size, gfp_t flags):size_t:size:flags&GFP_ATOMIC'
    369. Print frequency count of kmalloc allocation sizes that have GFP_ATOMIC
    370. argdist -p 1005 -C 'p:c:write(int fd):int:fd' -T 5
    371. Print frequency counts of how many times writes were issued to a
    372. particular file descriptor number, in process 1005, but only show
    373. the top 5 busiest fds
    374. argdist -p 1005 -H 'r:c:read()'
    375. Print a histogram of error codes returned by read() in process 1005
    376. argdist -C 'r::__vfs_read():u32:$PID:$latency > 100000'
    377. Print frequency of reads by process where the latency was >0.1ms
    378. argdist -C 'r::__vfs_read():u32:$COMM:$latency > 100000'
    379. Print frequency of reads by process name where the latency was >0.1ms
    380. argdist -H 'r::__vfs_read(void *file, void *buf, size_t count):size_t:$entry(count):$latency > 1000000'
    381. Print a histogram of read sizes that were longer than 1ms
    382. argdist -H \
    383. 'p:c:write(int fd, const void *buf, size_t count):size_t:count:fd==1'
    384. Print a histogram of buffer sizes passed to write() across all
    385. processes, where the file descriptor was 1 (STDOUT)
    386. argdist -C 'p:c:fork()#fork calls'
    387. Count fork() calls in libc across all processes
    388. Can also use funccount.py, which is easier and more flexible
    389. argdist -H 't:block:block_rq_complete():u32:args->nr_sector'
    390. Print histogram of number of sectors in completing block I/O requests
    391. argdist -C 't:irq:irq_handler_entry():int:args->irq'
    392. Aggregate interrupts by interrupt request (IRQ)
    393. argdist -C 'u:pthread:pthread_start():u64:arg2' -p 1337
    394. Print frequency of function addresses used as a pthread start function,
    395. relying on the USDT pthread_start probe in process 1337
    396. argdist -H 'p:c:sleep(u32 seconds):u32:seconds' \
    397. -H 'p:c:nanosleep(struct timespec *req):long:req->tv_nsec'
    398. Print histograms of sleep() and nanosleep() parameter values
    399. argdist -p 2780 -z 120 \
    400. -C 'p:c:write(int fd, char* buf, size_t len):char*:buf:fd==1'
    401. Spy on writes to STDOUT performed by process 2780, up to a string size
    402. of 120 characters
    403. argdist -I 'kernel/sched/sched.h' \
    404. -C 'p::__account_cfs_rq_runtime(struct cfs_rq *cfs_rq):s64:cfs_rq->runtime_remaining'
    405. Trace on the cfs scheduling runqueue remaining runtime. The struct cfs_rq is defined
    406. in kernel/sched/sched.h which is in kernel source tree and not in kernel-devel
    407. package. So this command needs to run at the kernel source tree root directory
    408. so that the added header file can be found by the compiler.
    409. argdist -C 'p::do_sys_open(int dfd, const char __user *filename, int flags,
    410. umode_t mode):char*:filename:STRCMP("sample.txt", filename)'
    411. Trace open of the file "sample.txt". It should be noted that 'filename'
    412. passed to the do_sys_open is a char * user pointer. Hence parameter
    413. 'filename' should be tagged with __user for kprobes (const char __user
    414. *filename). This information distinguishes if the 'filename' should be
    415. copied from userspace to the bpf stack or from kernel space to the bpf
    416. stack.

    在笔者电脑上实际运行结果如下:

    1. ~/eBPF/BCC/bcc/tools$ sudo ./argdist.py -c -H 'p:c:write(int fd, void *buf, size_t len):size_t:len:fd==1'
    2. [10:23:54]
    3. len : count distribution
    4. 0 -> 1 : 0 | |
    5. 2 -> 3 : 0 | |
    6. 4 -> 7 : 0 | |
    7. 8 -> 15 : 1 |****************************************|
    8. [10:23:55]
    9. len : count distribution
    10. 0 -> 1 : 0 | |
    11. 2 -> 3 : 0 | |
    12. 4 -> 7 : 0 | |
    13. 8 -> 15 : 2 |******************** |
    14. 16 -> 31 : 0 | |
    15. 32 -> 63 : 1 |********** |
    16. 64 -> 127 : 4 |****************************************|
    17. [10:23:56]
    18. len : count distribution
    19. 0 -> 1 : 0 | |
    20. 2 -> 3 : 0 | |
    21. 4 -> 7 : 0 | |
    22. 8 -> 15 : 3 |********** |
    23. 16 -> 31 : 0 | |
    24. 32 -> 63 : 2 |******* |
    25. 64 -> 127 : 11 |****************************************|
    26. [10:23:57]
    27. len : count distribution
    28. 0 -> 1 : 0 | |
    29. 2 -> 3 : 0 | |
    30. 4 -> 7 : 0 | |
    31. 8 -> 15 : 4 |******** |
    32. 16 -> 31 : 0 | |
    33. 32 -> 63 : 3 |****** |
    34. 64 -> 127 : 19 |****************************************|
    35. 128 -> 255 : 0 | |
    36. 256 -> 511 : 1 |** |
    37. 512 -> 1023 : 0 | |
    38. 1024 -> 2047 : 0 | |
    39. 2048 -> 4095 : 0 | |
    40. 4096 -> 8191 : 8 |**************** |

     

    • tools/bashreadline

    打印系统范围内输入的bash命令。 

    bcc/tools/bashreadline.txt文件内容如下:

    1. Demonstrations of bashreadline, the Linux eBPF/bcc version.
    2. This prints bash commands from all running bash shells on the system. For
    3. example:
    4. # ./bashreadline
    5. TIME PID COMMAND
    6. 05:28:25 21176 ls -l
    7. 05:28:28 21176 date
    8. 05:28:35 21176 echo hello world
    9. 05:28:43 21176 foo this command failed
    10. 05:28:45 21176 df -h
    11. 05:29:04 3059 echo another shell
    12. 05:29:13 21176 echo first shell again
    13. When running the script on Arch Linux, you may need to specify the location
    14. of libreadline.so library:
    15. # ./bashreadline -s /lib/libreadline.so
    16. TIME PID COMMAND
    17. 11:17:34 28796 whoami
    18. 11:17:41 28796 ps -ef
    19. 11:17:51 28796 echo "Hello eBPF!"
    20. The entered command may fail. This is just showing what command lines were
    21. entered interactively for bash to process.
    22. It works by tracing the return of the readline() function using uprobes
    23. (specifically a uretprobe).

    但是在笔者电脑上实际运行,结果如下:

    1. ~/eBPF/BCC/bcc/tools$ sudo ./bashreadline.py
    2. [sudo] penghao 的密码:Traceback (most recent call last):
    3. File "/home/penghao/eBPF/BCC/bcc/tools/./bashreadline.py", line 66, in
    4. b.attach_uretprobe(name=name, sym="readline", fn_name="printret")
    5. File "/usr/lib/python3.11/site-packages/bcc/__init__.py", line 1412, in attach_uretprobe
    6. (path, addr) = BPF._check_path_symbol(name, sym, addr, pid)
    7. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    8. File "/usr/lib/python3.11/site-packages/bcc/__init__.py", line 978, in _check_path_symbol
    9. raise Exception("could not determine address of symbol %s in %s"
    10. Exception: could not determine address of symbol readline in /bin/bash

  • 相关阅读:
    如何破解安全难题?另一个商用车ADAS市场窗口开启
    防止鱼叉式网络钓鱼的4个步骤
    二、java版 SpringCloud分布式微服务云架构之Java 开发环境配置
    AttributeError: module ‘lib‘ has no attribute ‘X509_V_FLAG_CB_ISSUER_CHECK‘
    21天学习挑战赛--分班
    0815(031天 线程/进程02)
    Selenium自动化脚本打包exe文件
    gitlab--基础--5.4--CICD--variables的保留字
    自然语言处理基本概念 natural_language_processing-996station GitHub鉴赏官
    如何在洛谷里面新建自己的题目、配置数据点
  • 原文地址:https://blog.csdn.net/phmatthaus/article/details/133266768