From mboxrd@z Thu Jan 1 00:00:00 1970 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 5E9B1C2D0A3 for ; Fri, 6 Nov 2020 09:51:53 +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 D30E92087E for ; Fri, 6 Nov 2020 09:51:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BDdg4Epz"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="IA8RY+JP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D30E92087E 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:References:In-Reply-To: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:List-Owner; bh=OmKnVyWn7OuRUhsQFSx81tnDEeSuexIe76HUtkCtkHY=; b=BDdg4EpzpliZ+EaFDTkjujDgaD +y5HWOn5Lc9YResFbdvsBpFQxgRiTPighPePFOYtEvByHf7aQzN0O0otS/0JfYrdGIHvfLpPJVPxO AybAa5bcgPcSoOfOwP3SonQVnBDOgvi9CT8W9xep9ZnHGzQNLYd2GKZ9aH1mBZQlj3/8B2a+YQGgY NUNNBg8MlhAmCQlbOioz7AB6TcrPkGknz9kYnLXh/IxTh9bz4ujZmp15Y0d+frrAk6MvDo5J8BD0z f9ru4BVc+YblxWqOyBIAcy0CaNue4GHjKVodNhiR/3i4nadUBSvQg8Amfaep9cQxN37B2vElUbiDF dNrLYv1A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kayOr-0008A2-1J; Fri, 06 Nov 2020 09:51:17 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kayNJ-0007LY-LB for linux-arm-kernel@lists.infradead.org; Fri, 06 Nov 2020 09:49:43 +0000 Received: by mail-pf1-x441.google.com with SMTP id 13so836655pfy.4 for ; Fri, 06 Nov 2020 01:49:40 -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:in-reply-to:references; bh=Kd4epe4q0Au0t9vfVIipb8EifZAH94kZvxB3D28L/e8=; b=IA8RY+JPOGoW2yuLsWEIhueODFoxSxyOzTq9LQH/8/YF0V4KiboxL4+o1XiHUMlWQL MdsKIgL3QY6/AAQrFCuegnEARsCr1COpUpkPeOwzaolWucs83oSrR/6dmHjPjC4QmtKz kPen52Ku0Uqedu9rpODqa7/UlpbYX7oS6IwUwJYsbmY+pZu8/E3pnJmxykQAyeMXHxGO k4/aYVAAlxCaaHQ2f2Hn3rSOgYII7TAjnRbQvgn6CmK1L8PCwR20Lv51tgPaL0gJg8gk D9uV8u7Ny0qzSCmFRmb1rorcu+f2C83wLv3+wEZnGbqdwNEFJ29tO7NsLCIb7ZS9+ymO OktA== 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:in-reply-to :references; bh=Kd4epe4q0Au0t9vfVIipb8EifZAH94kZvxB3D28L/e8=; b=Lmr9KpFO85hQ+tEKuua/xG6ekgzmdKN9LHYpkdX2kRAzepApywWXnBRe2fHeYv123o W7yQn/bGmK/MCeLQLFNaJNYN4VGvIfPJyf+KFNAkYv4+t1cqW0xkDkyvtGsqm5gNyRgp Z93sQetPbyhfR/kfSI74HwuAb1UEZhN4WP7EE+oF5lI+t7ggRGt3b71NtrG6frp4Ia9W 5B5inmnVpw3GsZIvRa5ng3FbKU+C6AgV1xRFnsWPbC6IJ6zgcdEzAYajaNLp3fEWLqZs Eh+scbkj13z1lZKlNAo9W/FyzXMD0fMpyQJST48GBPB2oDhkwYjrdsa3VrRq7f+NvSWC ZSHw== X-Gm-Message-State: AOAM530JpDPkqNLL+4/FkaUJumFrnym2vamP5kLELW8EKhESHYorvIuz 7pHWSAGqwfFJpyu/M3S3eTvw7A== X-Google-Smtp-Source: ABdhPJwP1o28b2yhGIdrMiAJxF7cQb74HsJiaXjCy267FNG09WBjctcaYpdX7FisbQjV5u3qtzkdaA== X-Received: by 2002:a63:f84c:: with SMTP id v12mr1074588pgj.125.1604656178999; Fri, 06 Nov 2020 01:49:38 -0800 (PST) Received: from localhost ([2400:8904::f03c:91ff:fe8a:adf7]) by smtp.gmail.com with ESMTPSA id b6sm1071115pgq.58.2020.11.06.01.49.38 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Nov 2020 01:49:38 -0800 (PST) From: Leo Yan To: Arnaldo Carvalho de Melo , Jiri Olsa , Ian Rogers , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Namhyung Kim , John Garry , Will Deacon , Mathieu Poirier , Adrian Hunter , Andi Kleen , Kemeng Shi , Sergey Senozhatsky , Al Grant , James Clark , Wei Li , Andre Przywara , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 4/9] perf c2c: Support memory event PERF_MEM_EVENTS__LOAD_STORE Date: Fri, 6 Nov 2020 17:48:48 +0800 Message-Id: <20201106094853.21082-5-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201106094853.21082-1-leo.yan@linaro.org> References: <20201106094853.21082-1-leo.yan@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201106_044941_883510_20466521 X-CRM114-Status: GOOD ( 16.52 ) 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When user doesn't specify event name, perf c2c tool enables both the load and store events, and this leads to failure for opening the duplicate PMU device for AUX trace. After the memory event PERF_MEM_EVENTS__LOAD_STORE is introduced, when the user doesn't specify event name, this patch converts the required operation to PERF_MEM_EVENTS__LOAD_STORE if the arch supports it. Otherwise, the tool still rolls back to enable events PERF_MEM_EVENTS__LOAD and PERF_MEM_EVENTS__STORE. Signed-off-by: Leo Yan --- tools/perf/builtin-c2c.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 4d1a08e38233..98ae33eac6cc 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -2895,11 +2895,20 @@ static int perf_c2c__record(int argc, const char **argv) rec_argv[i++] = "record"; if (!event_set) { - e = perf_mem_events__ptr(PERF_MEM_EVENTS__LOAD); - e->record = true; + e = perf_mem_events__ptr(PERF_MEM_EVENTS__LOAD_STORE); + /* + * The load and store operations are required, use the event + * PERF_MEM_EVENTS__LOAD_STORE if it is supported. + */ + if (e->tag) { + e->record = true; + } else { + e = perf_mem_events__ptr(PERF_MEM_EVENTS__LOAD); + e->record = true; - e = perf_mem_events__ptr(PERF_MEM_EVENTS__STORE); - e->record = true; + e = perf_mem_events__ptr(PERF_MEM_EVENTS__STORE); + e->record = true; + } } e = perf_mem_events__ptr(PERF_MEM_EVENTS__LOAD); -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel