Skip to content

Commit

Permalink
Merge -lv output into stdout
Browse files Browse the repository at this point in the history
Currently the output of bpftrace -lv is split up to stdout and stderr.

This is bad because `bpftrace -lv kfunc:vmlinux:*mount | less` will show
a list of kfunc and a list of parameters, without any association being
possible.

Fix by sending all output from `-lv` to stdout.

Signed-off-by: Dantezy <[email protected]>
  • Loading branch information
ZhangYet authored Aug 7, 2024
1 parent eb734db commit 75e830c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ and this project adheres to
- For-loops: Allow sharing variables between the main probe and the loop's body
- [#3014](https://github.com/bpftrace/bpftrace/pull/3014)
#### Changed
- Merge output into `stdout` when `-lv`
- [#3383](https://github.com/bpftrace/bpftrace/pull/3383)
- Stream output when printing maps
- [#3264](https://github.com/bpftrace/bpftrace/pull/3264)
- Only print kernel headers not found message if parsing fails
Expand Down
2 changes: 1 addition & 1 deletion src/probe_matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ void ProbeMatcher::list_probes(ast::Program* prog)
std::cout << probe_type << ":" << match_print << std::endl;
if (bt_verbose) {
for (auto& param : param_lists[match])
LOG(V1) << " " << param;
std::cout << " " << param << std::endl;
}
}
}
Expand Down

0 comments on commit 75e830c

Please sign in to comment.