From: Ingo Molnar <mingo@elte.hu>
To: Namhyung Kim <namhyung.kim@lge.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Paul Mackerras <paulus@samba.org>,
Namhyung Kim <namhyung@gmail.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/4] perf report: Treat an argument as a symbol filter
Date: Tue, 13 Mar 2012 07:21:09 +0100 [thread overview]
Message-ID: <20120313062105.GB24357@elte.hu> (raw)
In-Reply-To: <1331619294-29162-4-git-send-email-namhyung.kim@lge.com>
* Namhyung Kim <namhyung.kim@lge.com> wrote:
> 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.
>
> Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
> ---
> tools/perf/builtin-report.c | 19 ++++++++++++++-----
> 1 files changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index 25d34d483e49..62c4a11bcf3e 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -50,6 +50,7 @@ struct perf_report {
> const char *pretty_printing_style;
> symbol_filter_t annotate_init;
> const char *cpu_list;
> + const char *symbol_filter_str;
> DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS);
> };
>
> @@ -315,6 +316,9 @@ static int __cmd_report(struct perf_report *rep)
> list_for_each_entry(pos, &session->evlist->entries, node) {
> struct hists *hists = &pos->hists;
>
> + if (pos->idx == 0)
> + hists->symbol_filter_str = rep->symbol_filter_str;
> +
> hists__collapse_resort(hists);
> hists__output_resort(hists);
> nr_samples += hists->stats.nr_events[PERF_RECORD_SAMPLE];
> @@ -586,11 +590,16 @@ int cmd_report(int argc, const char **argv, const char *prefix __used)
> } else
> symbol_conf.exclude_other = false;
>
> - /*
> - * Any (unrecognized) arguments left?
> - */
> - if (argc)
> - usage_with_options(report_usage, options);
> + if (argc) {
> + /*
> + * Special case: if there's an argument left then assume tha
s/tha/that
> + * it's a symbol filter:
> + */
> + if (argc > 1)
> + usage_with_options(report_usage, options);
> +
> + report.symbol_filter_str = argv[0];
> + }
Are people fine with this special case?
To play the devil's advocate it uses up valuable perf report
command line real estate and we probably cannot change this
workflow in the future, once people get used to it.
For example doing this would preclude us from adding subsystem
subcommands to perf report in the future, such as:
$ perf report sched
$ perf report kvm
...
OTOH have 'perf sched' and 'perf kvm' and maybe those are better
provided as:
$ perf kvm report
$ perf sched report
:-)
Thanks,
Ingo
next prev parent reply other threads:[~2012-03-13 6:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-13 6:14 [PATCH 1/4] perf hists: Add hists__filter_by_symbol Namhyung Kim
2012-03-13 6:14 ` [PATCH 2/4] perf ui browser: Introduce ui_browser__input_window Namhyung Kim
2012-03-13 6:14 ` [PATCH 3/4] perf ui browser: Add 's' key to filter by symbol name Namhyung Kim
2012-03-13 6:14 ` [PATCH 4/4] perf report: Treat an argument as a symbol filter Namhyung Kim
2012-03-13 6:21 ` Ingo Molnar [this message]
2012-03-13 13:40 ` Peter Zijlstra
2012-03-13 15:24 ` Ingo Molnar
2012-03-15 0:39 ` [PATCH] perf report: Add --symbol-filter option Namhyung Kim
2012-03-15 17:34 ` [PATCH 1/4] perf hists: Add hists__filter_by_symbol Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120313062105.GB24357@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung.kim@lge.com \
--cc=namhyung@gmail.com \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®