Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp69995imm; Wed, 5 Sep 2018 15:09:46 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZK/SiNkhA3YBVHAxl4U8sdr6xobXME2gk/JHCfHhA6pBMesiPf2s15hmqraw/0TujZTJgT X-Received: by 2002:a17:902:6183:: with SMTP id u3-v6mr13841793plj.19.1536185386686; 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=Tw/P+nndCvJAD8m2L3YnVMgt3o2YWvq+1pynki0a71K/vJjWE+LPChHnPpFUhs2Hi0 GTbkBEdZ/B43JjvY+ToGFHR0qYmd+P3puYdMZBm9c5Uk2ovDYaveLM41bCFD1/KWUvYs sLQH0nxC8yPvXRcOWKrtlO9hZ2HyiOifT5rUav7qCX8wVrCLMoDSFIO+SrG94FLDUX8H 4yMceTatsskOGJc/u4oPvl7CjfV7bPwD9OreQwbdeFfN88ttkksnTGW+5j3SPrHh0GRm hsd/OjFF30el7XmplZpZjXbDkCwuETBSXcmCeoxAOabXTvQ1sgVnUTaDo6PWAUXu4nHe V03w== 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=a7lM57tCeke+51Vis5hVUsottGd2IiOerpxD2uVy0Vs=; b=HjsMjv4XA1WQOVm+j6vzIkAkMBaymcyDr0EeIuQOWFwpNG0B197g6RxlywGPRWz54y nfnpp9/CbrY64E25YyA2ZRje9V2liRsPwCsEFOUhGNHL6+jRXjEEiOxo2dafrO5MUJT6 /+OHQqWfiewFobIf3fNF5Dc3NMx9t4+1ozsAyaCecz/9uWwdnq2FMN1tGtLBqTTyTKYD RP37b9w7brq/Psy2MBeSXeiP4991of92BlbUHBXVQgEOTzCG54bqSrSDGX29InLvslSH w2+C9dc1VCUHjkosEgaKgA3ZCwIKUX2UlP05Dt400BqjOT6qvTU5InbtlB6dAAX5ghZT QZ6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EoNZSg3Q; 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 3-v6si2983844plc.282.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=EoNZSg3Q; 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 S1728888AbeIFCjm (ORCPT + 99 others); Wed, 5 Sep 2018 22:39:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:54560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727593AbeIFCjk (ORCPT ); Wed, 5 Sep 2018 22:39:40 -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 2114F2077C; Wed, 5 Sep 2018 22:07:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536185248; bh=r7sbqwk/uPZZkUf6y70h2HcZsTPOQxC6uszFFJLHeqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EoNZSg3QzKi/IX8/XAbeunussijy5sLkBQKxe8YB9eeaJbfSTKBjoEgjNJ4pHAyZ5 9HW6QBIgcO7v3q+bj/dMBw8qXVTzjeI+RokBiGLkXPIS2RwC29EuEtanbJMUelZldn Ok3+j9ObQlqJRyt3cmGVP+CFBVUlMVoSr8Iulwlo= 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 57/77] perf stat: Move 'null_run' to 'struct perf_stat_config' Date: Wed, 5 Sep 2018 19:04:20 -0300 Message-Id: <20180905220440.20256-58-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 static 'null_run' 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-33-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-stat.c | 7 +++---- tools/perf/util/stat.h | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 381549a989b4..844c755564e3 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -148,7 +148,6 @@ typedef int (*aggr_get_id_t)(struct cpu_map *m, int cpu); #define METRIC_ONLY_LEN 20 static volatile pid_t child_pid = -1; -static bool null_run = false; static int detailed_run = 0; static bool transaction_run; static bool topdown_run = false; @@ -1676,7 +1675,7 @@ static void print_footer(struct perf_stat_config *config) FILE *output = config->output; int n; - if (!null_run) + if (!config->null_run) fprintf(output, "\n"); if (config->run_count == 1) { @@ -1894,7 +1893,7 @@ static const struct option stat_options[] = { "repeat command and print average + stddev (max: 100, forever: 0)"), OPT_BOOLEAN(0, "table", &walltime_run_table, "display details about each run (only with -r option)"), - OPT_BOOLEAN('n', "null", &null_run, + OPT_BOOLEAN('n', "null", &stat_config.null_run, "null run - dont start any counters"), OPT_INCR('d', "detailed", &detailed_run, "detailed run - start a lot of events"), @@ -2309,7 +2308,7 @@ static int add_default_attributes(void) struct parse_events_error errinfo; /* Set attrs if no event is selected and !null_run: */ - if (null_run) + if (stat_config.null_run) return 0; if (transaction_run) { diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h index 35550e3efd81..c198926c0e27 100644 --- a/tools/perf/util/stat.h +++ b/tools/perf/util/stat.h @@ -94,6 +94,7 @@ struct perf_stat_config { bool csv_output; bool interval_clear; bool metric_only; + bool null_run; FILE *output; unsigned int interval; unsigned int timeout; -- 2.14.4