Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow probe builtin with aliased software/hardware probes #2711

Merged
merged 1 commit into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ and this project adheres to
- [#2696](https://github.com/iovisor/bpftrace/pull/2696)
- Improve listing and 'probe' builtin for several probe types
- [#2691](https://github.com/iovisor/bpftrace/pull/2691)
- Allow probe builtin with aliased software/hardware probes
- [#2711](https://github.com/iovisor/bpftrace/pull/2711)


## [0.18.0] 2023-05-15

Expand Down
4 changes: 4 additions & 0 deletions src/probe_matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,11 @@ std::unique_ptr<std::istream> ProbeMatcher::get_symbols_from_list(
{
std::string symbols;
for (auto& probe : probes_list)
{
symbols += probe.path + ":\n";
if (!probe.alias.empty())
symbols += probe.alias + ":\n";
}
return std::make_unique<std::istringstream>(symbols);
}

Expand Down
5 changes: 5 additions & 0 deletions tests/runtime/probe
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,11 @@ PROG software:page-faults:1 { print(probe); exit();}
EXPECT software:page-faults:1
TIMEOUT 5

NAME software_alias_probe_builtin
PROG software:cpu:1 { print(probe); exit();}
EXPECT software:cpu:1
TIMEOUT 5

NAME hardware
REQUIRES ls /sys/devices/cpu/events/cache-misses
PROG hardware:cache-misses:10 { @[pid] = count(); exit(); }
Expand Down