diff options
Diffstat (limited to 'tools/perf/builtin-probe.c')
-rw-r--r-- | tools/perf/builtin-probe.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index add163c9f0e7..6cf708aba7c9 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c | |||
@@ -52,6 +52,7 @@ static struct { | |||
52 | bool show_lines; | 52 | bool show_lines; |
53 | bool show_vars; | 53 | bool show_vars; |
54 | bool show_ext_vars; | 54 | bool show_ext_vars; |
55 | bool show_funcs; | ||
55 | bool mod_events; | 56 | bool mod_events; |
56 | int nevents; | 57 | int nevents; |
57 | struct perf_probe_event events[MAX_PROBES]; | 58 | struct perf_probe_event events[MAX_PROBES]; |
@@ -221,6 +222,8 @@ static const struct option options[] = { | |||
221 | OPT__DRY_RUN(&probe_event_dry_run), | 222 | OPT__DRY_RUN(&probe_event_dry_run), |
222 | OPT_INTEGER('\0', "max-probes", ¶ms.max_probe_points, | 223 | OPT_INTEGER('\0', "max-probes", ¶ms.max_probe_points, |
223 | "Set how many probe points can be found for a probe."), | 224 | "Set how many probe points can be found for a probe."), |
225 | OPT_BOOLEAN('F', "funcs", ¶ms.show_funcs, | ||
226 | "Show potential probe-able functions."), | ||
224 | OPT_END() | 227 | OPT_END() |
225 | }; | 228 | }; |
226 | 229 | ||
@@ -246,7 +249,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) | |||
246 | params.max_probe_points = MAX_PROBES; | 249 | params.max_probe_points = MAX_PROBES; |
247 | 250 | ||
248 | if ((!params.nevents && !params.dellist && !params.list_events && | 251 | if ((!params.nevents && !params.dellist && !params.list_events && |
249 | !params.show_lines)) | 252 | !params.show_lines && !params.show_funcs)) |
250 | usage_with_options(probe_usage, options); | 253 | usage_with_options(probe_usage, options); |
251 | 254 | ||
252 | /* | 255 | /* |
@@ -267,12 +270,36 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) | |||
267 | pr_err(" Error: Don't use --list with --vars.\n"); | 270 | pr_err(" Error: Don't use --list with --vars.\n"); |
268 | usage_with_options(probe_usage, options); | 271 | usage_with_options(probe_usage, options); |
269 | } | 272 | } |
273 | if (params.show_funcs) { | ||
274 | pr_err(" Error: Don't use --list with --funcs.\n"); | ||
275 | usage_with_options(probe_usage, options); | ||
276 | } | ||
270 | ret = show_perf_probe_events(); | 277 | ret = show_perf_probe_events(); |
271 | if (ret < 0) | 278 | if (ret < 0) |
272 | pr_err(" Error: Failed to show event list. (%d)\n", | 279 | pr_err(" Error: Failed to show event list. (%d)\n", |
273 | ret); | 280 | ret); |
274 | return ret; | 281 | return ret; |
275 | } | 282 | } |
283 | if (params.show_funcs) { | ||
284 | if (params.nevents != 0 || params.dellist) { | ||
285 | pr_err(" Error: Don't use --funcs with" | ||
286 | " --add/--del.\n"); | ||
287 | usage_with_options(probe_usage, options); | ||
288 | } | ||
289 | if (params.show_lines) { | ||
290 | pr_err(" Error: Don't use --funcs with --line.\n"); | ||
291 | usage_with_options(probe_usage, options); | ||
292 | } | ||
293 | if (params.show_vars) { | ||
294 | pr_err(" Error: Don't use --funcs with --vars.\n"); | ||
295 | usage_with_options(probe_usage, options); | ||
296 | } | ||
297 | ret = show_available_funcs(params.target_module); | ||
298 | if (ret < 0) | ||
299 | pr_err(" Error: Failed to show functions." | ||
300 | " (%d)\n", ret); | ||
301 | return ret; | ||
302 | } | ||
276 | 303 | ||
277 | #ifdef DWARF_SUPPORT | 304 | #ifdef DWARF_SUPPORT |
278 | if (params.show_lines) { | 305 | if (params.show_lines) { |