Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2149507imd; Fri, 2 Nov 2018 06:49:06 -0700 (PDT) X-Google-Smtp-Source: AJdET5eAtTG5L1DxIO/hXMLgxx97wR8jH3ctmaSW7H5tHVSYoIbmqpQYSu+K+h0QuDbuG1RWfom8 X-Received: by 2002:a17:902:d88f:: with SMTP id b15-v6mr8507218plz.207.1541166546368; Fri, 02 Nov 2018 06:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541166546; cv=none; d=google.com; s=arc-20160816; b=AoLGHjlvz68+ECfOA+2VhkT+ieJqxkJM4b2r2KabQhogWYsFQ1duW/L4wLURP2Qck3 loz2VUtHONzb2GJIqmG1hQsRFIFAXYZbV1m2BWjGjAFmYeoEZvXtBpNohiiL4Q5PFMjg o/EaK18IZzZYHhs2GlrY6S1dEyVyc3jhAjlWqFh7myaMaeHLr99aI72vKUjMrVx7U6GX gIYx0+sGnrTlO207qQFEUsV17L7nMZIjIMzxUwPEzP2sZ9qIUyTa4Br8Wy6Gd4smHP6D YYrCUWD0FEUg2e9pX4zGPhj/C7fUAiCrzC7H9675vDyEMDVv4wCPBqYkyucsi1IMRqfU 1Eog== 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:dkim-signature; bh=w/aI533E4xRuKv3yXO3QjhJ7qb8aI1RZuL1gJEaOK8I=; b=PacekkX+zSw4kG4MJXlPHQ4cczIgWcBDlYQ0Kl5CLWm63hNLL2rx1lKFR24gWBQmk5 HxiJ/tDB4ptrbNnmfxhNNUobbf1WjcASG56QryxCBftZz0o+jdlSQGTjo6Srjbm814/3 jbbhlB3Ux3dtyqnEf3LhbbHFJR4HkRasK+AysJs08V/iIKBvCurRFAOTQfgQF8TtLSxC cv7NWg7irTa2fo3TuLEadeCl5m7FbiyYZ1DOBArDHEGKF8juV0lqeCpONfU0/L/DSXYx 1ABu1i5wDrYJ5Ojn0Ooc8bElvpOn4Ka2obNc6bF+29DemUhVoK/FZgfS/0i5i9XysCL6 qQdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bJU1wme2; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c6-v6si15425190pfi.110.2018.11.02.06.48.51; Fri, 02 Nov 2018 06:49:06 -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; dkim=pass header.i=@linaro.org header.s=google header.b=bJU1wme2; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727714AbeKBWyL (ORCPT + 99 others); Fri, 2 Nov 2018 18:54:11 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54008 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726026AbeKBWyL (ORCPT ); Fri, 2 Nov 2018 18:54:11 -0400 Received: by mail-wm1-f67.google.com with SMTP id v24-v6so2052935wmh.3 for ; Fri, 02 Nov 2018 06:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=w/aI533E4xRuKv3yXO3QjhJ7qb8aI1RZuL1gJEaOK8I=; b=bJU1wme2jllQDNuZhNA+RkdvkOfnwwEhJD6Y/jYYjie2hyi8hwoDN6EP3OdUhkyVwk TR2/ra52IB3VVXGjNJ9FHkVnIX0i2yP6Sr0l55Bc1d3Pcu5/6C7P6diwh7VLcfHR+qig AIwrQGXMEBvWAQ4vgMlcygAko1xv6Dcs9OIcg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=w/aI533E4xRuKv3yXO3QjhJ7qb8aI1RZuL1gJEaOK8I=; b=RY/b5rqSoYohwT4ggr/l5PV7w0S7MSHXCUkcd9wRwK6qaYy7VQkRH/uViBAoB0CTPd v0FzYPM1Rc4Cupy921KVo3iIu2iCFu+EJqTTCEe7KMT1nfKlBGAb14nvGtl1nJ0j7Bga ufqKTDE1ufS/grIeF6uvcHGcExPTKNkvq3dff+hM4EXferdpcLZcqCC0agxN+HjKnGpX nJ6xbG0YKfmRc/7nM/dDeeGt4aJrPYjEvnRRNUUdhyXQdoOhGbB+D4C8nBuZh6WICrU0 kt+yqNS2n5Z8f37DBsI8tQSWoRqT0bkcKV5ZoEIsKTgLNMHFxOEKWujvYN2FVieQHX++ kI/g== X-Gm-Message-State: AGRZ1gLc2Bg6joz8Y8FVKBr/AosvH4P7KatqYRw2Wvi5oZfUSQInSKxD 5YoYKEthH8wDJ1Aza4+QdMKajg== X-Received: by 2002:a1c:c4f:: with SMTP id 76-v6mr51138wmm.6.1541166416662; Fri, 02 Nov 2018 06:46:56 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([209.250.228.18]) by smtp.gmail.com with ESMTPSA id s195-v6sm2831701wmd.39.2018.11.02.06.46.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Nov 2018 06:46:55 -0700 (PDT) Date: Fri, 2 Nov 2018 21:46:49 +0800 From: leo.yan@linaro.org To: Al Grant Cc: "acme@redhat.com" , Jiri Olsa , Mathieu Poirier , Coresight ML , "linux-kernel@vger.kernel.org" Subject: Re: Question: perf dso support for /proc/kallsyms Message-ID: <20181102134649.GB3983@leoy-ThinkPad-X240s> References: <20181102025516.GA25374@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10+31 (9cdd884) (2018-06-19) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Al, On Fri, Nov 02, 2018 at 12:08:04PM +0000, Al Grant wrote: > > Now I still don't understand how the dso/map support "/proc/kallsyms" and > > have no idea to fix this issue, though I spent some time to look into it. > > The way this is supported is that at record time, pseudo mmap records > are created for the kernel. But depending on permissions these might > not get created. This isn't just an ETM issue, it can happen on Intel too. Agree, I also think this is not a specific issue only for Arm platform, this should be one common issue for how to parse kernel symbols with kallsyms file. > What do you see in "perf report -D", do you see a PERF_RECORD_MMAP > record for "[kernel.kallsyms]_text" and possibly some others for loadable > kernel modules in /lib/modules? Yes, I can see PERF_RECORD_MMAP for "[kernel.kallsyms]_text". 0x350 [0x50]: event: 1 . . ... raw event: size 80 bytes . 0000: 01 00 00 00 01 00 50 00 ff ff ff ff 00 00 00 00 ......P......... . 0010: 00 00 08 08 00 00 ff ff ff ff f7 f7 ff ff 00 00 ................ . 0020: 00 00 08 08 00 00 ff ff 5b 6b 65 72 6e 65 6c 2e ........[kernel. . 0030: 6b 61 6c 6c 73 79 6d 73 5d 5f 74 65 78 74 00 00 kallsyms]_text.. . 0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0x350 [0x50]: PERF_RECORD_MMAP -1/0: [0xffff000008080000(0xfffff7f7ffff) @ 0xffff000008080000]: x [kernel.kallsyms]_text Below is the infor for checking buildid: root@debian:~/coresight_test# perf buildid-list 0242d9154c78df1d8fe1d0512c36a236d0861a18 [kernel.kallsyms] b8c89e8ba41a2ea486c66a50c29c60d38c34a759 /root/coresight_test/main 26b12a9d1a54ed2b0478cb0203435b76aabab3fb /usr/lib/aarch64-linux-gnu/ld-2.27.so 8fca7ed524c9469b065af83bc8a529fe72858f53 [vdso] 25829a59e21012cfde7850b30a310cd3a58f531c /root/coresight_test/libcstest.so 70512527439ef76c8802a7a2a546bde6a5a6e967 /usr/lib/aarch64-linux-gnu/libc-2.27.so root@debian:~/coresight_test# ls ~/.debug/\[kernel.kallsyms\]/0242d9154c78df1d8fe1d0512c36a236d0861a18/ kallsyms > Does it all work if you run perf record as sudo? Or if you do > > sudo sysctl kernel.kptr_restrict=0 > > before you run perf record? Yes, tested this on Juno board with Debian rootFS and logined in with 'root' user. I suspected the pointer permission issue so checked with below command: root@debian:~/coresight_test# cat /proc/sys/kernel/kptr_restrict 0 Thanks, Leo Yan