From patchwork Fri Dec 25 05:27:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 11989815 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 314CDC433E0 for ; Fri, 25 Dec 2020 05:29:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E1EFE22AAA for ; Fri, 25 Dec 2020 05:29:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E1EFE22AAA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=HDpr/2zH79dfJuHJEduQdsyRuZZXj7NRvvK2ZgJOyqE=; b=D1ObUCQk1UsClmrDFXnJi0EXFu LzPtI+Ni2IEMLwVmfa/7j8UGjK0Nl54MfE7EldbpUCpZusBphJSQ40KqhUPT1co1aU0jNwhsz4L0X 5Yy1m1C2e/fVyRXcZA9O31SBMdnFBrdjf8Wg6VcsWpshueAm0IHbe/l/n71X2VvopdETeyZ6WrBmR kLL/JmMm5m8YjjLd1yWxZfXTU8f4HlnF199XYy5PkVB+wTBrDfZrUjpg4H6h2KvdL0jGhZ9MmBG5o m7YWFHYF1jhKxxHTI/b6CQ7pEPFE5BgZL7G3DeirXkZJ+Q7UznSp9aFV7UezA+yjb/XNI1Kf2JCA8 mb4xsfxg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ksfe5-0004zx-Lx; Fri, 25 Dec 2020 05:28:09 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ksfe2-0004xf-C6 for linux-arm-kernel@lists.infradead.org; Fri, 25 Dec 2020 05:28:08 +0000 Received: by mail-pf1-x42d.google.com with SMTP id c12so2136751pfo.10 for ; Thu, 24 Dec 2020 21:28:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=OXt7vHDOprZwsYDOZ3gdmuS5KXkGBSPvwkcE4hpi9oI=; b=w+h8vk7o69RyY5/ruUBWB/+K/rdoC3jVuVD2QxzrcOPsv5Z72Gl/tNv7msxsPwdbgA ETxOxaZNL26DjR9onNdkncoDNaGZtf7XeyOWvwQTxnZEaJhVtJL/ZUQRam61iVJ19oYq wjy+1dGxAr2HJEG9fp09eI28Nib/poEJnY7SCgnYv04a2uTQx5Ww4wg8Dz+dvEkgbI5U NJhwisIZlzDgo4ZOJkR3ducC/gsY1T6ZP0hLmYOGVxSxJMsiuT/mtSNNirkYJzcq1ycs 33xbCMr9XfwO+iE1WhY0Wfpth/7WM6II9fOjAmni1o9S71nvW79y7jDfsJTekQ7N4UZQ FkXQ== 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=OXt7vHDOprZwsYDOZ3gdmuS5KXkGBSPvwkcE4hpi9oI=; b=gb0ME3jZpYnMSwLlfU1j3wdzbg9MYYbgkW53RIBkyilr/VN6qc2SKNqyjdSQMFLSbJ QbqzX8WLphX/+myErED7+rZ6f0nwSgo7VBtrxrDuFXAF/onfa8l0rHk554Y4uril9JOD Sm6K40BRwo6LFpMazNcwLxf777sYcLoUAHVsVT7q3CFiRh0GldpGh+k3JJwFq6PobsbP LIziMvbgncrt5pBH95gbFa29+WUIDAOGJ7zCL5H1aG00zrtYF+8uU5eF7DkFWz5X1H6o UPJ/Fm1/P5gApVKfLNnPcADPegD001qxHW0RPCPa4Ys8fd4PFm3LpQToGesEKxNUT72W ScIw== X-Gm-Message-State: AOAM532SQ7R4ct5cHaHcD7ugKg0Nc3H+S7yLVGkUF5n2kLBWxuPBoLjf 3K4rR6+u5lngzUpwvKD+TCBnug== X-Google-Smtp-Source: ABdhPJwhWfbB5E05OuHKLsUgJ20zZPuw5Ncs32FaevwqX75oEl/Xzcg8ElKubPaY8sfXO+St6Q2Beg== X-Received: by 2002:a62:1896:0:b029:197:491c:be38 with SMTP id 144-20020a6218960000b0290197491cbe38mr30346836pfy.15.1608874083438; Thu, 24 Dec 2020 21:28:03 -0800 (PST) Received: from localhost ([45.137.216.7]) by smtp.gmail.com with ESMTPSA id h16sm30305603pgd.62.2020.12.24.21.28.02 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Dec 2020 21:28:02 -0800 (PST) From: Leo Yan To: Arnaldo Carvalho de Melo , John Garry , Will Deacon , Mathieu Poirier , Masami Hiramatsu , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alexandre Truong , Ian Rogers , Thomas Richter , He Zhe , Sumanth Korikkar , Alexis Berlemont , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/3] perf arm64: Support SDT Date: Fri, 25 Dec 2020 13:27:48 +0800 Message-Id: <20201225052751.24513-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201225_002806_744580_90033FD6 X-CRM114-Status: GOOD ( 13.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Yan MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch is to enable SDT on Arm64. Since Arm64 SDT marker in ELF file is different from other archs, especially for using stack pointer (sp) to retrieve data for local variables, patch 01 is used to fixup the arguments for this special case. Patch 02 is to add argument support for Arm64 SDT. This patch set has been verified on Arm64/x86_64 platforms with a testing program usdt_test. The testing approach is described in the patch set v1 [1]. Changes from v1: * Added Arnaldo's patch for fixing memory leak (Arnaldo); * Refined patch "perf probe: Fixup Arm64 SDT arguments" to use asprintf() and check pointer is valid or not (Arnaldo); * Minor changes in patch "perf arm64: Add argument support for SDT" for the regular expression; * Added Masami's Ack tag for patch 03. [1] https://lore.kernel.org/patchwork/cover/1356212/ Arnaldo Carvalho de Melo (1): perf probe: Fix memory leak in synthesize_sdt_probe_command() Leo Yan (2): perf probe: Fixup Arm64 SDT arguments perf arm64: Add argument support for SDT tools/perf/arch/arm64/util/perf_regs.c | 94 ++++++++++++++++++++++++++ tools/perf/util/probe-file.c | 49 ++++++++++++-- 2 files changed, 139 insertions(+), 4 deletions(-)