Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4537992img; Tue, 26 Mar 2019 11:20:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGJSvhrl51oS5fh6aFFwiXLKhWGK/Kr4aYEinfk/D+Whf1inoSyozcWV03wYhLsGhPAC+g X-Received: by 2002:a62:f20e:: with SMTP id m14mr6645580pfh.228.1553624454173; Tue, 26 Mar 2019 11:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553624454; cv=none; d=google.com; s=arc-20160816; b=ZKb+jtpcyaOpCXXiWRnKJgDhcMWwsrhpJvYh1cYAgVQypYJIHkodqnCeB19MiAYbVK 06U/iHY/MI8RqblYsT4AV5q/QsqokL6ChEQ6UYITSdscgzcZrCUZPn9Lj8P3mbFRnAs+ HxrBFzC1ONUuunGDSaQ6tepe5RN2mkJ4hzOKLY0pqH8bgZGW4BsbGYOd7tcfz+qVgOqe y2ebmTiCRM3qoYCW/Dq4WQGo+s8rtJmEfD3nL30Vb/55USmxC773BoWM81brZppuW04m S8yYN4G5rmuJsoxXELfnc6LliVMR5zG8o7p+FJja/jqrzgAtLAI5zwhvcqlAGXGahmDl sk9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=PBdDX9x6lDrnnxru+LkjSbiI7Ut0UdrFtF1kOAbijHM=; b=a4Q2YDz5FZNm5BFH0iS61a2f0ubtOFWjSOTZK7XlDLRolzpi9iqSPVJErh5OQeU7Eg xjEgx90NLETler+xKkAstoiD1nI+oU/HBy8DBzz/bWaf3M2Vpa2nAHdWTnpzOn7ER/Xq rScQ2kGNwp9FPRdcuz4k/fOT2FFBajdgt7mkLVNwcuXPwg8JnQsSsBmBCONZzGDSD2Rv XPWscD+uqyqJvxZ0AIdOGBg8yei6zA7scbiJh4Aym+PLfzttWcydyQtMUc9nX1SpHuMp +9bxGoeeE0n1CFBA2zxMW/pUZz06oeER+PXyjahfRcPrd4jqbuZctXB8kNHZgtcr9a5e DfXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12si10390208pgh.303.2019.03.26.11.20.39; Tue, 26 Mar 2019 11:20:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732526AbfCZST6 (ORCPT + 99 others); Tue, 26 Mar 2019 14:19:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33958 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732064AbfCZST6 (ORCPT ); Tue, 26 Mar 2019 14:19:58 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9ADDF3086226; Tue, 26 Mar 2019 18:19:57 +0000 (UTC) Received: from sandy.ghostprotocols.net (ovpn-112-27.phx2.redhat.com [10.3.112.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F084E18948; Tue, 26 Mar 2019 18:19:56 +0000 (UTC) Received: by sandy.ghostprotocols.net (Postfix, from userid 1000) id A7C6655CF; Tue, 26 Mar 2019 15:19:53 -0300 (BRT) Date: Tue, 26 Mar 2019 15:19:53 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: "liwei (GF)" , Jiri Olsa , Jiri Olsa , Alexander Shishkin , David Ahern , Peter Zijlstra , linux-kernel , Kim Phillips , guohanjun@huawei.com, Li Bin Subject: Re: [PATCH] perf machine: Update kernel map address and re-order properly Message-ID: <20190326181953.GD2132@redhat.com> References: <20190228092003.34071-1-liwei391@huawei.com> <20190228112838.GC18636@krava> <16b9191e-c444-8bdc-d23b-c4267440b3f2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.20 (2009-12-10) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 26 Mar 2019 18:19:57 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Mar 26, 2019 at 11:03:14PM +0900, Namhyung Kim escreveu: > Hello, > > On Tue, Mar 26, 2019 at 6:12 PM liwei (GF) wrote: > > > > Hi Arnaldo, > > > > Please shoot a glance at this modification, i think this issue is influential. > > > > On 2019/2/28 19:28, Jiri Olsa Wrote: > > > 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 > > > > > > Acked-by: Jiri Olsa > > Acked-by: Namhyung Kim Thanks, applied to perf/urgent. - Arnaldo