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 5ED68C4332F for ; Mon, 30 May 2022 11:42:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235992AbiE3LmA (ORCPT ); Mon, 30 May 2022 07:42:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236006AbiE3Lly (ORCPT ); Mon, 30 May 2022 07:41:54 -0400 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B13FD10C8 for ; Mon, 30 May 2022 04:41:43 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id r71so9992565pgr.0 for ; Mon, 30 May 2022 04:41:43 -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=THH8wa7TnqV/qE1Ao1QWNDBQ+CCTll+o2go/NvMpMcM=; b=IOuudsk7MsQjj6yf2WuomJioY7leWfVDpGdP+k9EDowGz+IOYCT98fRZbCOo0fSZa6 OwXav1eeZO/2xqMD2B4kHGqx+hXeqXMS80as+AYnzGl1uSXDLIp9Uuw7F+qG/Oazzlye tRoiubYQ3jullshw8qbKH/L2jwjT/IBTKJfl/smvhRNkMM4QxAt0qNez/vFF68bWGRJo 3ou/gYV+BSDT9NG10i598gv8yOCLvk8Ajsnye/+7Ns2WEnf/EctMFUjDMazcEklgvoAe wMdm6oc1CksDdOE4KCOuvJqWNTs7Tzp9M5sn9xG9pLdRzLWd1mq7xV7l72sxrLxdg+Xw PM3w== 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=THH8wa7TnqV/qE1Ao1QWNDBQ+CCTll+o2go/NvMpMcM=; b=0O91e9zouFoai5qwFSNBqnwQQD5bqVYaLznykyd/s1X3TTOw5nJrnH6GpFHG/9qFwb EtoIPgCFJigm9H2M4ZOxmzRHwakvBG7osTsei07BCRSYUy6vH/dgSPkiNSA1eUumUBEW TqsML00J3sNyX1IJ+8C15IWd5aWtBEfw1KvWSIbkUquQRMy0ycANu3UytfGe9S72rqG8 YnZDrwLa3jCzDRTERPtUwdjuy07KEOR99Utp8PkrI7EHbjaZ1UwndFFIz1TVMc8J1dVz 9rdweSiRp7KS1Y1MFl44IHFsy7k+5aZ4b33b/COOJIIEA+sneRssD+u/9YrXp7sT/hBP b/0g== X-Gm-Message-State: AOAM530j/83wPW73s7siTfWbBmLKIkODdlQH/RiTHvZglpb5rPUbv2vi ySlw37YafttdlcSKs5V7KWNInw== X-Google-Smtp-Source: ABdhPJw9aP6CuPXiYhnsc021cGhUxiDsPVFpXzRlww3p0MkLdWVDKG8KZtY2KeZh69tpohnFpmRqyQ== X-Received: by 2002:a63:6c44:0:b0:3fa:ec6b:33e7 with SMTP id h65-20020a636c44000000b003faec6b33e7mr20976033pgc.435.1653910903028; Mon, 30 May 2022 04:41:43 -0700 (PDT) Received: from leo-build-box.lan (n058152077182.netvigator.com. [58.152.77.182]) by smtp.gmail.com with ESMTPSA id c7-20020a170902724700b00161a9df4de8sm8846194pll.145.2022.05.30.04.41.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 May 2022 04:41:42 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alyssa Ross , Ian Rogers , Like Xu , Kajol Jain , Li Huafei , Joe Mario , Adam Li , German Gomez , James Clark , Ali Saidi , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v4 09/12] perf c2c: Refactor display string Date: Mon, 30 May 2022 19:40:33 +0800 Message-Id: <20220530114036.3225544-10-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220530114036.3225544-1-leo.yan@linaro.org> References: <20220530114036.3225544-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@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 --- 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 e76219034588..725b23d9104b 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.25.1