From: "Liang, Kan" <kan.liang@intel.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: "acme@kernel.org" <acme@kernel.org>,
"namhyung@kernel.org" <namhyung@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"ak@linux.intel.com" <ak@linux.intel.com>
Subject: RE: [PATCH V5 3/3] perf tool: check buildid for symoff
Date: Tue, 25 Nov 2014 17:19:23 +0000 [thread overview]
Message-ID: <37D7C6CF3E00A74B8858931C1DB2F07701676387@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <20141125122159.GF30861@krava.brq.redhat.com>
> > + data__for_each_file_new(i, d) {
> > + k_dsos_tmp = &d->session->machines.host.kernel_dsos;
> > + u_dsos_tmp = &d->session->machines.host.user_dsos;
> > +
> > + if (!dsos__build_ids_equal(base_k_dsos, k_dsos_tmp))
> > + pr_warning("The perf.data come from different
> kernel. "
> > + "The kernel symbol offset may vary for
> different kernel.\n");
> > +
> > + if (!dsos__build_ids_equal(base_u_dsos, u_dsos_tmp))
>
> looks like at this time not all dsos on the list have the buildids read..
>
Right, I shouldn't assume all dsos have biuldids. I will modify the
dsos__build_ids_equal to check has_build_id.
If neither dsos have build_id, it will print
pr_debug ("Cannot get build_id for all dsos\n") once, and continue to do
next dso compare.
All the buildid compare related warnings will also be printed once.
> I tried to put in here the perf_session__read_build_ids call but it keeps
> showing me warning below:
>
> > + pr_warning("The perf.data come from different
> user binary. "
> > + "The user space symbol offset may vary
> for different
> > +binaries.\n");
>
> for following workload:
>
> [jolsa@krava perf]$ ./perf record ls
> ...
> [ perf record: Woken up 1 times to write data ] [ perf record: Captured and
> wrote 0.012 MB perf.data (~540 samples) ] [jolsa@krava perf]$ ./perf
> record ls ...
> [ perf record: Woken up 1 times to write data ] [ perf record: Captured and
> wrote 0.012 MB perf.data (~540 samples) ] [jolsa@krava perf]$ ./perf diff -
> s symoff The perf.data come from different user binary. The user space
> symbol offset may vary for different binaries.
> # Event 'cycles'
> ...
Another reason for the false warning is that we use long_name to find the dso_b.
However, the long_name is not unique.
The vmlinux dso is added when processing header. Its long name and short name
are same. (E.g. /lib/modules/3.18.0-rc3-01635-g05066a2-dirty/build/vmlinux)
When processing sample, vmlinux is loaded. Two new dsos are added for section
"init.text" and "exit.text". They also have the long name
/lib/modules/3.18.0-rc3-01635-g05066a2-dirty/build/vmlinux. But their short
name are different, [kernel.vmlinux].init.text and [kernel.vmlinux].exit.text.
So I will change the dsos__build_ids_equal to find the dso by short_name.
Kan
>
>
> jirka
next prev parent reply other threads:[~2014-11-25 17:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-24 16:00 [PATCH V5 1/3] perf tool: Add sort key symoff for perf diff Kan Liang
2014-11-24 16:00 ` [PATCH V5 2/3] perf tool: new function to compare build_ids Kan Liang
2014-11-24 16:00 ` [PATCH V5 3/3] perf tool: check buildid for symoff Kan Liang
2014-11-25 11:51 ` Jiri Olsa
2014-11-26 16:10 ` Liang, Kan
2014-11-28 9:43 ` Jiri Olsa
2014-11-25 12:21 ` Jiri Olsa
2014-11-25 17:19 ` Liang, Kan [this message]
2014-11-27 2:05 ` Namhyung Kim
2014-11-27 14:09 ` Liang, Kan
2014-11-28 9:49 ` Jiri Olsa
2014-11-28 16:43 ` Liang, Kan
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=37D7C6CF3E00A74B8858931C1DB2F07701676387@SHSMSX103.ccr.corp.intel.com \
--to=kan.liang@intel.com \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@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).