Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp243940rwb; Thu, 11 Aug 2022 00:08:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR5JLagmN8tETE7RdAQfkBZ05c1AjkM12IRt4xQ2QRgWQzdWzfyRkPsZcDz7MgJeA62ecAGk X-Received: by 2002:a05:6402:4014:b0:43b:cd24:fff3 with SMTP id d20-20020a056402401400b0043bcd24fff3mr30166647eda.351.1660201711203; Thu, 11 Aug 2022 00:08:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660201711; cv=none; d=google.com; s=arc-20160816; b=hNRoORvcDQ0bRZVCv8mdlNSTGiGxB+Dm2ivGl//h1iEyg5YMvX/2JiIDqPlN8qKSM0 FAx+kMWO68zGmuGRdEYAOcljdFQMdmYap387B2CHTLw6e6NJ8aWZokHOHVqv5unf9Ra9 ItOisxRlXwyTmeSX3C/5v17CoaQDYIMba7e8iwg6qKQC2AMT6Z/SWxi+AFPTjbFJy1I9 CkbyHoirnXpSiDj5c1+1huSW76KC+H8nr/NsTwIZp5nBsrE0Tkk0wwt2nVfY9qFeycGH 1+SX7qCeLD2RrC6ILPjDFL5ssT1DTWiXgi3GX5HmEGTzWM5yo4Hhy0vrQKF5mYxLiphP FgIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2BjSb17Xo+YW8LG40iOqmFrwUMRlbFx/Kcx9RnLyLS4=; b=MJGQRI7WsH2ZgkK8x7wfS6Xu+cnQHO63tVooTYgzZ9LltpP7f2sxf2/bW4y28JHZnc Qx4ja1OqoEygzghn6BAc+8lUeiq3jF5vRlY4WrDWCgaqouLYc7Bj9kjIyzzVeOTIJHQo A6iUSlxnqaXrTcS3aoTnziam7VlVf3HnQ3bWqdOQirfovxRY60qB56w2XkhHoXzN6uNv EVvG5C6HHYn97YKzu3d7J+opVoemUfhYu87v2kBMMBNFG1/4CxTrsKdGZUh1aa7nvcJ8 IqY2fbzMTbkDsAZE5XMplsmPtMuHrlHgaNa4To3ixATbwEaj3W0A+Woo6pSBovAO7ZwL SfIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hcICa0z1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c6-20020a170906d18600b00730a1f55ac8si5388848ejz.821.2022.08.11.00.08.05; Thu, 11 Aug 2022 00:08:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hcICa0z1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229437AbiHKG0y (ORCPT + 99 others); Thu, 11 Aug 2022 02:26:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234141AbiHKG0X (ORCPT ); Thu, 11 Aug 2022 02:26:23 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B33D6E2FB for ; Wed, 10 Aug 2022 23:26:11 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id y141so15695016pfb.7 for ; Wed, 10 Aug 2022 23:26:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=2BjSb17Xo+YW8LG40iOqmFrwUMRlbFx/Kcx9RnLyLS4=; b=hcICa0z1OMm5qm9hJR0Y9mqXD+y7Ore41LW0ePfj1QxfQ2Kl1GnDsa7IVBC4hVHZSD SbQPVjbAUI+V097ZrQ3Hn+q5741GszYzDEBo+NS6sh50ISdCE7uBLm22ba6/xztQUKY1 X3LTbey8f9wOPtfxh5aee4pWt6EW9va46uiJDEvUoIBgJX2HSGTBB9mt1pixXRfw3fmA +ohbYjcXVg/Oi/l3H3Nwv2eqa5FeSg3aeKiX5qun0BCfhZQXaIlyFJeHQSjqsV3fba8z ymYAuU6m3o1DdenuaeU3wTFxQ1goyLuXnZyQBLs24Skupd1LGTiyzCc9Ni6nuHnzzT+s iAxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=2BjSb17Xo+YW8LG40iOqmFrwUMRlbFx/Kcx9RnLyLS4=; b=HK6pKILM9tF6lbQd8ILeJ6uig+UtWRVi1iCYkoQAfj/djM4yRd564vURt1RSjAKh0l uVauKKL7s4c2q0fPXiAOc6XZAAbG11kQFoOYq9ZN4CeS31Suy1CTlfzAx6mfICLVKw1C F0i2yqpcs67pAJHTNPlqWGx7zXstoYJ5irmZUWJD+9plKNSKPA2FtsF1tZYO8YK+O/fZ bPep0UeCWyjMItheAAxIjjxipLUn12FBRI942Mdm7Asi1DSIUtSF6OK+qopiRTIKDkzc vTAw1Brcyoc8XTRie6yjYznjiwF8AP8FWiJ13Y16eMB5VDnNBOndP+Yqipjn/Xbda8Qd lGBQ== X-Gm-Message-State: ACgBeo0u7APpsdPmu2g5GEHSd9Z1zQ9Sirv4WzJS8N3ab+kde+dpOmWQ INItPtcDtgsdY7+NuAJDxofMzQ== X-Received: by 2002:a05:6a00:1908:b0:525:5dad:cb1c with SMTP id y8-20020a056a00190800b005255dadcb1cmr30415553pfi.47.1660199170702; Wed, 10 Aug 2022 23:26:10 -0700 (PDT) Received: from leoy-yangtze.lan (n058152077182.netvigator.com. [58.152.77.182]) by smtp.gmail.com with ESMTPSA id o12-20020a17090a55cc00b001f506009036sm2766926pjm.49.2022.08.10.23.26.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Aug 2022 23:26:10 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , John Garry , Will Deacon , James Clark , Mike Leach , Kajol Jain , Ali Saidi , Adrian Hunter , "Gustavo A. R. Silva" , Anshuman Khandual , Ian Rogers , Like Xu , German Gomez , Timothy Hayes , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v6 12/15] perf c2c: Refactor display string Date: Thu, 11 Aug 2022 14:24:48 +0800 Message-Id: <20220811062451.435810-13-leo.yan@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220811062451.435810-1-leo.yan@linaro.org> References: <20220811062451.435810-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The display type is shown by combination the display string array and a suffix string "HITMs", which is not friendly to extend display for other sorting type (e.g. extension for peer operations). This patch moves the suffix string "HITMs" into display string array for HITM types, so it can allow us to not necessarily to output string "HITMs" for new incoming display type. Signed-off-by: Leo Yan Acked-by: Ian Rogers Tested-by: Ali Saidi Reviewed-by: Ali Saidi --- tools/perf/builtin-c2c.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 49a9b8480b41..8b7c1fd35380 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -122,9 +122,9 @@ enum { }; static const char *display_str[DISPLAY_MAX] = { - [DISPLAY_LCL_HITM] = "Local", - [DISPLAY_RMT_HITM] = "Remote", - [DISPLAY_TOT_HITM] = "Total", + [DISPLAY_LCL_HITM] = "Local HITMs", + [DISPLAY_RMT_HITM] = "Remote HITMs", + [DISPLAY_TOT_HITM] = "Total HITMs", }; static const struct option c2c_options[] = { @@ -2489,7 +2489,7 @@ static void print_c2c_info(FILE *out, struct perf_session *session) fprintf(out, "%-36s: %s\n", first ? " Events" : "", evsel__name(evsel)); first = false; } - fprintf(out, " Cachelines sort on : %s HITMs\n", + fprintf(out, " Cachelines sort on : %s\n", display_str[c2c.display]); fprintf(out, " Cacheline data grouping : %s\n", c2c.cl_sort); } @@ -2646,7 +2646,7 @@ static int perf_c2c_browser__title(struct hist_browser *browser, { scnprintf(bf, size, "Shared Data Cache Line Table " - "(%lu entries, sorted on %s HITMs)", + "(%lu entries, sorted on %s)", browser->nr_non_filtered_entries, display_str[c2c.display]); return 0; -- 2.34.1