From: "Wangnan (F)" <wangnan0@huawei.com>
To: <acme@kernel.org>, <kan.liang@intel.com>
Cc: <linux-kernel@vger.kernel.org>, <lizefan@huawei.com>,
<pi3orama@163.com>, Adrian Hunter <adrian.hunter@intel.com>,
Andi Kleen <ak@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
"Stephane Eranian" <eranian@google.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH] perf report: Fix invalid memory accessing
Date: Mon, 7 Sep 2015 21:27:26 +0800 [thread overview]
Message-ID: <55ED90BE.9090706@huawei.com> (raw)
In-Reply-To: <1441630315-189525-1-git-send-email-wangnan0@huawei.com>
On 2015/9/7 20:51, Wang Nan wrote:
[SNIP]
> Although theoretically CPU_TOPOLOGY feature should always be selected by
> 'perf record', I did generate a perf.data without that feature. It has
> header like this:
>
> # perf report -i ./bad.perf.data --header-only
> # ========
> # captured on: Thu Jan 8 09:30:15 2009
> # hostname : localhost
> # os release : 3.10.49-gd672fc4
> # perf version : 4.2.gc9df
> # arch : aarch64
> # nrcpus online : 8
> # nrcpus avail : 8
> # total memory : 1850768 kB
> # cmdline : /system/bin/perf record -e sync:sync_timeline -e kgsl:kgsl_register_event -g -a sleep 5
> # event : name = sync:sync_timeline, , id = { 1107, 1108, 1109, 1110, 1111, 1112 }, type = 2, size = 112, config = 0x3e7, { sample_period, sample_freq } = 1, sample_type = IP|TID|TIME|CALLCHAIN|ID|CPU|PERIOD|RAW, read_format = ID, disabled = 1, inherit = 1, mmap = 1, comm = 1, task = 1, sample_id_all = 1, exclude_guest = 1, mmap2 = 1, comm_exec = 1
> # event : name = kgsl:kgsl_register_event, , id = { 1113, 1114, 1115, 1116, 1117, 1118 }, type = 2, size = 112, config = 0x350, { sample_period, sample_freq } = 1, sample_type = IP|TID|TIME|CALLCHAIN|ID|CPU|PERIOD|RAW, read_format = ID, disabled = 1, inherit = 1, sample_id_all = 1, exclude_guest = 1
> # pmu mappings: cpu = 4, software = 1, tracepoint = 2
> # ========
> #
>
> It should be:
>
> # ========
> # captured on: Thu Jan 8 11:26:41 2009
> ...
> # HEADER_CPU_TOPOLOGY info available, use -I to display
> # pmu mappings: cpu = 4, software = 1, tracepoint = 2
> # ========
>
> However, bad perf.data appears randomly. I can't stably reproduce it, so I
> guess there might have another invalid memory accessing.
>
>
I found the problem.
perf relies on build_cpu_topology() to fetch CPU_TOPOLOGY from sysfs. It
depend on
the existance of
/sys/devices/system/cpu/cpu%d/topology/core_siblings_list
However, CPU can be canceled by hotcpu subsystem. After that the
directory of
/sys/devices/system/cpu/cpu%d/topology is gone, which causes perf's
write_cpu_topology() --> uild_cpu_topology() to fail, result in the
above perf.data.
So I think my patch is required.
Thank you.
next prev parent reply other threads:[~2015-09-07 13:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-07 12:51 [PATCH] perf report: Fix invalid memory accessing Wang Nan
2015-09-07 13:03 ` Jiri Olsa
2015-09-07 13:08 ` Wangnan (F)
2015-09-07 13:27 ` Wangnan (F) [this message]
2015-09-08 7:37 ` Jiri Olsa
2015-09-08 8:12 ` Wangnan (F)
2015-09-08 13:13 ` Jiri Olsa
2015-09-08 13:16 ` pi3orama
2015-09-08 13:33 ` Jiri Olsa
2015-09-08 13:42 ` Liang, Kan
2015-09-08 15:18 ` Arnaldo Carvalho de Melo
2015-09-08 15:34 ` Jiri Olsa
[not found] ` <20150908154910.GN3475@kernel.org>
2015-09-08 15:58 ` Arnaldo Carvalho de Melo
2015-09-08 16:13 ` Arnaldo Carvalho de Melo
2015-09-08 16:35 ` Arnaldo Carvalho de Melo
2015-09-09 16:06 ` Arnaldo Carvalho de Melo
2015-09-09 16:46 ` 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=55ED90BE.9090706@huawei.com \
--to=wangnan0@huawei.com \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=eranian@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=namhyung@kernel.org \
--cc=pi3orama@163.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.