From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/5] perf script: Fix unnecessary machine_resolve()
Date: Tue, 10 Aug 2021 15:25:49 -0300 [thread overview]
Message-ID: <YRLErQjNd77Y1jKy@kernel.org> (raw)
In-Reply-To: <20210810114813.12951-2-adrian.hunter@intel.com>
Em Tue, Aug 10, 2021 at 02:48:09PM +0300, Adrian Hunter escreveu:
> machine_resolve() may have already been called. Test for that to avoid
> calling it again unnecessarily.
By some dlfilter function, right...
Perhaps it would be better for machine__resolve() itself to check that?
Probably we'll need a 'force' arg, or have __machine__resolve() that
does exactly what machine__resolve() does today and then tools wanting
to force it to avoid using whatever is 'cached'?
- Arnaldo
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> tools/perf/builtin-script.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index e2e165b53499..f469354155f1 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -2212,7 +2212,7 @@ static int process_sample_event(struct perf_tool *tool,
> if (filter_cpu(sample))
> goto out_put;
>
> - if (machine__resolve(machine, &al, sample) < 0) {
> + if (!al.thread && machine__resolve(machine, &al, sample) < 0) {
> pr_err("problem processing %d event, skipping it.\n",
> event->header.type);
> ret = -1;
> --
> 2.17.1
>
--
- Arnaldo
next prev parent reply other threads:[~2021-08-10 18:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-10 11:48 [PATCH 0/5] perf tools: Add dlfilter test Adrian Hunter
2021-08-10 11:48 ` [PATCH 1/5] perf script: Fix unnecessary machine_resolve() Adrian Hunter
2021-08-10 18:25 ` Arnaldo Carvalho de Melo [this message]
2021-08-11 10:18 ` Adrian Hunter
2021-08-10 11:48 ` [PATCH 2/5] perf script: Fix --list-dlfilters documentation Adrian Hunter
2021-08-10 18:28 ` Arnaldo Carvalho de Melo
2021-08-10 11:48 ` [PATCH 3/5] perf tools: Amend dlfilter documentation wrt library dependencies Adrian Hunter
2021-08-10 11:48 ` [PATCH 4/5] perf tools: Move perf_dlfilters.h in the source tree Adrian Hunter
2021-08-10 11:48 ` [PATCH 5/5] perf tools: Add dlfilter test Adrian Hunter
2021-08-10 18:32 ` Arnaldo Carvalho de Melo
2021-08-10 19:06 ` Adrian Hunter
2021-08-10 20:21 ` Arnaldo Carvalho de Melo
2021-08-11 10:10 ` Adrian Hunter
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=YRLErQjNd77Y1jKy@kernel.org \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).