From: Jiri Olsa <jolsa@redhat.com>
To: Wei Li <liwei391@huawei.com>
Cc: jolsa@kernel.org, alexander.shishkin@linux.intel.com,
dsahern@gmail.com, namhyung@kernel.org, peterz@infradead.org,
acme@redhat.com, linux-kernel@vger.kernel.org,
kim.phillips@arm.com, guohanjun@huawei.com,
huawei.libin@huawei.com
Subject: Re: [PATCH] perf machine: Update kernel map address and re-order properly
Date: Thu, 28 Feb 2019 12:28:38 +0100 [thread overview]
Message-ID: <20190228112838.GC18636@krava> (raw)
In-Reply-To: <20190228092003.34071-1-liwei391@huawei.com>
On Thu, Feb 28, 2019 at 05:20:03PM +0800, Wei Li wrote:
> Since commit 1fb87b8e9599 ("perf machine: Don't search for active kernel
> start in __machine__create_kernel_maps"), the __machine__create_kernel_maps()
> just create a map what start and end are both zero. Though the address will be
> updated later, the order of map in the rbtree may be incorrect.
>
> The commit ee05d21791db ("perf machine: Set main kernel end address properly")
> fixed the logic in machine__create_kernel_maps(), but it's still wrong in
> function machine__process_kernel_mmap_event().
>
> To reproduce this issue, we need an environment which the module address
> is before the kernel text segment. I tested it on an aarch64 machine with
> kernel 4.19.25:
so that was the missing piece.. nice
>
> [root@localhost hulk]# grep _stext /proc/kallsyms
> ffff000008081000 T _stext
> [root@localhost hulk]# grep _etext /proc/kallsyms
> ffff000009780000 R _etext
> [root@localhost hulk]# tail /proc/modules
> hisi_sas_v2_hw 77824 0 - Live 0xffff00000191d000
> nvme_core 126976 7 nvme, Live 0xffff0000018b6000
> mdio 20480 1 ixgbe, Live 0xffff0000018ab000
> hisi_sas_main 106496 1 hisi_sas_v2_hw, Live 0xffff000001861000
> hns_mdio 20480 2 - Live 0xffff000001822000
> hnae 28672 3 hns_dsaf,hns_enet_drv, Live 0xffff000001815000
> dm_mirror 40960 0 - Live 0xffff000001804000
> dm_region_hash 32768 1 dm_mirror, Live 0xffff0000017f5000
> dm_log 32768 2 dm_mirror,dm_region_hash, Live 0xffff0000017e7000
> dm_mod 315392 17 dm_mirror,dm_log, Live 0xffff000001780000
> [root@localhost hulk]#
>
> Before fix:
>
> [root@localhost bin]# perf record sleep 3
> [ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 0.011 MB perf.data (9 samples) ]
> [root@localhost bin]# perf buildid-list -i perf.data
> 4c4e46c971ca935f781e603a09b52a92e8bdfee8 [vdso]
> [root@localhost bin]# perf buildid-list -i perf.data -H
> 0000000000000000000000000000000000000000 /proc/kcore
> [root@localhost bin]#
>
> After fix:
>
> [root@localhost tools]# ./perf/perf record sleep 3
> [ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 0.011 MB perf.data (9 samples) ]
> [root@localhost tools]# ./perf/perf buildid-list -i perf.data
> 28a6c690262896dbd1b5e1011ed81623e6db0610 [kernel.kallsyms]
> 106c14ce6e4acea3453e484dc604d66666f08a2f [vdso]
> [root@localhost tools]# ./perf/perf buildid-list -i perf.data -H
> 28a6c690262896dbd1b5e1011ed81623e6db0610 /proc/kcore
>
> Signed-off-by: Wei Li <liwei391@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
good catch, thanks
jirka
next prev parent reply other threads:[~2019-02-28 11:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-28 9:20 [PATCH] perf machine: Update kernel map address and re-order properly Wei Li
2019-02-28 11:28 ` Jiri Olsa [this message]
2019-03-26 9:11 ` liwei (GF)
2019-03-26 14:03 ` Namhyung Kim
2019-03-26 18:19 ` Arnaldo Carvalho de Melo
2019-03-29 20:41 ` [tip:perf/urgent] " tip-bot for Wei Li
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=20190228112838.GC18636@krava \
--to=jolsa@redhat.com \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=dsahern@gmail.com \
--cc=guohanjun@huawei.com \
--cc=huawei.libin@huawei.com \
--cc=jolsa@kernel.org \
--cc=kim.phillips@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liwei391@huawei.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.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