Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp68914imm; Wed, 5 Sep 2018 15:08:43 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY+7eqTCypwvuGwoX623azqIVC0oq6O0nftmWJ4J9UAE2sixrFDJcmGmDTbtnSu+kbz+gEX X-Received: by 2002:a17:902:7c8c:: with SMTP id y12-v6mr38343662pll.283.1536185323104; Wed, 05 Sep 2018 15:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536185323; cv=none; d=google.com; s=arc-20160816; b=VaYFPEOKPKw2o9+8tV32DP/9J7zhAGOflT8apcbWctONTZLIZ+6+IsnZLTTJVgm1R3 I9XUqcAgG2wm4gDpwerPi0U8mAgpRPo/zqXX7SYKUeIb2fpDV5I4GsjhVKhFQBTVgEYQ 1UaGEYUkINmprqiOto7KF9Nr2MePRaoWphdF/fU0TesRBYWufw4cgyaVg/YWOZ1wZgj8 eiCG44k1FRcDOs9ls7yo4AyRJHiQGNbqbRY1ZcIE/xxA4p37ns870RPA/rrHYT71oSQ4 +l2dfLIWpB+dV8hZLL3XrkmLi4XCt5rSSqCI5mZ0pmVlyXsn8qPnB9retOeXL+V9qsF+ zCKg== 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=tCfh8XflznV7BR367fxQ4Wk3bxLEiEFWpG//+zmwRuM=; b=apuj7o2WGoufwc4herxQyD5PtP436uxK6Oxv8Hll0QXqAG0qVYp+Zny6cMcsy+W1Bk XRX4ZcYLj9W8X5VxupJXiYorSZVzkFWarwjUWSR/ubl5jXBPz9okyRcWXiAwxWHaxvGj YZFO41DFh+8onsdG7L4c3RF2JxKDh3biqbQTSwWq3WTSZ+QVaRhJp7SDTseuihmdA1GD ERA5E0g98dNK+n6JC321E97T3+ZZtaV0NV/FCI4aczd5nzpUE13/jq2L48a7x6QN9ld1 bo4w3bDR+mXdxxZixj+X7wh1AGCET93JiB+APaGO0DWgdYNCbEbozkk6LDpjRvYvB7Rs us1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RQ28eVJy; 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.08.27; Wed, 05 Sep 2018 15:08:43 -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=RQ28eVJy; 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 S1728636AbeIFCir (ORCPT + 99 others); Wed, 5 Sep 2018 22:38:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:53368 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727626AbeIFCiq (ORCPT ); Wed, 5 Sep 2018 22:38:46 -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 E77D12083E; Wed, 5 Sep 2018 22:06:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536185195; bh=aYgHTeDSBomLwYEsznrOhN/jS06KPzVDtbyycnfQvTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RQ28eVJy57561v0JgH3o2M3OfnWR41o6vO3ITOhsTw4KAvoFlTwCVR+TE9ZLlfjsH bxNEQO/L8rh7dA6MoE36DERcWuPvpTpDcCq4sBdAOJRmln+7LW2h3AiaXzxNxDJfql gni3h05imT5q2zALfoykKul/e1fi7v5L+68WBo+0= 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 38/77] perf stat: Add 'perf_event__handler_t' argument to perf_stat_synthesize_config() Date: Wed, 5 Sep 2018 19:04:01 -0300 Message-Id: <20180905220440.20256-39-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 it's completely independent and can be 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-14-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-stat.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index cb36344c25b7..1171d4e00276 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -405,40 +405,37 @@ 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, + perf_event__handler_t process, bool attrs) { int err; if (attrs) { - err = perf_event__synthesize_attrs(tool, evlist, - process_synthesized_event); + err = perf_event__synthesize_attrs(tool, evlist, process); if (err < 0) { pr_err("Couldn't synthesize attrs.\n"); return err; } } - err = perf_event__synthesize_extra_attr(tool, evlist, - process_synthesized_event, + err = perf_event__synthesize_extra_attr(tool, evlist, process, attrs); err = perf_event__synthesize_thread_map2(tool, evlist->threads, - process_synthesized_event, - NULL); + process, NULL); if (err < 0) { pr_err("Couldn't synthesize thread map.\n"); return err; } err = perf_event__synthesize_cpu_map(tool, evlist->cpus, - process_synthesized_event, NULL); + process, NULL); if (err < 0) { pr_err("Couldn't synthesize thread map.\n"); return err; } - err = perf_event__synthesize_stat_config(tool, config, - process_synthesized_event, NULL); + err = perf_event__synthesize_stat_config(tool, config, process, NULL); if (err < 0) { pr_err("Couldn't synthesize config.\n"); return err; @@ -609,7 +606,7 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx) return err; err = perf_stat_synthesize_config(&stat_config, NULL, evsel_list, - is_pipe); + process_synthesized_event, is_pipe); if (err < 0) return err; } -- 2.14.4