[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191014141947.GH19627@kernel.org>
Date: Mon, 14 Oct 2019 11:19:47 -0300
From: Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To: Ian Rogers <irogers@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Jin Yao <yao.jin@...ux.intel.com>,
Song Liu <songliubraving@...com>, linux-kernel@...r.kernel.org,
clang-built-linux@...glegroups.com,
Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 3/5] perf annotate: don't pipe objdump output through grep
Em Thu, Oct 10, 2019 at 11:36:47AM -0700, Ian Rogers escreveu:
> Simplify the objdump command by not piping the output of objdump through
> grep. Instead, drop lines that match the grep pattern during the reading
> loop.
Thanks, applied and tested.
- Arnaldo
> Signed-off-by: Ian Rogers <irogers@...gle.com>
> ---
> tools/perf/util/annotate.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> index fc12c5cfe112..0a7a6f3c55f4 100644
> --- a/tools/perf/util/annotate.c
> +++ b/tools/perf/util/annotate.c
> @@ -1894,7 +1894,7 @@ static int symbol__disassemble(struct symbol *sym, struct annotate_args *args)
> err = asprintf(&command,
> "%s %s%s --start-address=0x%016" PRIx64
> " --stop-address=0x%016" PRIx64
> - " -l -d %s %s -C \"$1\" 2>/dev/null|grep -v \"$1:\"|expand",
> + " -l -d %s %s -C \"$1\" 2>/dev/null|expand",
> opts->objdump_path ?: "objdump",
> opts->disassembler_style ? "-M " : "",
> opts->disassembler_style ?: "",
> @@ -1940,9 +1940,16 @@ static int symbol__disassemble(struct symbol *sym, struct annotate_args *args)
>
> nline = 0;
> while (!feof(file)) {
> + const char *match;
> +
> if (getline(&line, &line_len, file) < 0 || !line)
> break;
>
> + /* Skip lines containing "filename:" */
> + match = strstr(line, symfs_filename);
> + if (match && match[strlen(symfs_filename)] == ':')
> + continue;
> +
> /*
> * The source code line number (lineno) needs to be kept in
> * across calls to symbol__parse_objdump_line(), so that it
> --
> 2.23.0.581.g78d2f28ef7-goog
--
- Arnaldo
Powered by blists - more mailing lists