From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946363AbdKRIak (ORCPT ); Sat, 18 Nov 2017 03:30:40 -0500 Received: from terminus.zytor.com ([65.50.211.136]:55697 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946335AbdKRIaV (ORCPT ); Sat, 18 Nov 2017 03:30:21 -0500 Date: Sat, 18 Nov 2017 00:29:11 -0800 From: tip-bot for Andi Kleen Message-ID: Cc: linux-kernel@vger.kernel.org, acme@redhat.com, tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org, ak@linux.intel.com, jolsa@kernel.org Reply-To: mingo@kernel.org, hpa@zytor.com, acme@redhat.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, ak@linux.intel.com, jolsa@kernel.org In-Reply-To: <20171109145528.23371-4-andi@firstfloor.org> References: <20171109145528.23371-4-andi@firstfloor.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf script: Allow printing period for non freq mode groups Git-Commit-ID: 5039c8a28fa97b8dce7b363a5ecd4bee2b87bf03 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 5039c8a28fa97b8dce7b363a5ecd4bee2b87bf03 Gitweb: https://git.kernel.org/tip/5039c8a28fa97b8dce7b363a5ecd4bee2b87bf03 Author: Andi Kleen AuthorDate: Thu, 9 Nov 2017 06:55:26 -0800 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 16 Nov 2017 14:49:55 -0300 perf script: Allow printing period for non freq mode groups When using leader sampling the values of the not sampled but counted events are shown by perf script in "period". Currently printing period is only allowed when the main event has a period, that is it is in frequency mode. This implies that we cannot dump the values of counted events when the leader event is not in frequency mode. Just remove the check that the period must be set on all events. It will just be printed as 0 instead if it's not available. This fixes the following: $ perf record -c 100000 -e '{cycles,branches}:S' $ perf script -F event,period Further commentary by Jiri Olsa: The period will be the value of configured period, not 0: int perf_evsel__parse_sample(struct ... ... data->period = evsel->attr.sample_period; $ perf record -c 100000 $ perf script -F event,period | head -3 Failed to open /tmp/perf-2048.map, continuing without symbols 100000 cycles:ppp: 100000 cycles:ppp: other than that I think we can remove that check, because we will have always sane number in period Signed-off-by: Andi Kleen Acked-by: Jiri Olsa Link: http://lkml.kernel.org/r/20171109145528.23371-4-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-script.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 9b43bda..ee7c7aa 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -423,11 +423,6 @@ static int perf_evsel__check_attr(struct perf_evsel *evsel, PERF_OUTPUT_CPU, allow_user_set)) return -EINVAL; - if (PRINT_FIELD(PERIOD) && - perf_evsel__check_stype(evsel, PERF_SAMPLE_PERIOD, "PERIOD", - PERF_OUTPUT_PERIOD)) - return -EINVAL; - if (PRINT_FIELD(IREGS) && perf_evsel__check_stype(evsel, PERF_SAMPLE_REGS_INTR, "IREGS", PERF_OUTPUT_IREGS))