Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp69059imm; Wed, 5 Sep 2018 15:08:51 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYqtfKfHXoSj1nu0SwHGTcV9Vvw+At1Zic2akTcdAJbdz2v0NuBLeeWn6EjwDDmM9sJJF3C X-Received: by 2002:a62:9cd7:: with SMTP id u84-v6mr42701905pfk.90.1536185331388; Wed, 05 Sep 2018 15:08:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536185331; cv=none; d=google.com; s=arc-20160816; b=rm6T38AfKfw43jw135l7wAKKniNxsABq6SniLnkvm1it1G24/gvGyTmmVdxENjTckF wtq7+zWzzgLZZiF9yjZYew/5j9ck4OqQeAdkL+QdBkF3VM9GYtTkPE+FJ6h5ZYAnEL7v RcMV+/3ID+t2T8HdisSABwBLkkFVLHm+rBNkZ/6j8IEIrcWSnl4efEgGLfeNrskRNxO4 02uGdj2ppEkNcrMSSVSMHLecy+V3vSm4HsFpE0qcG9A9Unn/tA6YYlqYURYHMfbjDBZ3 X2iFyJOC4i/6fQ/tSUtxx7jIQkCkglvdOV2AP+NBLTtd1HF9tk6DgNoFKJevbH7aTFOc ZIQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=D0lDAneOexwxoIwdiXURHYsRsZsAWMYWG2lDGmJGDVM=; b=PoGHkMqnZjO8Bw5fauiCxIxz+OTdCLfPRdlaKbRsK7TzNZPe27BHTwupQ4crqAl75z NTc6SobF56OKZ/LX2LIn7aRrfyb1FkcVx+r2eLqVltHw/9+Zp1GEifBXWt927KzZ79EC CSswONxlNmmQiAkO0jtd06y/1E4rLb65qegjXCDGnx4AIhs30sWn9k/ZYT/oc/Is60nf Qi3wah4JkPE4mP6yN83Jxfg5rjh7PQq4ios0Ogkv5gqqumtHx5eOuGyN9bjAcM5JJqjE 3/3F160yRM+9mrtUA29usebbrkInLBolvsVU7CcL/kTnixOqqp1gA9yiJbxknYUHZc7o H2Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VSqJGYJG; 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=pass (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 l30-v6si3157675plg.12.2018.09.05.15.08.36; Wed, 05 Sep 2018 15:08:51 -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; dkim=pass header.i=@kernel.org header.s=default header.b=VSqJGYJG; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728669AbeIFCix (ORCPT + 99 others); Wed, 5 Sep 2018 22:38:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:53488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728642AbeIFCix (ORCPT ); Wed, 5 Sep 2018 22:38:53 -0400 Received: from jouet.infradead.org (unknown [179.97.41.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EEE2C20652; Wed, 5 Sep 2018 22:06:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536185201; bh=yeuYOY0BqagfsntxNlrduM5Nk+4G/Ht03Z7EAla7ayk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VSqJGYJGOX2rT5jO6po9pkypBf2qaXWg93NbYQBmdftB2YRvCS32JNbOpsh0RT83p CqHW/33/jsiD+WXpl/SC/ewKTYX9/kVr2uUdSzovLmlx6prLT3ijUL/E7p8XG0pDfz pboqMc7suWuhbjgtqdaSBxGAcTyHU5DXiYQ86sZk= From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Jiri Olsa , Alexander Shishkin , Andi Kleen , David Ahern , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo Subject: [PATCH 40/77] perf stat: Introduce perf_evlist__print_counters() Date: Wed, 5 Sep 2018 19:04:03 -0300 Message-Id: <20180905220440.20256-41-acme@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180905220440.20256-1-acme@kernel.org> References: <20180905220440.20256-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Olsa To be in charge of printing out the stat output. It will be moved out of the 'perf stat' command in the following patches. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180830063252.23729-16-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-stat.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 54768ec15dbc..db11832bbdbc 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -1692,7 +1692,10 @@ static void print_footer(void) "the same PMU. Try reorganizing the group.\n"); } -static void print_counters(struct timespec *ts, int argc, const char **argv) +static void +perf_evlist__print_counters(struct perf_evlist *evlist, + struct timespec *ts, + int argc, const char **argv) { int interval = stat_config.interval; struct perf_evsel *counter; @@ -1724,14 +1727,14 @@ static void print_counters(struct timespec *ts, int argc, const char **argv) print_aggr(prefix); break; case AGGR_THREAD: - evlist__for_each_entry(evsel_list, counter) { + evlist__for_each_entry(evlist, counter) { if (is_duration_time(counter)) continue; print_aggr_thread(counter, prefix); } break; case AGGR_GLOBAL: - evlist__for_each_entry(evsel_list, counter) { + evlist__for_each_entry(evlist, counter) { if (is_duration_time(counter)) continue; print_counter_aggr(counter, prefix); @@ -1743,7 +1746,7 @@ static void print_counters(struct timespec *ts, int argc, const char **argv) if (metric_only) print_no_aggr_metric(prefix); else { - evlist__for_each_entry(evsel_list, counter) { + evlist__for_each_entry(evlist, counter) { if (is_duration_time(counter)) continue; print_counter(counter, prefix); @@ -1761,6 +1764,11 @@ static void print_counters(struct timespec *ts, int argc, const char **argv) fflush(stat_config.output); } +static void print_counters(struct timespec *ts, int argc, const char **argv) +{ + perf_evlist__print_counters(evsel_list, ts, argc, argv); +} + static volatile int signr = -1; static void skip_signal(int signo) -- 2.14.4