From patchwork Sat Aug 10 07:21:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 171007 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp213731ily; Sat, 10 Aug 2019 00:22:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpcT8oZGvECQs9Krlykllp8FaxXnwVK86ts8bviRoQ8uRDcb/slwr17DXrDWRD3xifl0GK X-Received: by 2002:a63:7c0d:: with SMTP id x13mr20799952pgc.360.1565421729895; Sat, 10 Aug 2019 00:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565421729; cv=none; d=google.com; s=arc-20160816; b=mo4tbP3FV+3C7W2Fwv6wJL6wUm0ApJiFH0bvoffJPDvvF6FHLHsZ+3uDccJVKXvFM9 jbzXKEtuLjI30QOOtA4W5QzFv3upOaV8xOrFZ/PIckNoJwA06prcyTbgBYxrRoobHkcf eGoS3tyoDPicZ3CRZkiD9B3pWikufQ5e83wsCeqGWwUQV+/j2Lh/3GJwaizeUX5knl9G eiAH/G2CWuQg6eU1VItoaqO7rHDW1rlNvGT1rMHiWbh5roJdiqPg3wkDISGVl+lgZUmy Y7nS9/yVmuu6C/5Nmn3hk/z5XqGRT3mohRs+8til2QGxajgQQJSz8bjtLI2Sk0lhCls1 20xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=Kqvj5qJEEnuY9tHLIsHKAJCMxbCgSGhB0GQjUNBVzjU=; b=VR5BuTL9IFHWKwiDSuedup2qRXgvRrzGdUMqNLoyjjzj8Nx+AKN6Bm4XAfBychXrgH U7GgqRT+hqtHkssJ4BVdAJiF/RSYN9Z6V+rAVKhf1tJ1uZj6hEBU53YdeY2jSfH0IsKT wPWKn1EYrYQzw3oquBO5EyuOHeQnotwn0XIAXGYLS0LJUVJdnxHd4zQ9TupHXqE+xFqO HVuTxxqaIsDbmtxurCyo2+7mXX8sTEPeu+mb6xHYjVDCgDcGyjQ5J0DX/jEY5suhLegZ N/gNznFa9aIs77qQ82eR6mLXyhNXtQ0Q1IoL8gjtk5cpk22NbxXVDYeM1AN5lfBv8wN8 kkgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="pN/qlGpA"; 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 14si57780429pgy.255.2019.08.10.00.22.09; Sat, 10 Aug 2019 00:22:09 -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="pN/qlGpA"; 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 S1726230AbfHJHWI (ORCPT + 28 others); Sat, 10 Aug 2019 03:22:08 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:43521 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725763AbfHJHWH (ORCPT ); Sat, 10 Aug 2019 03:22:07 -0400 Received: by mail-pf1-f195.google.com with SMTP id i189so47209176pfg.10 for ; Sat, 10 Aug 2019 00:22:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Kqvj5qJEEnuY9tHLIsHKAJCMxbCgSGhB0GQjUNBVzjU=; b=pN/qlGpA8abF6Y2VoHoy92OQQq3CMSqbXoIdJstu1huvjtuHlzemsHlD29Ba4F4utO +UeK5KoVrRu0etzH0vcO+0ApJqNcZj9rXGCkyt8spxUyMFRjwPpnBazmuhaFXTLalP6S Lp3HrbOgwuVvifao/yYUZzeuG8ssfQguwrqXmPbyF6y2xGEq0hnw//LC8p68WagfSLKH rsdDWlhVsgB+I7499JpZZuII9CApUi7KTaRS9kXf7Bz8QZGRH4mKTTx/dZ3qKUZRgIpX as4l8zy4iN8rP05Li25xLA1FIzCeDmSr2Tads+zy6ie5E7UV6uHqoqqdm8w9xwu1etk3 he6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Kqvj5qJEEnuY9tHLIsHKAJCMxbCgSGhB0GQjUNBVzjU=; b=TvAwVkrU0BukCmNHzZohqLnmSevUsiccHpouY+H8ZCiMscVD90kKPuZfrWHveDmllN x55RlUzvqO2I/jPC2wO3RazPrEbBrN8zuWjUbOChQZyYi5NqJ/Z45cYJWsfzNXScjPo0 0ZMjs8jkVJV4S0qA9Fm3akXRhC6PM+AeqVxnW3Dn8um8Cb5YkBIBRudqHXmRTrFfMPLB fS4JhwEIDNOjxSl5VLmmq2Ws3WzSt6U1+B9ueVAmfIy1ZK9tOBLgDpj5jr/BAKpN2gF2 a+2KpMZrD3c7j3KoHBSmwPQyf543kMLXFRbCyut1AOR6qiUY3kpQZv6gA96Plbfjp89h g89Q== X-Gm-Message-State: APjAAAVmOSP0Z5yVd8MJkBEgXDE6PkFsEEyMf5ZAgTXfB+eNLHhJid/X O8RoPi9jUfiAw0seyFpPdeb5Cg== X-Received: by 2002:a17:90a:9f0b:: with SMTP id n11mr12981206pjp.98.1565421726801; Sat, 10 Aug 2019 00:22:06 -0700 (PDT) Received: from localhost.localdomain (li456-16.members.linode.com. [50.116.10.16]) by smtp.gmail.com with ESMTPSA id l17sm24872660pgj.44.2019.08.10.00.22.00 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 10 Aug 2019 00:22:05 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , David Miller , Milian Wolff , Donald Yandt , Davidlohr Bueso , Wei Li , Adrian Hunter , Mark Drayton , "Tzvetomir Stoyanov (VMware)" , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, clang-built-linux@googlegroups.com, Mathieu Poirier Cc: Leo Yan Subject: [PATCH v4 0/2] perf: arm/arm64: Improve completeness for kernel address space Date: Sat, 10 Aug 2019 15:21:33 +0800 Message-Id: <20190810072135.27072-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch set is to improve completeness for kernel address space for arm/arm64; it adds architecture specific tweaking for the kernel start address, thus can include the memory regions which are prior to '_stext' symbol. With this change, we can see the eBPF program can be parsed properly on arm64. This patch set is a following up version for the old patch "perf cs-etm: Improve completeness for kernel address space" [1]; the old patch was only to fix the issue for CoreSight ETM event; but the kernel address space issue is not only limited to CoreSight event, it should be a common issue for other events (e.g. PMU events), clock events for profiling eBPF program. So this patch set tries to resolve it as a common issue for arm/arm64 archs. When implemented related code, I tried to use the API machine__create_extra_kernel_maps(); but I found the 'perf script' tool directly calls machine__get_kernel_start() instead of running into the flow for machine__create_extra_kernel_maps(); this is the reason I don't use machine__create_extra_kernel_maps() for tweaking kernel start address and refactor machine__get_kernel_start() alternatively. If there have better method to resolve this issue, any suggestions and comments are very welcome! [1] https://lkml.org/lkml/2019/6/19/1057 Leo Yan (2): perf machine: Support arch's specific kernel start address perf machine: arm/arm64: Improve completeness for kernel address space tools/perf/Makefile.config | 22 ++++++++++++++++++++++ tools/perf/arch/arm/util/Build | 2 ++ tools/perf/arch/arm/util/machine.c | 17 +++++++++++++++++ tools/perf/arch/arm64/util/Build | 1 + tools/perf/arch/arm64/util/machine.c | 17 +++++++++++++++++ tools/perf/arch/x86/util/machine.c | 10 ++++++++++ tools/perf/util/machine.c | 13 +++++++------ tools/perf/util/machine.h | 2 ++ 8 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 tools/perf/arch/arm/util/machine.c create mode 100644 tools/perf/arch/arm64/util/machine.c -- 2.17.1