linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert "perf report: Treat an argument as a symbol filter"
@ 2020-09-17  3:14 Wei Li
  2020-09-17  5:23 ` Namhyung Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Li @ 2020-09-17  3:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim
  Cc: linux-kernel, huawei.libin, guohanjun

Since commit 6db6127c4dad ("perf report: Treat an argument as a symbol
filter"), the only one unrecognized argument for perf-report is treated
as a symbol filter. This is not described in man page nor help info,
and the result is really confusing, especially when it's misspecified by
the user (e.g. missing -i for perf.data).

As we can use "--symbol-filter=" if we really want to filter a symbol,
it may be better to revert this misfeature.

Signed-off-by: Wei Li <liwei391@huawei.com>
---
 tools/perf/builtin-report.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 3c74c9c0f3c3..f57ebc1bcd20 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -1317,13 +1317,9 @@ int cmd_report(int argc, const char **argv)
 	argc = parse_options(argc, argv, options, report_usage, 0);
 	if (argc) {
 		/*
-		 * Special case: if there's an argument left then assume that
-		 * it's a symbol filter:
+		 * Any (unrecognized) arguments left?
 		 */
-		if (argc > 1)
-			usage_with_options(report_usage, options);
-
-		report.symbol_filter_str = argv[0];
+		usage_with_options(report_usage, options);
 	}
 
 	if (annotate_check_args(&report.annotation_opts) < 0)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Revert "perf report: Treat an argument as a symbol filter"
  2020-09-17  3:14 [PATCH] Revert "perf report: Treat an argument as a symbol filter" Wei Li
@ 2020-09-17  5:23 ` Namhyung Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Namhyung Kim @ 2020-09-17  5:23 UTC (permalink / raw)
  To: Wei Li
  Cc: Arnaldo Carvalho de Melo, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, linux-kernel, Li Bin, guohanjun

On Thu, Sep 17, 2020 at 12:15 PM Wei Li <liwei391@huawei.com> wrote:
>
> Since commit 6db6127c4dad ("perf report: Treat an argument as a symbol
> filter"), the only one unrecognized argument for perf-report is treated
> as a symbol filter. This is not described in man page nor help info,
> and the result is really confusing, especially when it's misspecified by
> the user (e.g. missing -i for perf.data).

How about adding documentation then?

Thanks
Namhyung

>
> As we can use "--symbol-filter=" if we really want to filter a symbol,
> it may be better to revert this misfeature.
>
> Signed-off-by: Wei Li <liwei391@huawei.com>
> ---
>  tools/perf/builtin-report.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index 3c74c9c0f3c3..f57ebc1bcd20 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -1317,13 +1317,9 @@ int cmd_report(int argc, const char **argv)
>         argc = parse_options(argc, argv, options, report_usage, 0);
>         if (argc) {
>                 /*
> -                * Special case: if there's an argument left then assume that
> -                * it's a symbol filter:
> +                * Any (unrecognized) arguments left?
>                  */
> -               if (argc > 1)
> -                       usage_with_options(report_usage, options);
> -
> -               report.symbol_filter_str = argv[0];
> +               usage_with_options(report_usage, options);
>         }
>
>         if (annotate_check_args(&report.annotation_opts) < 0)
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-17  5:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17  3:14 [PATCH] Revert "perf report: Treat an argument as a symbol filter" Wei Li
2020-09-17  5:23 ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).