Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp366973ybe; Wed, 4 Sep 2019 00:36:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqym6SVOCkZsI0zFgC68yIeArAWhZO+y90X2Ey+L6+BR2e++BnH1labAbsJbNMbVPbpjtKrY X-Received: by 2002:a63:d30c:: with SMTP id b12mr18223477pgg.235.1567582604043; Wed, 04 Sep 2019 00:36:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567582604; cv=none; d=google.com; s=arc-20160816; b=I0hqup+TQTwblzkTKTuwxF9MHXt8q4kFVCGBMN9KVja5+JA5E1z72l3PU95IlUdwzZ nKPTDbdtCGApGdO5LNlhDVHuni0ZzsyeMZl6EGAatclDxlYTVUBxvD6FzdZiWcU6EG6A 3vk00ImdeMsOQJCPzbPZ591MFYReZvHiGsturwdAGK3TDOkMASKtAG4xNYb60htlHPOq 8jbYAXYotZT/r6sLW9qqXruSFoi1W6fUH52pivDcscpwcHaTuKqATZFrJWQfkHM2qo8L RSzrxfcJO1QJg3eoe9/LVAac+aDPBruXfSNSCWtRLII0tkEUlZh+uNG1/2JtryAGp8VD cDYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=tl1PX/q1nLApY8stVTxcxyDzsIj8BYSsHkzrrElvbB4=; b=bmTJQP5YuZeE4CE+pHiNEstPV3daHtPPbr9Pbf2o0xmL9tuoPdOVrWmpOei/Ld3UNH ZxJARdKZmXzyetxgwkdeP4WdRozTprd1HxFpi0YXImKkoLhhJYQ1uYe1okyvVxEbFdby yS2UqNynSUsZeFF3IY8KydE8/TBQpgRBpl8xYruD65fqJ1Np1FjeyHj7Y1PpFhF5cAhs fpkKhDXox1MNF5qCkWn+prMPYcHumPryXYluP1uYHwVW6ATT6khqrbaDDmIUt30qko1J 1ndp+3LpV2Umvw/5BockLyTE4iYjfgXB7HgpIJqiaSZNONkFLKvFh7uNTLUaHaYeAk99 Bh4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t6si1651169pjv.81.2019.09.04.00.36.28; Wed, 04 Sep 2019 00:36:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729178AbfIDHeU (ORCPT + 99 others); Wed, 4 Sep 2019 03:34:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42024 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729049AbfIDHeT (ORCPT ); Wed, 4 Sep 2019 03:34:19 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4003518C893C; Wed, 4 Sep 2019 07:34:19 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.103]) by smtp.corp.redhat.com (Postfix) with ESMTP id 98E0C60126; Wed, 4 Sep 2019 07:34:16 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Joe Mario , Kan Liang , Andi Kleen , Alexey Budankov Subject: [PATCHv2 0/3] perf stat: Add --per-node option Date: Wed, 4 Sep 2019 09:34:12 +0200 Message-Id: <20190904073415.723-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.70]); Wed, 04 Sep 2019 07:34:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi, adding --per-node option to aggregate stats per NUMA nodes, you can get now use stat command like: # perf stat -a -I 1000 -e cycles --per-node # time node cpus counts unit events 1.000542550 N0 20 6,202,097 cycles 1.000542550 N1 20 639,559 cycles 2.002040063 N0 20 7,412,495 cycles 2.002040063 N1 20 2,185,577 cycles 3.003451699 N0 20 6,508,917 cycles 3.003451699 N1 20 765,607 cycles ... v2 changes: - use mallox instead of zalloc plus adding comment [Arnaldo] - rename --per-numa to --per-node [Alexey] - rename function names to have node instead of numa Available also in: git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git perf/fixes thanks, jirka --- Jiri Olsa (3): libperf: Add perf_cpu_map__max function perf tools: Add perf_env__numa_node function perf stat: Add --per-node agregation support tools/perf/Documentation/perf-stat.txt | 5 +++++ tools/perf/builtin-stat.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++---------- tools/perf/lib/cpumap.c | 12 ++++++++++++ tools/perf/lib/include/perf/cpumap.h | 1 + tools/perf/lib/libperf.map | 1 + tools/perf/util/cpumap.c | 18 ++++++++++++++++++ tools/perf/util/cpumap.h | 3 +++ tools/perf/util/env.c | 40 ++++++++++++++++++++++++++++++++++++++++ tools/perf/util/env.h | 6 ++++++ tools/perf/util/stat-display.c | 15 +++++++++++++++ tools/perf/util/stat.c | 1 + tools/perf/util/stat.h | 1 + 12 files changed, 153 insertions(+), 10 deletions(-)