Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp70194imm; Wed, 5 Sep 2018 15:09:59 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ2iE6VIp6MZZ18UQUMb8xeqEPHu7HZ+oJ6VcvItvL+vZSqFLfLmEG0GHZ2OENxRvqNkUYs X-Received: by 2002:a63:c347:: with SMTP id e7-v6mr39331274pgd.240.1536185398963; Wed, 05 Sep 2018 15:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536185398; cv=none; d=google.com; s=arc-20160816; b=ZuwxBq5oxEmqDnAf/bqMb4ZwUthQZ5GCNz7AvVXeSF0h9Bta4l+L1SLHDkpQlhMGE5 t8DJD37zJ9LpbbPWDirtM88XIBPWt3PfNuWknJLnL+UDl3UFz2NXLk2rRFIHNuMGv8Mv v32/xhRK/Su1I//2Iq2o/hTbiwR97JaEFqfdpY3mvQn6wXhx9oXmOaiKDY5scJ6rcRhO Iz3wtOP2hWJjflfk/I4IoRp+wUhsAtDiwtsMkWD62VGz56iiOyM/NZzQ21nvntqjLwDC vwJHM7TFWsCT7ihFjfVucpnOWaLaje7eZ1KAqI0+Vr+ceGbwuVL2RA8WUhLYW9nO3gmC bdOA== 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=O0DIhyFyYhh/qTJgEmFJLg0tOYexAFi0NZt1gNM3VrE=; b=fW49Wz1hmfK730CbIWdfaRcursPTWlFX0m6ovL7nRpPjFrmg2P17Ouet2GfWbzdVy/ Guf8Wq+ceG1gXYUfzfT0vL4k84N0UwjEDiroR2/++Y9ZTI4X60Ls1hUkhawZGo0bgZ98 NuCmE1y6uBAY+940x+tkrw1dCZO7CzPPP6B4D6JLXkZKauRLHgCbb4XkEXBwC+wxwZXA w3Xqf9LVMzVMvM6hG9HjUA1hsFoimWfXxQuc26gd4RWCprT9bZd/UemNDbyGD6fybyUs zuwWZ3aIt2ix/wUQC8hXEvtgg6LF339ECNW/WCbn6cSx2skMQ+W2UeBXQxo+P+U5qiaR DUVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bJxsU4oL; 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 o18-v6si3349066pgh.91.2018.09.05.15.09.43; Wed, 05 Sep 2018 15:09:58 -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=bJxsU4oL; 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 S1728622AbeIFCio (ORCPT + 99 others); Wed, 5 Sep 2018 22:38:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:53322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727626AbeIFCio (ORCPT ); Wed, 5 Sep 2018 22:38:44 -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 3EBF820652; Wed, 5 Sep 2018 22:06:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536185192; bh=ADaxsaST1rSlQYGgMi0FeTbrFD4IynWqaOkNjf91RQM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bJxsU4oL62g6nKPv0Jbxt5avzihsLF9q51WcV/+XVGRv2SBXft1Ikk6d2SCodKpZC 6W+j8wVTq+T3QbcdG6Z+aXG9Imvs9AUBAeTUBCqJmh+V//APdwoF7jxPdNpoI/cLOQ F0lbfxZgO2mvp5TnEic0dCalb6FXBDn3o9VEr7VM= 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 37/77] perf stat: Add 'struct perf_evlist' argument to perf_stat_synthesize_config() Date: Wed, 5 Sep 2018 19:04:00 -0300 Message-Id: <20180905220440.20256-38-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 Get rid of the 'evsel_list' global variable dependency, here in perf_stat_synthesize_config() we are adding the 'evlist' arg. 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-13-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-stat.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index ae5029875e87..cb36344c25b7 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -404,12 +404,13 @@ static void workload_exec_failed_signal(int signo __maybe_unused, siginfo_t *inf static int perf_stat_synthesize_config(struct perf_stat_config *config, struct perf_tool *tool, + struct perf_evlist *evlist, bool attrs) { int err; if (attrs) { - err = perf_event__synthesize_attrs(tool, evsel_list, + err = perf_event__synthesize_attrs(tool, evlist, process_synthesized_event); if (err < 0) { pr_err("Couldn't synthesize attrs.\n"); @@ -417,12 +418,11 @@ static int perf_stat_synthesize_config(struct perf_stat_config *config, } } - err = perf_event__synthesize_extra_attr(tool, - evsel_list, + err = perf_event__synthesize_extra_attr(tool, evlist, process_synthesized_event, attrs); - err = perf_event__synthesize_thread_map2(tool, evsel_list->threads, + err = perf_event__synthesize_thread_map2(tool, evlist->threads, process_synthesized_event, NULL); if (err < 0) { @@ -430,7 +430,7 @@ static int perf_stat_synthesize_config(struct perf_stat_config *config, return err; } - err = perf_event__synthesize_cpu_map(tool, evsel_list->cpus, + err = perf_event__synthesize_cpu_map(tool, evlist->cpus, process_synthesized_event, NULL); if (err < 0) { pr_err("Couldn't synthesize thread map.\n"); @@ -608,7 +608,8 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx) if (err < 0) return err; - err = perf_stat_synthesize_config(&stat_config, NULL, is_pipe); + err = perf_stat_synthesize_config(&stat_config, NULL, evsel_list, + is_pipe); if (err < 0) return err; } -- 2.14.4