Received: by 10.223.176.5 with SMTP id f5csp451815wra; Tue, 6 Feb 2018 01:38:22 -0800 (PST) X-Google-Smtp-Source: AH8x225DULN+twko5v5F8NhmbR+UCLgWViqoz0Jw7gnnGtlQuHauohC+XpBTAsgTMXFvCGCP2G9L X-Received: by 10.99.97.198 with SMTP id v189mr1471128pgb.187.1517909902678; Tue, 06 Feb 2018 01:38:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517909902; cv=none; d=google.com; s=arc-20160816; b=WmtCFuvKk8Fhfzq7NHsc3ZI699pK+GO1Fi/FgCr+bvE9K+DBax+RGhCMQ6S6CRKfXM rOpktbssYe4mOpOQNLOMEfToVP5HuKXYP/LaK3slL+FO8lfqyS4XmKCrCsrTTToDOUXa jK+mhy3ghbHmBbmuceHRHQMIFWAqOIp0OixjmjpVNc1qU93hD+CKIqpoMBRPvgCO7PeJ v/Xh7TAUWiBw7n8p3kJGXNo0hBtwrWVTEzQRCYp6u33TpKSWRB7T38ajXe8h/dRQQpeB BwEuiKBsAUbf4EH5orX4Qzx6aV81TmTbJnJc6KVXndIvg4XqDKj+h8Kw66Yxb1kHE7+x x3lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=ShkgGy8Qq0716s8TvJVWNmmjq1GIywx+OlxXW2FfsHQ=; b=MB8fGMNnhhjzzk3f0tKHqcUU0MpazIIBA8i9p+DDom+wM8B9v2GeklqzyYJl8rOWa2 HSw8JHa6U2ic6i4NDUraLzJJuMVdRxjl/pFiCeXQz7Xml1aHdmReRLRxI34EusTprAcY ALEf0dB9j+OP/QHnkvBYnmnM9Q8NbFpLnYnXkjL64ocSRFhSuHg67+oeBZsaDdwmKdmC IxaAP0ZAfF/CQ+ntpTPvJuVTTssakZ9IZJo89ihNf8E6MTkZbihWoVN5mbmMRn8ceO/b ApdS3PbNTzM8IREYJbpiYF4c+RXy2FWWwqrTv8GvjTnOkrN93AXcQALJmzF5S5N/GCc9 lTgg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12si6604989pgp.327.2018.02.06.01.38.08; Tue, 06 Feb 2018 01:38:22 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752708AbeBFJgG (ORCPT + 99 others); Tue, 6 Feb 2018 04:36:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55004 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752141AbeBFJf5 (ORCPT ); Tue, 6 Feb 2018 04:35:57 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CCBA261470; Tue, 6 Feb 2018 09:35:56 +0000 (UTC) Received: from krava (ovpn-204-175.brq.redhat.com [10.40.204.175]) by smtp.corp.redhat.com (Postfix) with SMTP id 4861360C82; Tue, 6 Feb 2018 09:35:54 +0000 (UTC) Date: Tue, 6 Feb 2018 10:35:53 +0100 From: Jiri Olsa To: Stephane Eranian Cc: Arnaldo Carvalho de Melo , Jiri Olsa , lkml , Ingo Molnar , Namhyung Kim , David Ahern , Andi Kleen , Alexander Shishkin , Peter Zijlstra Subject: Re: [PATCH 1/3] perf tools: Fix period/freq terms setup Message-ID: <20180206093553.GA8065@krava> References: <20180201083812.11359-1-jolsa@kernel.org> <20180201083812.11359-2-jolsa@kernel.org> <20180202202849.GA8297@kernel.org> <20180202204004.GB8297@kernel.org> <20180205151720.GA29340@krava> <20180205211340.GD25353@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 06 Feb 2018 09:35:57 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 05, 2018 at 06:51:05PM -0800, Stephane Eranian wrote: SNIP > > > Looks like this is working then, great! > > Now, related to profiling and reporting. There is still an issue I > keep running into > with grouping. I want to sample on N events, where N > number of hw counters. > Yet I want the same output as perf report --group, i.e., side-by-side > profiles as > opposed to showing me one event profile at a time (which is not very useful). > > You should not require events to belong to the same group to support this. Many > other tools support such output (e.g., VTUNE, Gooda). It is still very > valuable even > though events may not have been measured at the same time. > > Let me use a simple (and silly but portable) example. > Today if I do on Intel x86: > > $ perf record -e branches,branches,branches,branches,branches my_test > > And I do: > > $ perf report --group > It will show me 5 distinct profiles. > > I would like perf to show me a single profile where the 5 events are > side-by-side. > > Similar to what I get if I do instead: > $ perf record -e '{branches,branches,branches,branches}' my_test > $ perf report --group > > But here, I would have to ensure all events fits in a group to allow > the reporting > I want. So that would limit me to 4 events. > > I think perf report --group should work regardless of how the events > were grouped. > Is there already a way to work around this? no workaround.. please try attached patch, it seems to work for what you described thanks, jirka --- diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 4ad5dc649716..35a013992092 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -937,6 +937,7 @@ int cmd_report(int argc, const char **argv) "perf report []", NULL }; + bool group_set = false; struct report report = { .tool = { .sample = process_sample_event, @@ -1056,7 +1057,7 @@ int cmd_report(int argc, const char **argv) "Specify disassembler style (e.g. -M intel for intel syntax)"), OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period, "Show a column with the sum of periods"), - OPT_BOOLEAN(0, "group", &symbol_conf.event_group, + OPT_BOOLEAN_SET(0, "group", &symbol_conf.event_group, &group_set, "Show event group information together"), OPT_CALLBACK_NOOPT('b', "branch-stack", &branch_mode, "", "use branch records for per branch histogram filling", @@ -1173,6 +1174,9 @@ int cmd_report(int argc, const char **argv) has_br_stack = perf_header__has_feat(&session->header, HEADER_BRANCH_STACK); + if (group_set && !session->evlist->nr_groups) + perf_evlist__set_leader(session->evlist); + if (itrace_synth_opts.last_branch) has_br_stack = true;