Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp71413imm; Wed, 5 Sep 2018 15:11:15 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbh4aUu0l+gWorJS+ejDKlw4+h9ciJLIUfskbIAnm5OLsJIftdvubuAvlzVcPDTUIJEKRZ/ X-Received: by 2002:a63:da04:: with SMTP id c4-v6mr39120460pgh.398.1536185475161; Wed, 05 Sep 2018 15:11:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536185475; cv=none; d=google.com; s=arc-20160816; b=WeZC4AG90a1tUwdXJ8R3+s0OwKrkdOm6o3bMFDVn/I2VaKDscLyX57O30iJ5b/MDEJ XTsrHw8VjJ4Ku4Avoyx/WduGDfqc7zt6KJo++aYQfrT28Dr4Eop9Kj8sU/x5AYHd1Fcc SS2SfYmiIa4nlu73Ym/ChjlOQ5W+bix/sBI22n2TTmh26gs4a/Bgq3GzOjYuPlrjdYsP /c9qOc+ia/x6uEzTA09KBeNtbLQz/LS+Ir43OQWDGeFoLY1XgDNjE+26OxDDNlVCcCoU P9sgoPRcOLyjriVDfh4cbqu9vu1uBKgKvJzfjpIrAXqmg1miAQ6ZMKz42WcHq/a4w4Ko BMAA== 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=Xd/qfdwviBzeNG5da6b4Nhbq2R+iRKgejczEoj3RssU=; b=vNyAn4SKTLPVVP4R0gWHKqCb62Yo2s5kJyhicsL9l+c2zOIN6qlHhydeRhyjP8luXv rYAgoxCHV3lDWsGBBt/q4orIW7Q1ly7L+BQrzLRrBQVmH3be7mJSFFIeW/oR2ShE6Iqm 8Nw1nF59Ls5eEYbICEDJE6liZYuDBYjMZGI9KE1PWEHyee3yGfvrKFf4prUcyppMLCK7 KScxQoFwmROEPATOwmTdzA7r64tXiQFUYZigoKQxtcB3RI1/6DywzKNzIGfc55sQxaSD kOeRDMdbd0cyGTgp0NJ4riVEfDWaU9hok954OQlHVE11gfqxaywds4pRp91Bgg+kKVu1 jBug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t6s9cJOz; 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 r25-v6si3125966pga.489.2018.09.05.15.10.59; Wed, 05 Sep 2018 15:11:15 -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=t6s9cJOz; 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 S1728995AbeIFCkB (ORCPT + 99 others); Wed, 5 Sep 2018 22:40:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:55002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727586AbeIFCkB (ORCPT ); Wed, 5 Sep 2018 22:40:01 -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 96E1B2077C; Wed, 5 Sep 2018 22:07:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536185269; bh=yaxC4x6RDY7RXWwIfY0QEhJTIjvqWLzvcJnunCgqYTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t6s9cJOzjmMfalYNaN814AzNnV4vMVhROgoQ6drM4qAPJD5gCe+sRHW/QrksydK/3 uFaSHqd4XR+00BLpj+wEGbIVIsZtHVRB2xfAu3ssCXfQUefYxkIIzh6wC4gXkdrCU/ VrzqBde9DKRnl1TpRsz7VQIknbCUE3wX8Cbs0pC0= 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 64/77] perf stat: Move 'no_merge' data to 'struct perf_stat_config' Date: Wed, 5 Sep 2018 19:04:27 -0300 Message-Id: <20180905220440.20256-65-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 variable 'no_merge' to 'struct perf_stat_config', so that it can be passed around and used outside '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-40-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 8ca85017a973..c4df076f1e54 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -158,7 +158,6 @@ static const char *post_cmd = NULL; static bool sync_run = false; static bool forever = false; static bool force_metric_only = false; -static bool no_merge = false; static bool walltime_run_table = false; static struct timespec ref_time; static bool append_file; @@ -1173,7 +1172,7 @@ static bool collect_data(struct perf_stat_config *config, struct perf_evsel *cou if (counter->merged_stat) return false; cb(config, counter, data, true); - if (no_merge) + if (config->no_merge) uniquify_event_name(counter); else if (counter->auto_merge_stats) collect_all_aliases(config, counter, cb, data); @@ -1902,7 +1901,7 @@ static const struct option stat_options[] = { "list of cpus to monitor in system-wide"), OPT_SET_UINT('A', "no-aggr", &stat_config.aggr_mode, "disable CPU count aggregation", AGGR_NONE), - OPT_BOOLEAN(0, "no-merge", &no_merge, "Do not merge identical named events"), + OPT_BOOLEAN(0, "no-merge", &stat_config.no_merge, "Do not merge identical named events"), OPT_STRING('x', "field-separator", &stat_config.csv_sep, "separator", "print counts with custom separator"), OPT_CALLBACK('G', "cgroup", &evsel_list, "name", diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h index 843672214cca..0758107fe56f 100644 --- a/tools/perf/util/stat.h +++ b/tools/perf/util/stat.h @@ -104,6 +104,7 @@ struct perf_stat_config { bool null_run; bool ru_display; bool big_num; + bool no_merge; FILE *output; unsigned int interval; unsigned int timeout; -- 2.14.4