Skip to content

Commit f0f6d60

Browse files
Anthony Iliopoulosdanobi
authored andcommitted
tools/bashreadline: fix probe for dynamically linked readline
When bash links against libreadline dynamically, the probe fails as the readline symbol is undefined until runtime. Fix this issue by adding a fallback probe that hooks directly into libreadline. Signed-off-by: Anthony Iliopoulos <[email protected]>
1 parent 4207c82 commit f0f6d60

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ and this project adheres to
115115
- Remove mention of unsupported character literals
116116
- [#3283](https://github.com/bpftrace/bpftrace/pull/3283)
117117
#### Tools
118+
- Fix bashreadline tool probe for dynamically linked readline
119+
- [#3564](https://github.com/bpftrace/bpftrace/pull/3564)
118120

119121
## [0.21.0] 2024-06-21
120122

tools/bashreadline.bt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@
1515
* 06-Sep-2018 Brendan Gregg Created this.
1616
*/
1717

18+
config = { missing_probes = "ignore" }
19+
1820
BEGIN
1921
{
2022
printf("Tracing bash commands... Hit Ctrl-C to end.\n");
2123
printf("%-9s %-6s %s\n", "TIME", "PID", "COMMAND");
2224
}
2325

24-
uretprobe:/bin/bash:readline
26+
uretprobe:/bin/bash:readline,
27+
uretprobe:libreadline:readline
28+
/comm == "bash"/
2529
{
2630
time("%H:%M:%S ");
2731
printf("%-6d %s\n", pid, str(retval));

0 commit comments

Comments
 (0)