From patchwork Fri Nov 6 09:48:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 11886645 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 8704DC2D0A3 for ; Fri, 6 Nov 2020 09:50:48 +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 D72F72087E for ; Fri, 6 Nov 2020 09:50:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BeINkS2B"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="uYmfu/e5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D72F72087E 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=cfPV4iAccPOZjtBZoYKaq7lHUzllE1N1LLClo4zS9yE=; b=BeINkS2BnCKCbVWBe79LusApgU DtHjZYU8BVwJc1XX5K7SjXP/0+IVr7rVaqq15Tut58VPJftSShKVhB1iaxw7/8EENli4bXh3z8qWC g0dNQ2Dl94BYNEvbKdt1Hu2b8Nm7zWEFwON1XnghcnEqVcxL8YXYd1M25l6EBs99bz4XTc/nANYz1 adIh2IVs9H6NM7JXmJk2JmsPSkVkEaEt2UqYpx9oowrrwd2yYKPtRfsB5sd82XDqNGngs8ko0/xZa WddW31Iinw5sHCRzj+s/PzIH0AVRG28R6Rdk1VV054Y69lZsH7YHwqkMvIeeug89gyF1RVtX6F3SA CU7jnGrQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kayNg-0007T3-Mo; Fri, 06 Nov 2020 09:50:04 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kayN2-0007AS-LZ for linux-arm-kernel@lists.infradead.org; Fri, 06 Nov 2020 09:49:29 +0000 Received: by mail-pg1-x544.google.com with SMTP id i7so534109pgh.6 for ; Fri, 06 Nov 2020 01:49:23 -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=xBMDYR0EtJiH6gOkUzFJE+KFN5Qsrk4p6krIBtwIhQY=; b=uYmfu/e5OP600zOgAkXEJsmbIuOXJQvvjz2cTOe0se5Vwouzn28DlQkhR7vuntjUjC hFVCBL1FMFGM/08a+tsNzHDNHEhGC9wooNkgNjVQ5Vyb2cRh7LQgugCENzsXNFsICrEq or0EWO4gZPRnPtlmTac6unIGBtSXhUZcaFSgvNfosY/OWIZVCD+Cgx/cPfq6+4ZKbcN9 ycxcUrpCcdRPUvyiKicpSSDBL8RILyzm4qtYZf+y1n7S7ChNAadx3pVLwl1hNA84Iq6e EJcnz0nQqhAwCkLjtwt54iv9FFxJYlzG0HP8fFm8b/ELOagL8jjrEN+p9gSzAGRxXnzN 7xTg== 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=xBMDYR0EtJiH6gOkUzFJE+KFN5Qsrk4p6krIBtwIhQY=; b=NpZFb75qoCs9fXuTEDHBKCAKcqGz2JZqZ0Q21Q1o193rU28disy3VWuXorhHT0MlLV K7XEHUYrh1WeRR7adrCtb+fw14IJuxXZWL99iFKzNU+6ADH2+7TFRL1cub3T8vsCAVvh sa2sDzQIqZwKmIQx7h9VAd9E+bRIHoxOSz6lgO59pNM/0rspm/wCf80N+t03g8JZPn0n i3yda5TDBj86zypa2P6FIFFWG4z4XzrcU2oi3wr0LAgrfuvaBPOflRnsK08fhC2r63+v KSrZIJRhFLX0UIiADc8DQynoAzNmY0Z4rrckqQ0t8lQYNbGRK/Een6GtemunKydcW8zi sDag== X-Gm-Message-State: AOAM530NEPLfWy726kv5fkkIbdYXqf5wVKkbP4dt2af+l+hwkve9Ulbp 9MlwGQ5SivlmPK5ttAu3c2WKBA== X-Google-Smtp-Source: ABdhPJz8jwfvIQYlaktjREIjkgDKkkAoPkmix0536oVpNSs9OrxIrnI8DtCp0bo3i3wRJPNE02fBog== X-Received: by 2002:a63:1924:: with SMTP id z36mr1074217pgl.354.1604656161022; Fri, 06 Nov 2020 01:49:21 -0800 (PST) Received: from localhost ([2400:8904::f03c:91ff:fe8a:adf7]) by smtp.gmail.com with ESMTPSA id v12sm1109618pgr.4.2020.11.06.01.49.20 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Nov 2020 01:49:20 -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 1/9] perf mem: Search event name with more flexible path Date: Fri, 6 Nov 2020 17:48:45 +0800 Message-Id: <20201106094853.21082-2-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_044925_002078_B9655AF2 X-CRM114-Status: GOOD ( 16.51 ) 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 Perf tool searches memory event name under the folder '/sys/devices/cpu/events/', this leads to the limitation for selection memory profiling event which must be under this folder. Thus it's impossible to use any other event as memory event which is not under this specific folder, e.g. Arm SPE hardware event is not located in '/sys/devices/cpu/events/' so it cannot be enabled for memory profiling. This patch changes to search folder from '/sys/devices/cpu/events/' to '/sys/devices', so it give flexibility to find events which can be used for memory profiling. Signed-off-by: Leo Yan Acked-by: Jiri Olsa --- tools/perf/util/mem-events.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c index ea0af0bc4314..35c8d175a9d2 100644 --- a/tools/perf/util/mem-events.c +++ b/tools/perf/util/mem-events.c @@ -18,8 +18,8 @@ unsigned int perf_mem_events__loads_ldlat = 30; #define E(t, n, s) { .tag = t, .name = n, .sysfs_name = s } struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX] = { - E("ldlat-loads", "cpu/mem-loads,ldlat=%u/P", "mem-loads"), - E("ldlat-stores", "cpu/mem-stores/P", "mem-stores"), + E("ldlat-loads", "cpu/mem-loads,ldlat=%u/P", "cpu/events/mem-loads"), + E("ldlat-stores", "cpu/mem-stores/P", "cpu/events/mem-stores"), }; #undef E @@ -93,7 +93,7 @@ int perf_mem_events__init(void) struct perf_mem_event *e = &perf_mem_events[j]; struct stat st; - scnprintf(path, PATH_MAX, "%s/devices/cpu/events/%s", + scnprintf(path, PATH_MAX, "%s/devices/%s", mnt, e->sysfs_name); if (!stat(path, &st))