From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936248AbdKQVnK (ORCPT ); Fri, 17 Nov 2017 16:43:10 -0500 Received: from mga05.intel.com ([192.55.52.43]:5258 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936219AbdKQVnC (ORCPT ); Fri, 17 Nov 2017 16:43:02 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,411,1505804400"; d="scan'208";a="1245414198" From: Andi Kleen To: acme@kernel.org Cc: jolsa@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: [PATCH v3 2/3] perf, tools, record: Synthesize thread map and cpu map Date: Fri, 17 Nov 2017 13:42:59 -0800 Message-Id: <20171117214300.32746-3-andi@firstfloor.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171117214300.32746-1-andi@firstfloor.org> References: <20171117214300.32746-1-andi@firstfloor.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andi Kleen Synthesize the per attr thread maps and cpu maps in perf record. This allows code from perf stat called from perf script to access this information. Signed-off-by: Andi Kleen --- tools/perf/builtin-record.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index b92d6d67bca8..e304bc47fe9b 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -793,6 +793,21 @@ static int record__synthesize(struct record *rec, bool tail) if (err) goto out; + err = perf_event__synthesize_thread_map2(&rec->tool, rec->evlist->threads, + process_synthesized_event, + NULL); + if (err < 0) { + pr_err("Couldn't synthesize thread map.\n"); + return err; + } + + err = perf_event__synthesize_cpu_map(&rec->tool, rec->evlist->cpus, + process_synthesized_event, NULL); + if (err < 0) { + pr_err("Couldn't synthesize cpu map.\n"); + return err; + } + err = __machine__synthesize_threads(machine, tool, &opts->target, rec->evlist->threads, process_synthesized_event, opts->sample_address, opts->proc_map_timeout, 1); -- 2.13.6