Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp68881imm; Wed, 5 Sep 2018 15:08:41 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbH6kifqRVHSEjBKTEl/Ix+P+ogTh2YwMHAsFYbBOn6FUsliO0QIV3nGD9jNkA/rua/+sWS X-Received: by 2002:a63:41c4:: with SMTP id o187-v6mr31199647pga.297.1536185321121; Wed, 05 Sep 2018 15:08:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536185321; cv=none; d=google.com; s=arc-20160816; b=Ptnw4kwQg7d47GNRWdwKD/FQ137Tmv2SRoxB1gYdyvS5eDiSwMRMMc2THNN1ZlDyWV HmrWkLpBCleGOPhLWGwinqJAa8nMmEMYgywoOXGrYY8/i7fUIzm6ZSXXTt11IORk7B8I 9rECs/VuR27wWnICcuoJSDkv8ErqIJZSwefa6xr5xlObCbGfJH/MmUjOvZ5UAzbQ1cVY rRM3GvneOtt9qdHZWqc9FgxongygFwasVaeM+17OndE6XwnQ+Vt+QSR8AI1LWM5dRlqi WxjOJ9Akgh/7J+0E1IPxmZyyzs70u0x5kQbl5kjK2BdAE5QMzr3ZyMt+Zt9fp3tim65j P1TQ== 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=Hwi6WkKu+VhTTSAG4mm1ZsUZ2rdU4mn7v9c6uCGeVWw=; b=V1FullrylIQO9s1PUixyefBcZl/YhqtwstxnS4Bf91zZ5SKjUgeEUnTNEMUuXvoPER luKZCdVdBIMuHrNgOuc3vJdP5Iq7/VC1VOGoWbHaqkKwelwiB1Ne04M763L7PKKmOZti /1ms+g6xyWftvA0E0QlEt0PCGx4K2GiMu1I0PoSotcyOhB2ReBvzco93Xd9ZUlnmUJy1 W0tMskaDJsvpY8qEmJpImVlMAf9rEliIgvOAbUsxWYVIsgfOHtQosxIsOELMbaJj3W1d xUuW+bsy5Kql/MEI7+95pe22L3D3MUu9X7HAMvEGl9NWCGqOOb14fljkMC/tr4Ks64JI ot8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y7Y4F3dB; 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.08.25; Wed, 05 Sep 2018 15:08:41 -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=Y7Y4F3dB; 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 S1728606AbeIFCim (ORCPT + 99 others); Wed, 5 Sep 2018 22:38:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:53262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727626AbeIFCim (ORCPT ); Wed, 5 Sep 2018 22:38:42 -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 85BAF20869; Wed, 5 Sep 2018 22:06:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536185189; bh=nVQbwaijgupcxQFeaceVuXHUsBxqyPb3P8sSmv+rj7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y7Y4F3dBSQ40XVyJ5RjFEglRUsSuvdtRIGdGm8d/2jFz/dFB8UPeBOFxL3pmXtz07 K2IwzbI+L269MwZoNgxZpmpHO7jhUYYMnB9zPew1k1s4PjhNteZzHqLN3Y1Oe/Zn5V Qoc850/bOIdRF85cWD6qGTQl8Yi98ZjT1YL/G/Vw= 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 36/77] perf stat: Add 'struct perf_tool' argument to perf_stat_synthesize_config() Date: Wed, 5 Sep 2018 19:03:59 -0300 Message-Id: <20180905220440.20256-37-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 So that we can use the function outside the 'perf stat' command with standard synthesize functions, that take 'struct perf_tool *' argument. 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-12-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 d0d19a5ffa85..ae5029875e87 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -403,12 +403,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, bool attrs) { int err; if (attrs) { - err = perf_event__synthesize_attrs(NULL, evsel_list, + err = perf_event__synthesize_attrs(tool, evsel_list, process_synthesized_event); if (err < 0) { pr_err("Couldn't synthesize attrs.\n"); @@ -416,12 +417,12 @@ static int perf_stat_synthesize_config(struct perf_stat_config *config, } } - err = perf_event__synthesize_extra_attr(NULL, + err = perf_event__synthesize_extra_attr(tool, evsel_list, process_synthesized_event, attrs); - err = perf_event__synthesize_thread_map2(NULL, evsel_list->threads, + err = perf_event__synthesize_thread_map2(tool, evsel_list->threads, process_synthesized_event, NULL); if (err < 0) { @@ -429,14 +430,14 @@ static int perf_stat_synthesize_config(struct perf_stat_config *config, return err; } - err = perf_event__synthesize_cpu_map(NULL, evsel_list->cpus, + err = perf_event__synthesize_cpu_map(tool, evsel_list->cpus, process_synthesized_event, NULL); if (err < 0) { pr_err("Couldn't synthesize thread map.\n"); return err; } - err = perf_event__synthesize_stat_config(NULL, config, + err = perf_event__synthesize_stat_config(tool, config, process_synthesized_event, NULL); if (err < 0) { pr_err("Couldn't synthesize config.\n"); @@ -607,7 +608,7 @@ 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, is_pipe); + err = perf_stat_synthesize_config(&stat_config, NULL, is_pipe); if (err < 0) return err; } -- 2.14.4