Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp199856rwl; Tue, 28 Mar 2023 23:58:24 -0700 (PDT) X-Google-Smtp-Source: AKy350Z9qPzcVq+TlTlR5ijNIqYhYwUd6l8VAUCERFO/hGCBgvXqJki9DPW5LcBupOqHgbvxprzx X-Received: by 2002:a17:906:1453:b0:92f:df03:551 with SMTP id q19-20020a170906145300b0092fdf030551mr18268021ejc.15.1680073104347; Tue, 28 Mar 2023 23:58:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680073104; cv=none; d=google.com; s=arc-20160816; b=nMX2x+r29JvPM0rRCl+8jWsZ+RxDti1sXjcSUdmf+XVH7BD3pGNW4qURLan33Vm+aI QB6eh3SDln+0HaS//NFuQSoyO0276ism/79fBjGgK+j6O5j2hQfi9t6rBH3jaBeLYhn9 ECIc+Df+ZP7W9hgjZSdv7dLAC4HYhN8OA0VdYkCSB6XlcvcQsQlv5IvA2g1dR3uaTfVg I38IgCOpgS6CYqGxhHTftBi6CmwJ+i/TnIE9s+4pwhKlSObGPGEX2QDhg+zMRBDBNJB2 5E0yQ5OxZT/mJNfvNwdR/MSS67iIcMLaoVcbvQquTwGu6sBMEOUmWI3Xla6LvVZPEiWM mg2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=8pURmXf3C+6Lyr1DANg1dRUTcG9qspuh+UUXNLgHMyY=; b=hZvFZ63YgpAHgdXoEv0dkxChekPNwHU5BOs7GVejrfCoxsLwXcEBacRLSjmekknB7y pAzcU8UCACkS7toohG3MO7N6QmdbU86tLYSzDArzPLEhp2uj9/n2/dy3hwuU8hZkkHIQ +kbztdR0RcA16P9IaFxQJ51nhEo8RmmYvtI9mj1Lc7KfUiTLhFMVvpo27u1qBsV04Mcd Wm12HInJNjT513P/Jkxy8OUpY2PeQc7bkSsHLI8C5YSna41TQniFLJV4jpQOaGKRGGg+ ecfVgFjtcyJVy7ODWFviwL3M0oRtlJIRmMfuXPh/ttaWVPbmAIier32G/MjDdz30O80a HKQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=O8NqltXd; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o10-20020a170906358a00b0092db84073a0si17187198ejb.440.2023.03.28.23.57.59; Tue, 28 Mar 2023 23:58:24 -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=@gmail.com header.s=20210112 header.b=O8NqltXd; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229563AbjC2Gri (ORCPT + 99 others); Wed, 29 Mar 2023 02:47:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjC2Grh (ORCPT ); Wed, 29 Mar 2023 02:47:37 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DF41171E; Tue, 28 Mar 2023 23:47:36 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id n10-20020a05600c4f8a00b003ee93d2c914so10420043wmq.2; Tue, 28 Mar 2023 23:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680072455; x=1682664455; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8pURmXf3C+6Lyr1DANg1dRUTcG9qspuh+UUXNLgHMyY=; b=O8NqltXduGOxRNz+LaWXlzkJ1kyynfND+dv2J1WaTH3Si1cuxiN/6zSTW6Z3D2uISG Oe0s+LB/0mJakjhoMzVFMJVrIYlLWXMZHTkNXSRt7/I6aCDPUw1JGz5oECUtPZWOEyur OkT0NIkPVvhkSZXShkJmJhaqMrcoaYbtpqROvKTjoiaAt7tWTmgnkV23T5rPRe9S3Df+ 3ihvte78Y5seeJG7xYfNzylKFxxy1xQI2/SVLopN71bdxLkjFyMH8UC493hg6/tBWOJy 1kqE3+o5b8hqxJ2QbB8skfrHAZFtSIyaaTqbBU0a/bID5kQqNqmnWl6S8o36bo0XpKsk q6ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680072455; x=1682664455; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8pURmXf3C+6Lyr1DANg1dRUTcG9qspuh+UUXNLgHMyY=; b=kDlPJWKt1TnIGry2pWv0FlXAZ65cax3h6gzGoYfz6okqg0UBJl93/B5ESPZKGSc+1U NAZ+fIkCS74eSLMdaT5194DX3neswZR3AyZmqayogD6VHg7lpD/g/gZqp/C5Q5At+JNg LbAUs71SYOQvc5WZCd20d72n1vHnISujTKwE0c7wFpgC3fuP+nb4FlzyX97Q0aj0BcPI DfI7VrzClwuKMY7ObuecUi9RN6DQOt/aMe5aJKjP7tdhfkfyoPBxsgwpH6HJt6S9G/9O hF/uifZnS6nyXusZHogkHTwkZ47FvCPMlGRBn28Qjl8SkIepRZAwWbs3EO2b9bverxUF QHYA== X-Gm-Message-State: AAQBX9d/OtVmbtSYlG8ayMmxH0gTH1JQ+oZUfW6V7bHuSRaTR1eeKLjc OEq3lBQFBYsVFJEesmQPahgbQZRwagzuiXVP3J4= X-Received: by 2002:a7b:ce84:0:b0:3ef:6fee:803a with SMTP id q4-20020a7bce84000000b003ef6fee803amr6100502wmj.35.1680072454878; Tue, 28 Mar 2023 23:47:34 -0700 (PDT) MIME-Version: 1.0 References: <20230313085911.61359-1-yangyicong@huawei.com> In-Reply-To: From: Namhyung Kim Date: Tue, 28 Mar 2023 23:47:23 -0700 Message-ID: Subject: Re: [PATCH] perf stat: Support per-cluster aggregation To: "Chen, Tim C" Cc: Yicong Yang , "acme@kernel.org" , "mark.rutland@arm.com" , "peterz@infradead.org" , "mingo@redhat.com" , "james.clark@arm.com" , "alexander.shishkin@linux.intel.com" , "linux-perf-users@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Jonathan.Cameron@huawei.com" , "21cnbao@gmail.com" <21cnbao@gmail.com>, "prime.zeng@hisilicon.com" , "shenyang39@huawei.com" , "linuxarm@huawei.com" , "yangyicong@hisilicon.com" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Hello, On Fri, Mar 24, 2023 at 11:09=E2=80=AFAM Chen, Tim C = wrote: > > > > >From: Yicong Yang > > > >Some platforms have 'cluster' topology and CPUs in the cluster will shar= e > >resources like L3 Cache Tag (for HiSilicon Kunpeng SoC) or L2 cache (for= Intel > >Jacobsville). Currently parsing and building cluster topology have been > >supported since [1]. > > > >perf stat has already supported aggregation for other topologies like di= e or > >socket, etc. It'll be useful to aggregate per-cluster to find problems l= ike L3T > >bandwidth contention or imbalance. > > > >This patch adds support for "--per-cluster" option for per-cluster aggre= gation. > >Also update the docs and related test. The output will be like: > > > >[root@localhost tmp]# perf stat -a -e LLC-load --per-cluster -- sleep 5 > > > > Performance counter stats for 'system wide': > > > >S56-D0-CLS158 4 1,321,521,570 LLC-load > >S56-D0-CLS594 4 794,211,453 LLC-load > >S56-D0-CLS1030 4 41,623 LLC-load > >S56-D0-CLS1466 4 41,646 LLC-load > >S56-D0-CLS1902 4 16,863 LLC-load > >S56-D0-CLS2338 4 15,721 LLC-load > >S56-D0-CLS2774 4 22,671 LLC-load > >[...] > > Overall it looks good. You can add my reviewed-by. > > I wonder if we could enhance the help message > in perf stat to tell user to refer to > /sys/devices/system/cpu/cpuX/topology/*_id > to map relevant ids back to overall cpu topology. > > For example the above example, cluster S56-D0-CLS158 has > really heavy load. It took me a while > going through the code to figure out how to find > the info that maps cluster id to cpu. Maybe we could enhance the cpu filter to accept something like -C S56-D0-CLS158. I also wonder what if it runs on an old kernel which doesn't have the cluster_id file. Thanks, Namhyung