Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp72050imm; Wed, 5 Sep 2018 15:11:57 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbK20TbgdGTvy9tYAtJVHujxdxcESZl6INfB4kuApkrorocUrhCOJ9hwbPNRn9nCHb1dKhr X-Received: by 2002:a17:902:5a4e:: with SMTP id f14-v6mr36152236plm.311.1536185517348; Wed, 05 Sep 2018 15:11:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536185517; cv=none; d=google.com; s=arc-20160816; b=MISE+COl4HioX5ZXKbYwDaGwbOhcSVDpt18xgcW+yzisRawm0DWhaAtnUJo95GaLKe ZQPlH9qSkVU0IWLyh/ayUeD+SczlUE51NmYvKvs3dZWzkTmSnbxWq/Rq4TqAjd9WYCbx Q3qJmX2Um0S6tXy3fE/3wt6bBYTV2xjgt08eU3anMebP5RD5HndXkbdokJrTbWBktX7M P58HXMXXfkVX51Bel8Wt9FOW61yMjlPVGkoAT/NSQOw0/Mc3elDbYaPL9DTsoPdYwA0d 8bXq4DlzWJ07MNVAJmlbUu8+xNwJQg6nUWCy3AaT98B3xgIoR9lklcdb+Rg9pM1L4QI1 auQw== 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=KXKZU1+Nv0ajeRyz3/Mt7gnqcaNi5KtxBVeBgXpyRHk=; b=0D67phJMbEJx0Qu8EwP+F69O4dWv1kV1mLQMwt4sSI5NMAOITjCkpLbriH+gGDiy/E o4Mi4wtYfmSlC5xUrOHyXNb9ZOu9M7wG3IQ1k5lgQK3GQlaMdhem3m2kb3+uD5NdbIxv eruI5xc6o0GhGwT3MiFqoGpjAB/gHHmc0UFNGS9wqYAw3/mOwQHjuzk4kNOl3wvBZesT g4/ACN7pdqi9S/2FHeI2XarY68vq3/1+cOZreyEyPT252gNb3RlWvQPBwa/OPp0kNQKV BQ+YPds2R9WxBTehgdPPmWmQGtwFYZtD3FNXvqHSY0PJdgPNBHAf2uvSjj1f9MALbRt/ hfYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YRFq5KB7; 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 h69-v6si2706201pfc.121.2018.09.05.15.11.41; Wed, 05 Sep 2018 15:11:57 -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=YRFq5KB7; 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 S1728917AbeIFCjr (ORCPT + 99 others); Wed, 5 Sep 2018 22:39:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:54676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727593AbeIFCjq (ORCPT ); Wed, 5 Sep 2018 22:39:46 -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 EE6FF20839; Wed, 5 Sep 2018 22:07:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536185254; bh=3TA1yZglQlVBA5cqg9YxCsgr0jP7TqrXf5yqs4fHS30=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YRFq5KB7kC4JHnDQ5rkZ2trxrlMN0W08tL1etTX5A4wjk9W2kGn/fgpQJ5sRaXPld IEdh4ZkQDy2U8e8jlaDfm+LR10fEIBiwocWHY9Z6GDJqpweaQsbsl5q33fu4h9CqYc m6Ec1M77pLwnTcRLxB2Xmp0U8kSDGZGWhuKaTvbI= 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 59/77] perf stat: Move 'print_mixed_hw_group_error' to 'struct perf_stat_config' Date: Wed, 5 Sep 2018 19:04:22 -0300 Message-Id: <20180905220440.20256-60-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 Move the 'print_mixed_hw_group_error' global variable to 'struct perf_stat_config', so that it can be passed around and used outside the 'perf stat' command. 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-35-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-stat.c | 5 ++--- tools/perf/util/stat.h | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 8748bb5e5403..f61c2dc8c7e8 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -170,7 +170,6 @@ static bool append_file; static bool interval_count; static const char *output_name; static int output_fd; -static int print_mixed_hw_group_error; static u64 *walltime_run; static bool ru_display = false; static struct rusage ru_data; @@ -1052,7 +1051,7 @@ static void printout(struct perf_stat_config *config, int id, int nr, if (counter->supported) { config->print_free_counters_hint = 1; if (is_mixed_hw_group(counter)) - print_mixed_hw_group_error = 1; + config->print_mixed_hw_group_error = 1; } fprintf(config->output, "%-*s%s", @@ -1715,7 +1714,7 @@ static void print_footer(struct perf_stat_config *config) " perf stat ...\n" " echo 1 > /proc/sys/kernel/nmi_watchdog\n"); - if (print_mixed_hw_group_error) + if (config->print_mixed_hw_group_error) fprintf(output, "The events in group usually have to be from " "the same PMU. Try reorganizing the group.\n"); diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h index 8cad17363e90..6fb4dac26ccc 100644 --- a/tools/perf/util/stat.h +++ b/tools/perf/util/stat.h @@ -104,6 +104,7 @@ struct perf_stat_config { int times; int run_count; int print_free_counters_hint; + int print_mixed_hw_group_error; struct runtime_stat *stats; int stats_num; const char *csv_sep; -- 2.14.4