Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp70191imm; Wed, 5 Sep 2018 15:09:58 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda10sz+2Vr6hSfziUshjR2lWT1SP4A/04mkYer+rJ9FYacgJfN4sstxL5kUyN6HB/xaQhfp X-Received: by 2002:a17:902:9687:: with SMTP id n7-v6mr41077263plp.33.1536185398864; 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=lf8bvNhC7CQGktuRmG02dMeMZMvOzT/C0kwEL3fLPW7oR4hpeOOfER3y7yAXnkbVRH KP0n9fMUS0px0fqnWoTJmdIxvNItdc6Rl+tnpQB8bXrElOvYqxoI0IXbbAvjOH3qPES0 0289gbQ5BLaMYqfc79o0adS/8Dm01i5GDqRC3eGTVeiP1L3B2YalJpEdFZx5K0wKt9zN XKNeoQ87NrRFjDT0rXNyWvNdw+GhaRfqyxyrRNoWQdUX6fTDtgUaYdQqgs2cLyfKEIAH HyexFoYXxdfCsTpWPz2ihawpGI1ATReVo89gZVN14feUKcN15bpk+g4PCy1gOi0FV9/L zdmw== 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=lg4U8F8AZREiUvTwgE6WzmF90JlaZpl06sX1vp3ahWg=; b=MpyBIOfbfFTXBqhpEjMQWAPJaQX5KHoZLp2BErQ6RF3U0YrbFfxGZeWdVfy1U1VsyR inMqF/dyzuRIWPcBi/hQKoHybSjrjbsyn3unO3EFd1/1jKoTQa71m3IXEmMngLOIoXO3 5kss7YHDRFqke2dbwxsAH9H+liDJCIW3umNYfCg1u2gZAXzpxw0hniiKXMNgzwzlI0qh 3ohxhuIvxsrFY3e/Y9xD/1SnyU6ksCxOk1PDjvNBv2DT9NpnI331p+G6fYIHROINiKGI PcgjLO5fcTOGHoNkyvSZNcKB5Hyqc7iOETevfyosXU/xSTe4bCoKjmiBqdxAwG1soOkc M6Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xp4ZqNXV; 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 h69-v6si2706201pfc.121.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=xp4ZqNXV; 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 S1728969AbeIFCj4 (ORCPT + 99 others); Wed, 5 Sep 2018 22:39:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:54876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727586AbeIFCjz (ORCPT ); Wed, 5 Sep 2018 22:39:55 -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 7ECB22083E; Wed, 5 Sep 2018 22:07:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536185263; bh=lkG2+AfvhRmXuzIcgRY7sbVcoCz4DlWH2Yb4lftS7Es=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xp4ZqNXVvTaqBCcmLfw5bcoL5d9Wi8XMXB2jF2Yco+gKbOx6Id+gzXhYsqM+BlfsL FQokYWazeB4aRak8gxy8qwYwWFVryt3Tvt6XLNGTZtoMLUUMN6Z9WaFT223FsiTL4L 60wrbwZoU4yicD6b9dc49ZYF8nVQ1P/NaJCTJBV0= 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 62/77] perf stat: Do not use the global 'evsel_list' in print functions Date: Wed, 5 Sep 2018 19:04:25 -0300 Message-Id: <20180905220440.20256-63-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 the 'evsel_list' global variable dependency, here we can use the 'evlist' pointer from the evsel. 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-38-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-stat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 2f606f76b66a..445673f688de 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -914,6 +914,7 @@ static void print_metric_header(struct perf_stat_config *config, static int first_shadow_cpu(struct perf_stat_config *config, struct perf_evsel *evsel, int id) { + struct perf_evlist *evlist = evsel->evlist; int i; if (!config->aggr_get_id) @@ -928,7 +929,7 @@ static int first_shadow_cpu(struct perf_stat_config *config, for (i = 0; i < perf_evsel__nr_cpus(evsel); i++) { int cpu2 = perf_evsel__cpus(evsel)->map[i]; - if (config->aggr_get_id(config, evsel_list->cpus, cpu2) == id) + if (config->aggr_get_id(config, evlist->cpus, cpu2) == id) return cpu2; } return 0; @@ -1103,7 +1104,7 @@ static void aggr_update_shadow(struct perf_stat_config *config, evlist__for_each_entry(evlist, counter) { val = 0; for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) { - s2 = config->aggr_get_id(config, evsel_list->cpus, cpu); + s2 = config->aggr_get_id(config, evlist->cpus, cpu); if (s2 != id) continue; val += perf_counts(counter->counts, cpu, 0)->val; -- 2.14.4