aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-probe.c')
-rw-r--r--tools/perf/builtin-probe.c54
1 files changed, 9 insertions, 45 deletions
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 7af26acf06d9..2d3577d1009d 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -312,7 +312,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
312#endif 312#endif
313 NULL 313 NULL
314}; 314};
315 const struct option options[] = { 315 struct option options[] = {
316 OPT_INCR('v', "verbose", &verbose, 316 OPT_INCR('v', "verbose", &verbose,
317 "be more verbose (show parsed arguments, etc)"), 317 "be more verbose (show parsed arguments, etc)"),
318 OPT_BOOLEAN('l', "list", &params.list_events, 318 OPT_BOOLEAN('l', "list", &params.list_events,
@@ -382,6 +382,14 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
382 }; 382 };
383 int ret; 383 int ret;
384 384
385 set_option_flag(options, 'a', "add", PARSE_OPT_EXCLUSIVE);
386 set_option_flag(options, 'd', "del", PARSE_OPT_EXCLUSIVE);
387 set_option_flag(options, 'l', "list", PARSE_OPT_EXCLUSIVE);
388#ifdef HAVE_DWARF_SUPPORT
389 set_option_flag(options, 'L', "line", PARSE_OPT_EXCLUSIVE);
390 set_option_flag(options, 'V', "vars", PARSE_OPT_EXCLUSIVE);
391#endif
392
385 argc = parse_options(argc, argv, options, probe_usage, 393 argc = parse_options(argc, argv, options, probe_usage,
386 PARSE_OPT_STOP_AT_NON_OPTION); 394 PARSE_OPT_STOP_AT_NON_OPTION);
387 if (argc > 0) { 395 if (argc > 0) {
@@ -409,22 +417,6 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
409 symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL); 417 symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL);
410 418
411 if (params.list_events) { 419 if (params.list_events) {
412 if (params.mod_events) {
413 pr_err(" Error: Don't use --list with --add/--del.\n");
414 usage_with_options(probe_usage, options);
415 }
416 if (params.show_lines) {
417 pr_err(" Error: Don't use --list with --line.\n");
418 usage_with_options(probe_usage, options);
419 }
420 if (params.show_vars) {
421 pr_err(" Error: Don't use --list with --vars.\n");
422 usage_with_options(probe_usage, options);
423 }
424 if (params.show_funcs) {
425 pr_err(" Error: Don't use --list with --funcs.\n");
426 usage_with_options(probe_usage, options);
427 }
428 if (params.uprobes) { 420 if (params.uprobes) {
429 pr_warning(" Error: Don't use --list with --exec.\n"); 421 pr_warning(" Error: Don't use --list with --exec.\n");
430 usage_with_options(probe_usage, options); 422 usage_with_options(probe_usage, options);
@@ -435,19 +427,6 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
435 return ret; 427 return ret;
436 } 428 }
437 if (params.show_funcs) { 429 if (params.show_funcs) {
438 if (params.nevents != 0 || params.dellist) {
439 pr_err(" Error: Don't use --funcs with"
440 " --add/--del.\n");
441 usage_with_options(probe_usage, options);
442 }
443 if (params.show_lines) {
444 pr_err(" Error: Don't use --funcs with --line.\n");
445 usage_with_options(probe_usage, options);
446 }
447 if (params.show_vars) {
448 pr_err(" Error: Don't use --funcs with --vars.\n");
449 usage_with_options(probe_usage, options);
450 }
451 if (!params.filter) 430 if (!params.filter)
452 params.filter = strfilter__new(DEFAULT_FUNC_FILTER, 431 params.filter = strfilter__new(DEFAULT_FUNC_FILTER,
453 NULL); 432 NULL);
@@ -462,16 +441,6 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
462 441
463#ifdef HAVE_DWARF_SUPPORT 442#ifdef HAVE_DWARF_SUPPORT
464 if (params.show_lines) { 443 if (params.show_lines) {
465 if (params.mod_events) {
466 pr_err(" Error: Don't use --line with"
467 " --add/--del.\n");
468 usage_with_options(probe_usage, options);
469 }
470 if (params.show_vars) {
471 pr_err(" Error: Don't use --line with --vars.\n");
472 usage_with_options(probe_usage, options);
473 }
474
475 ret = show_line_range(&params.line_range, params.target, 444 ret = show_line_range(&params.line_range, params.target,
476 params.uprobes); 445 params.uprobes);
477 if (ret < 0) 446 if (ret < 0)
@@ -479,11 +448,6 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
479 return ret; 448 return ret;
480 } 449 }
481 if (params.show_vars) { 450 if (params.show_vars) {
482 if (params.mod_events) {
483 pr_err(" Error: Don't use --vars with"
484 " --add/--del.\n");
485 usage_with_options(probe_usage, options);
486 }
487 if (!params.filter) 451 if (!params.filter)
488 params.filter = strfilter__new(DEFAULT_VAR_FILTER, 452 params.filter = strfilter__new(DEFAULT_VAR_FILTER,
489 NULL); 453 NULL);