Commit 94936573 authored by Brendan Gregg's avatar Brendan Gregg Committed by GitHub

Merge pull request #355 from iovisor/nits

bpftrace -l tweaks for consistency
parents 8ddfe227 bb4a83ce
...@@ -65,7 +65,8 @@ void list_dir(const std::string path, std::vector<std::string> &files) ...@@ -65,7 +65,8 @@ void list_dir(const std::string path, std::vector<std::string> &files)
closedir(dp); closedir(dp);
} }
void list_probes_from_list(const std::vector<ProbeListItem> &probes_list, const std::string &search) void list_probes_from_list(const std::vector<ProbeListItem> &probes_list,
const std::string &probetype, const std::string &search)
{ {
for (auto &probeListItem : probes_list) for (auto &probeListItem : probes_list)
{ {
...@@ -75,10 +76,7 @@ void list_probes_from_list(const std::vector<ProbeListItem> &probes_list, const ...@@ -75,10 +76,7 @@ void list_probes_from_list(const std::vector<ProbeListItem> &probes_list, const
continue; continue;
} }
std::cout << probeListItem.path; std::cout << probetype << ":" << probeListItem.path << ":" << std::endl;
if (!probeListItem.alias.empty())
std::cout << " OR " << probeListItem.alias;
std::cout << std::endl;
} }
} }
...@@ -88,14 +86,12 @@ void list_probes(const std::string &search) ...@@ -88,14 +86,12 @@ void list_probes(const std::string &search)
std::string line, probe; std::string line, probe;
// software // software
list_probes_from_list(SW_PROBE_LIST, search); list_probes_from_list(SW_PROBE_LIST, "software", search);
// hardware // hardware
std::cout << std::endl; list_probes_from_list(HW_PROBE_LIST, "hardware", search);
list_probes_from_list(HW_PROBE_LIST, search);
// tracepoints // tracepoints
std::cout << std::endl;
std::vector<std::string> cats = std::vector<std::string>(); std::vector<std::string> cats = std::vector<std::string>();
list_dir(tp_path, cats); list_dir(tp_path, cats);
for (i = 0; i < cats.size(); i++) for (i = 0; i < cats.size(); i++)
...@@ -121,7 +117,6 @@ void list_probes(const std::string &search) ...@@ -121,7 +117,6 @@ void list_probes(const std::string &search)
} }
// kprobes // kprobes
std::cout << std::endl;
std::ifstream file(kprobe_path); std::ifstream file(kprobe_path);
if (file.fail()) if (file.fail())
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment