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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4763C43334 for ; Sat, 4 Jun 2022 04:31:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350538AbiFDEa5 (ORCPT ); Sat, 4 Jun 2022 00:30:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350485AbiFDEa3 (ORCPT ); Sat, 4 Jun 2022 00:30:29 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E75037A15 for ; Fri, 3 Jun 2022 21:30:14 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id u2so8572910pfc.2 for ; Fri, 03 Jun 2022 21:30:14 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=mEFlFeeA00qEqb9LWsCR/H03DROXEysxyYTT9NYmxGw=; b=gY/grWkYeRkDT8C7n0psacv/dDTzjFOJfyxwCH+JA0W66HH0s18LuFSdfhcBxnaIDL YRKqNgMyP0teOFDDDn/HurG/sj8qwIU/JHhMXzjNWpf63PkIB01mHrdQssa0vDKCa/kf dswqLn1WZ4M5h1aD+zwbFMW8goTiJNAYxG2iTFf/fFYbPDVMxW0K+AXgECr2XCCQYNIq abO4TagNT9t0xExs2VQZo872jcaSGqQK5OGyAgsXTblX7zeKp2UXdgxWN0FhP5e8zucH f81SlHbf2tKSN4wUKhuMM5CSHGJEVpx+lj7mNcWHSw8ZyVxWov0jRmaPeOiV+T9aAd3n mfPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mEFlFeeA00qEqb9LWsCR/H03DROXEysxyYTT9NYmxGw=; b=heKbdczM9RZiRoPy3KtOVJErLULFdc0+rO4SCqOVnhU+Pjzm38G8Rt0GhqaO1WhZyY stLzorYp78MUCMrq0EQKR5UAVILmphurujbS7jyrl+tKORsxam2er1DRhywajwTKM3xo j7GVekfX31mIvDVg9SDkMBpmAyBDk9QKRV9CoVBlmlzQL9mFUZZXmEPaxAU7kyYJs0Qy mohPm1N3zdKeV/mUu1plzbG8ZURzQecSVmST4k8LND90CCEJJzvDxa3IYtbUyyqf5RL+ TH8dPIXbNJjMlfg23hnJhzBkoLi/wXnvLTMsgdcqV+Mj+bIY/AryFgn9eeOa4F/RRNPM IcYQ== X-Gm-Message-State: AOAM533AKdjioCi/4XfsHjLV2LJJQMParV6qSeazzQkt63MEAAD74EcQ c3aqBehkOsXgmSUKwn49+hpzlw== X-Google-Smtp-Source: ABdhPJzvXOFNWK7bNyRRG915P4OXjXVgN5kgUlqrCQoa2iaMsq9GaRWPoGqvI7pt2VJRFCoJge9o1A== X-Received: by 2002:a05:6a00:2187:b0:50c:ef4d:ef3b with SMTP id h7-20020a056a00218700b0050cef4def3bmr13019979pfi.83.1654317013439; Fri, 03 Jun 2022 21:30:13 -0700 (PDT) Received: from leo-build-box.lan (ec2-54-67-95-58.us-west-1.compute.amazonaws.com. [54.67.95.58]) by smtp.gmail.com with ESMTPSA id w24-20020a1709027b9800b00163d4c3ffabsm6152916pll.304.2022.06.03.21.30.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 21:30:13 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , Namhyung Kim , Ian Rogers , John Garry , Will Deacon , James Clark , German Gomez , Ali Saidi , Joe Mario , Adam Li , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v5 16/17] perf c2c: Use 'peer' as default display for Arm64 Date: Sat, 4 Jun 2022 12:28:19 +0800 Message-Id: <20220604042820.2270916-17-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220604042820.2270916-1-leo.yan@linaro.org> References: <20220604042820.2270916-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since Arm64 arch doesn't support HITMs flags, this patch changes to use 'peer' as default display if user doesn't specify any type; for other arches, it still uses 'tot' as default display type if user doesn't specify it. This patch changes to call perf_session__new() in an earlier place, so session environment can be initialized ahead and arch info can be used for setting display type. Suggested-by: Ali Saidi Signed-off-by: Leo Yan Acked-by: Ian Rogers Tested-by: Ali Saidi Reviewed-by: Ali Saidi --- tools/perf/builtin-c2c.c | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index f7a961e55a92..653e13b5037e 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -2878,7 +2878,7 @@ static int setup_callchain(struct evlist *evlist) static int setup_display(const char *str) { - const char *display = str ?: "tot"; + const char *display = str; if (!strcmp(display, "tot")) c2c.display = DISPLAY_TOT_HITM; @@ -3068,27 +3068,39 @@ static int perf_c2c__report(int argc, const char **argv) data.path = input_name; data.force = symbol_conf.force; + session = perf_session__new(&data, &c2c.tool); + if (IS_ERR(session)) { + err = PTR_ERR(session); + pr_debug("Error creating perf session\n"); + goto out; + } + + /* + * Use the 'tot' as default display type if user doesn't specify it; + * since Arm64 platform doesn't support HITMs flag, use 'peer' as the + * default display type. + */ + if (!display) { + if (!strcmp(perf_env__arch(&session->header.env), "arm64")) + display = "peer"; + else + display = "tot"; + } + err = setup_display(display); if (err) - goto out; + goto out_session; err = setup_coalesce(coalesce, no_source); if (err) { pr_debug("Failed to initialize hists\n"); - goto out; + goto out_session; } err = c2c_hists__init(&c2c.hists, "dcacheline", 2); if (err) { pr_debug("Failed to initialize hists\n"); - goto out; - } - - session = perf_session__new(&data, &c2c.tool); - if (IS_ERR(session)) { - err = PTR_ERR(session); - pr_debug("Error creating perf session\n"); - goto out; + goto out_session; } session->itrace_synth_opts = &itrace_synth_opts; @@ -3096,7 +3108,7 @@ static int perf_c2c__report(int argc, const char **argv) err = setup_nodes(session); if (err) { pr_err("Failed setup nodes\n"); - goto out; + goto out_session; } err = mem2node__init(&c2c.mem2node, &session->header.env); -- 2.25.1 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0065CC433EF for ; Sat, 4 Jun 2022 04:35:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aBlT57t33aXE9EXskYkVO6LTFRXtxy4c6BHMEEyGxRs=; b=cjb8/HPmqOBtmy wOrl4z/B1hDNF0e9q0WSkIxii6jV7jll7zFnjjm50N3FjJZv98Lf3PJK2BWepvci8hcjTLoAZ6C3F cX93G9qJMCIIGhsF9wQneEBeJcT1Hi+ZYawkD9ML02SnXOW6Lbeic81MHLg6rGqV5P26LW6L9LQWY 2RDv42FNjImOOMKgZObo2iUVfphUqBt7G4sDhLplQmPoXvVEYw+oyI4iz2lMchWCZttIWypBb2FHj ZXCNbMgps0c8lWiOm9uuzRRiW7bvoUBsRFbK0j4LsMT/fYocdtm/g9ZBQKT6lXS0t+WmIt/3WrOu3 lYlvtYvJiYwwY0kvsdXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nxLUf-00AGXC-02; Sat, 04 Jun 2022 04:34:33 +0000 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nxLQU-00AEQg-OL for linux-arm-kernel@lists.infradead.org; Sat, 04 Jun 2022 04:30:16 +0000 Received: by mail-pg1-x52e.google.com with SMTP id d129so8661240pgc.9 for ; Fri, 03 Jun 2022 21:30:14 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=mEFlFeeA00qEqb9LWsCR/H03DROXEysxyYTT9NYmxGw=; b=gY/grWkYeRkDT8C7n0psacv/dDTzjFOJfyxwCH+JA0W66HH0s18LuFSdfhcBxnaIDL YRKqNgMyP0teOFDDDn/HurG/sj8qwIU/JHhMXzjNWpf63PkIB01mHrdQssa0vDKCa/kf dswqLn1WZ4M5h1aD+zwbFMW8goTiJNAYxG2iTFf/fFYbPDVMxW0K+AXgECr2XCCQYNIq abO4TagNT9t0xExs2VQZo872jcaSGqQK5OGyAgsXTblX7zeKp2UXdgxWN0FhP5e8zucH f81SlHbf2tKSN4wUKhuMM5CSHGJEVpx+lj7mNcWHSw8ZyVxWov0jRmaPeOiV+T9aAd3n mfPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mEFlFeeA00qEqb9LWsCR/H03DROXEysxyYTT9NYmxGw=; b=nyWqWKZjpEhiMLeRy9w2TDQvtcMovEoItVRkL8oV+ABK42HonQsPee7IHHHG9wA2H1 tH1bmx8TVLdpemQ1M2qFpp5nq6KykbHE0YLavnZ/amg62Oat7xG9Du4kQ9VwpMkJmIZv IPsUitjD/1DBTskEG3hFxe9RVVU2Zxq3tCDQ0mIyPk25mZmtK5xiohITySsT5WEJTGhs bvVidC3De3LBGUm0mZ6X1BQCy7banJJkAY1bCKU0YdDHF7s4Y7A71ZNQfrlEPNndkJ59 hBY8EtMqfuvEhRllq5F5+GYpVFx4Ix/yt+GlgIxIwAp8vbjFQCrrU98GVp2swHB8mZ4F wpcQ== X-Gm-Message-State: AOAM53230syApmwBHIEb7MA59sdhpCwkg2EkhCgL1BLvKGsBdZ38SVt6 DdkxPZZCZvtHxw/7RQQklAemBA== X-Google-Smtp-Source: ABdhPJzvXOFNWK7bNyRRG915P4OXjXVgN5kgUlqrCQoa2iaMsq9GaRWPoGqvI7pt2VJRFCoJge9o1A== X-Received: by 2002:a05:6a00:2187:b0:50c:ef4d:ef3b with SMTP id h7-20020a056a00218700b0050cef4def3bmr13019979pfi.83.1654317013439; Fri, 03 Jun 2022 21:30:13 -0700 (PDT) Received: from leo-build-box.lan (ec2-54-67-95-58.us-west-1.compute.amazonaws.com. [54.67.95.58]) by smtp.gmail.com with ESMTPSA id w24-20020a1709027b9800b00163d4c3ffabsm6152916pll.304.2022.06.03.21.30.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 21:30:13 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , Namhyung Kim , Ian Rogers , John Garry , Will Deacon , James Clark , German Gomez , Ali Saidi , Joe Mario , Adam Li , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v5 16/17] perf c2c: Use 'peer' as default display for Arm64 Date: Sat, 4 Jun 2022 12:28:19 +0800 Message-Id: <20220604042820.2270916-17-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220604042820.2270916-1-leo.yan@linaro.org> References: <20220604042820.2270916-1-leo.yan@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220603_213014_853433_614802CA X-CRM114-Status: GOOD ( 16.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Since Arm64 arch doesn't support HITMs flags, this patch changes to use 'peer' as default display if user doesn't specify any type; for other arches, it still uses 'tot' as default display type if user doesn't specify it. This patch changes to call perf_session__new() in an earlier place, so session environment can be initialized ahead and arch info can be used for setting display type. Suggested-by: Ali Saidi Signed-off-by: Leo Yan Acked-by: Ian Rogers Tested-by: Ali Saidi Reviewed-by: Ali Saidi --- tools/perf/builtin-c2c.c | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index f7a961e55a92..653e13b5037e 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -2878,7 +2878,7 @@ static int setup_callchain(struct evlist *evlist) static int setup_display(const char *str) { - const char *display = str ?: "tot"; + const char *display = str; if (!strcmp(display, "tot")) c2c.display = DISPLAY_TOT_HITM; @@ -3068,27 +3068,39 @@ static int perf_c2c__report(int argc, const char **argv) data.path = input_name; data.force = symbol_conf.force; + session = perf_session__new(&data, &c2c.tool); + if (IS_ERR(session)) { + err = PTR_ERR(session); + pr_debug("Error creating perf session\n"); + goto out; + } + + /* + * Use the 'tot' as default display type if user doesn't specify it; + * since Arm64 platform doesn't support HITMs flag, use 'peer' as the + * default display type. + */ + if (!display) { + if (!strcmp(perf_env__arch(&session->header.env), "arm64")) + display = "peer"; + else + display = "tot"; + } + err = setup_display(display); if (err) - goto out; + goto out_session; err = setup_coalesce(coalesce, no_source); if (err) { pr_debug("Failed to initialize hists\n"); - goto out; + goto out_session; } err = c2c_hists__init(&c2c.hists, "dcacheline", 2); if (err) { pr_debug("Failed to initialize hists\n"); - goto out; - } - - session = perf_session__new(&data, &c2c.tool); - if (IS_ERR(session)) { - err = PTR_ERR(session); - pr_debug("Error creating perf session\n"); - goto out; + goto out_session; } session->itrace_synth_opts = &itrace_synth_opts; @@ -3096,7 +3108,7 @@ static int perf_c2c__report(int argc, const char **argv) err = setup_nodes(session); if (err) { pr_err("Failed setup nodes\n"); - goto out; + goto out_session; } err = mem2node__init(&c2c.mem2node, &session->header.env); -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel