Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp68289imm; Wed, 5 Sep 2018 15:08:05 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ+OVBP54Am+eKLnPrU1LkFbwi4meqDu7J5Q0ueVUee//ooObGJNEDBW/TMLiAhvnzwBCrK X-Received: by 2002:a17:902:4a:: with SMTP id 68-v6mr34202937pla.276.1536185285703; Wed, 05 Sep 2018 15:08:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536185285; cv=none; d=google.com; s=arc-20160816; b=WKW+YwNMpxiiklaBgYhSvsRy/VbHL7YuL/IOW5LDhzoeM46Lksu9qaJjNrg0hbKV2X STd4DMRNkizES5pTw/ILoMvmLIDQqW/JCxh4ZPE6xSf/GNaZZ+0vh2FNrU9mfoktlUHP lKqT2gIEdaSk+m12CkcVOX6sL+ZrL4l/KujfJm9UQA0mHY6HpOvuP9F8RE47z715DE2b gq7r0InBSjXV6uRy5HUAb8m7/353WHlOFlmMS4Xb9WNNIQOtR+5SS3AnLB1vPfjuphdF erXMGaieAxI/cH19pZdtnUqj69o/AqW1lbEmjOFhg50yLwZ5ooU/7NgJxFh44p7QcTUX gezQ== 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=yiyB6AmSyfma24/+gidhf6HNnV7RgGcQW5uPxFIEnQw=; b=zjoYNEc4PwyMvW0EQBOe+IDq6zUCJBxRKesB/J6D8TrgjIl4TRIJrlqFri92yjsNgh 3eu9G7WWht6wTAcioxy4AxTpLTZOu+KkJAQrdp9lHAhe6OwuG/qKL0l78Z/9ojcX9tTg V3Lc7LMIpqpKg5HLBT+Ed04F8URWD3fiAKtSDgn4C7Wl4W/YhGq+RAm5gkXd4Vg7auav clipMO7gNS73WHVjKv6tQGXe9zT7aX4iPYBt/Tn2zNfdS5+iXEbTKBUE4El8m24J3msA jXEFVheOlZ9M0alMh9k3u1GRy2/RqjEAcWOKrvea+5vKDIXlw/p4u8cOU8nmzVNq38Pa +Ipw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OM10jzGJ; 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 14-v6si3341699plb.230.2018.09.05.15.07.50; Wed, 05 Sep 2018 15:08:05 -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=OM10jzGJ; 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 S1728483AbeIFCiT (ORCPT + 99 others); Wed, 5 Sep 2018 22:38:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:52770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728389AbeIFCiT (ORCPT ); Wed, 5 Sep 2018 22:38:19 -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 46F5120867; Wed, 5 Sep 2018 22:06:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536185167; bh=gF03qJxZxKTQgoik2t/Slbi20br5Im0szxW+jkLmvrA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OM10jzGJozXTCb/YUhvtfMZo9eetIxij7ulLTdI/YPbdLWwABfmt1aJAuDF6EvrNZ dG8vwyj4ugbNeMlyb4r0cx6LvJlsWIgwWqOy5ZcMSOauhlrMGF1fgEASga9mLjYxZm 6F3ytq9QDebjaF/hu5ap6vk5ZWCFNdB5G1XmSlwo= 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 28/77] perf stat: Move 'no_inherit' to 'struct perf_stat_config' Date: Wed, 5 Sep 2018 19:03:51 -0300 Message-Id: <20180905220440.20256-29-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 'no_inherit' variable to 'struct perf_stat_config', so 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-4-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 719abdd3b7de..84dbac526925 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 int run_count = 1; -static bool no_inherit = false; static volatile pid_t child_pid = -1; static bool null_run = false; static int detailed_run = 0; @@ -254,7 +253,7 @@ static int create_perf_stat_counter(struct perf_evsel *evsel, if (leader->nr_members > 1) attr->read_format |= PERF_FORMAT_ID|PERF_FORMAT_GROUP; - attr->inherit = !no_inherit; + attr->inherit = !config->no_inherit; /* * Some events get initialized with sample_(period/type) set, @@ -1969,7 +1968,7 @@ static const struct option stat_options[] = { parse_events_option), OPT_CALLBACK(0, "filter", &evsel_list, "filter", "event filter", parse_filter), - OPT_BOOLEAN('i', "no-inherit", &no_inherit, + OPT_BOOLEAN('i', "no-inherit", &stat_config.no_inherit, "child tasks do not inherit counters"), OPT_STRING('p', "pid", &target.pid, "pid", "stat events on existing process id"), diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h index 91e6609fce6e..53b2415ba3f3 100644 --- a/tools/perf/util/stat.h +++ b/tools/perf/util/stat.h @@ -88,6 +88,7 @@ struct runtime_stat { struct perf_stat_config { enum aggr_mode aggr_mode; bool scale; + bool no_inherit; FILE *output; unsigned int interval; unsigned int timeout; -- 2.14.4