Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp69986imm; Wed, 5 Sep 2018 15:09:46 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaL0A8oI9IwSFZIOUn6zHTY7FLxxTgSTUpUtFNebf+UYmlL/hsloVtWYZmLMGinflv/cSbP X-Received: by 2002:a62:7d8d:: with SMTP id y135-v6mr42446189pfc.259.1536185386303; Wed, 05 Sep 2018 15:09:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536185386; cv=none; d=google.com; s=arc-20160816; b=IuYCaR2VSrNMR+u1EIaZMECXtZZMp4wvc2bkqIXqUZWKuPMBbikxSPVTBwcM/1DiVa SBNQRCVxwEydR911YG9Gii8Zje2FI7SAkscUDLgIEGPv/7kojXQ8C5+3JkAPAzZcU14Z 7nQdUe6xiYA3IM2qbCVaeS9AKIZ3GHDeCwH2bv2SQtejs/Dh2EmqFMDL3tmCnwDKH/13 o1P2dG4RkJe9IMTkLHk9Tjt4vF8/8Zf1fxpPxvFc9lJguz6qN2woZ9Conzo3aMlCMyzg oTgivRgCgJDlh3Rpaq/3cVWgKmeGdCrAfL74qZOx69xuWYYvohOl/xeHFM/hZEuG5sk4 cXNw== 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=Qkl99cXJrSUEPtwuNOyD9JPrepdlixn2a0ZV57d5Jzw=; b=b2aDbyZc5woYz0Eogd0WdSJROFvN/CTFXjShiNNOUq3dEwZQfaBqKSBdlVg6XEojnc 3kg/M230asqJ/FuMPRCjtbyy4lhdSS56S2PUlWjWK54UCAn7oN6IhFAv6+nrBhMxmQ88 M/Rbv7O4DqRqTY64zjVCtWcZTUDjhNUDgmTBYa+63ccGpbsjDasGa+naNlJYKB06GwYf WewWPkDpoS8ahxTA5IT5YZeTrTWpSdnA/TTJ+KIn1byV/zZWEpLkfmbaYe0SQgPSq/f2 gjBeIv8h/eGw8zy7sD3jmhN+xWEp7urG+kye0xgM/UCJ5+NhsKx+5LKBkOLEVh479Lzp Flvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T0sxXHO8; 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 d127-v6si3252912pfa.189.2018.09.05.15.09.31; Wed, 05 Sep 2018 15:09:46 -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=T0sxXHO8; 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 S1728902AbeIFCjo (ORCPT + 99 others); Wed, 5 Sep 2018 22:39:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:54614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727593AbeIFCjn (ORCPT ); Wed, 5 Sep 2018 22:39:43 -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 CAFC220652; Wed, 5 Sep 2018 22:07:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536185251; bh=yXzM0ZYB/v8n7Zlw57xXXvb63giXgT/LBWfkJlfuRE4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T0sxXHO86fbYEpxIXsNWNVp+47sqWPvhENu2PMvwyPysn1hi/pzWVmVXuItCHJEBc IJj50N7zA2kQ3FcIMZaYqB7Qf4xskeqQ8SrDcXPXNefkjFMAhPxlYKO2i8Tau5CvZF H/TajCg9NvocvpEz/YpDSRGjnp2EArFeU//Osltc= 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 58/77] perf stat: Move 'print_free_counters_hint' to 'struct perf_stat_config' Date: Wed, 5 Sep 2018 19:04:21 -0300 Message-Id: <20180905220440.20256-59-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_free_counters_hint' 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-34-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 844c755564e3..8748bb5e5403 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_free_counters_hint; static int print_mixed_hw_group_error; static u64 *walltime_run; static bool ru_display = false; @@ -1051,7 +1050,7 @@ static void printout(struct perf_stat_config *config, int id, int nr, config->csv_sep); if (counter->supported) { - print_free_counters_hint = 1; + config->print_free_counters_hint = 1; if (is_mixed_hw_group(counter)) print_mixed_hw_group_error = 1; } @@ -1707,7 +1706,7 @@ static void print_footer(struct perf_stat_config *config) } fprintf(output, "\n\n"); - if (print_free_counters_hint && + if (config->print_free_counters_hint && sysctl__read_int("kernel/nmi_watchdog", &n) >= 0 && n > 0) fprintf(output, diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h index c198926c0e27..8cad17363e90 100644 --- a/tools/perf/util/stat.h +++ b/tools/perf/util/stat.h @@ -103,6 +103,7 @@ struct perf_stat_config { unsigned int metric_only_len; int times; int run_count; + int print_free_counters_hint; struct runtime_stat *stats; int stats_num; const char *csv_sep; -- 2.14.4