Commit 6db6127c4dad634ab98709b81e2f2770890b0d53

Authored by Namhyung Kim
Committed by Arnaldo Carvalho de Melo
1 parent b14ffaca44

perf report: Treat an argument as a symbol filter

As Ingo requested, it'd be better off treating first (and the only)
argument as a symbol filter, so that user doesn't need to input the
symbol on the dialog window on TUI.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1331887855-874-5-git-send-email-namhyung.kim@lge.com
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Showing 1 changed file with 10 additions and 5 deletions Side-by-side Diff

tools/perf/builtin-report.c
... ... @@ -715,11 +715,16 @@
715 715 } else
716 716 symbol_conf.exclude_other = false;
717 717  
718   - /*
719   - * Any (unrecognized) arguments left?
720   - */
721   - if (argc)
722   - usage_with_options(report_usage, options);
  718 + if (argc) {
  719 + /*
  720 + * Special case: if there's an argument left then assume that
  721 + * it's a symbol filter:
  722 + */
  723 + if (argc > 1)
  724 + usage_with_options(report_usage, options);
  725 +
  726 + report.symbol_filter_str = argv[0];
  727 + }
723 728  
724 729 sort_entry__setup_elide(&sort_comm, symbol_conf.comm_list, "comm", stdout);
725 730