Received: by 10.223.176.5 with SMTP id f5csp999225wra; Fri, 9 Feb 2018 10:38:09 -0800 (PST) X-Google-Smtp-Source: AH8x225D0C23/49nzZLJK/kQ/OdhTRKm/DzeP8wU2j5J6R94gEvblr6dpitVbAtTnXvqjE06Zm44 X-Received: by 10.99.112.81 with SMTP id a17mr2994725pgn.151.1518201489172; Fri, 09 Feb 2018 10:38:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518201489; cv=none; d=google.com; s=arc-20160816; b=dBs/xzYTJ/LIgueZvnvIIQZERW/oeAczEriilKWTnLFEO/lMsh1P40w9XRkSorwmMR eJjMoCEvNmAvQaSGdBkcEGPF9j/iqSFtEl37htak77z9coydvHvcAOr9E6vPaXnbiKZy j/SDSgXKstPpFTqdcMpBC8CQnmfEnKM3SYGrpmORIEkR2thEd2jQqla02XrsBKHHDtMt 2kZbI/3WBWkFwxxGr9UmEkGqGzcCrTYnoQinuz2lIy2hb/TrJwG1QLvTWixtEVnPTmTe WEeMui34Y0gRQyH+TqSz0vGiXGdPspdvYhkaghJ8ml8cxC9Vn/0HemWAQFPWi+cbqfZc 9njQ== 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:dmarc-filter:arc-authentication-results; bh=7IuXumDCrQK2Y3SXaurgRN/aKl4RntwPmqSkMPS4NlI=; b=PCQIi/cAPj+7jMKd0zkFp/X9AQT9Yt2w6sk3Acs2DIgYpjpdlrff0oOM4Vake6BLOD 0uLKOMaPz5wBARrAqYO+ztCu7kIT68RPjnD6oxZpeKsa7x1GTvgoM5nAYswSHe1XYWK2 6llJH5XmZVTO6dfPj748Ducfq/l827T2dZ90U+1q4pXSSSINMPIZUVhtujJlLXAjAbYm YKRHwMW4HNuSunFTwUow/TObssOYe0GIK8gUdyEyk2s15NNd2J6NCh/jEuV7Luj5x2OP ZKGPaWhnAZnNnur8xiG7MgBWdSUGNyJofSr0R9pCL9YGAnkHZ26KvYsJe1A/XDQMlj8m SxPA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6-v6si990786plo.489.2018.02.09.10.37.54; Fri, 09 Feb 2018 10:38:09 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752159AbeBIShP (ORCPT + 99 others); Fri, 9 Feb 2018 13:37:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:41648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751004AbeBIShO (ORCPT ); Fri, 9 Feb 2018 13:37:14 -0500 Received: from jouet.infradead.org (unknown [190.15.121.82]) (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 7056C2173B; Fri, 9 Feb 2018 18:37:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7056C2173B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Received: by jouet.infradead.org (Postfix, from userid 1000) id 45BDB144FC4; Fri, 9 Feb 2018 15:37:11 -0300 (-03) Date: Fri, 9 Feb 2018 15:37:11 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: Stephane Eranian , Jiri Olsa , lkml , Ingo Molnar , Namhyung Kim , David Ahern , Andi Kleen , Alexander Shishkin , Peter Zijlstra Subject: Re: [PATCH] perf report: Add support to display group output for non group events Message-ID: <20180209183711.GN3451@kernel.org> References: <20180202202849.GA8297@kernel.org> <20180202204004.GB8297@kernel.org> <20180205151720.GA29340@krava> <20180205211340.GD25353@kernel.org> <20180206093553.GA8065@krava> <20180209092734.GB20449@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180209092734.GB20449@krava> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Feb 09, 2018 at 10:27:34AM +0100, Jiri Olsa escreveu: > On Wed, Feb 07, 2018 at 10:52:35AM -0800, Stephane Eranian wrote: > > SNIP > > > >> 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 > > > > > Works for me. That's great! > > Thanks. > > > > Tested-By: Stephane Eranian > > thanks, full patch attached > > jirka Humm, its a nice hack, but it would be even better if it didn't showed it as if it was really a group: Samples: 20 of event 'anon group { cycles, instructions }', Event count (approx.): 4712980 It would be better to instead add another condition to the evlist that would trigger the view with all the examples... I'm applying it anyway, as it is useful, but would be nice to have the same output except for that header, that should read instead: Samples: 20 of non grouped events: cycles, instructions, Event count (approx.): 4712980 - Arnaldo > > --- > Add support to display group output for if non grouped events > are detected and user forces --group option. Now for non-group > events recorded like: > > $ perf record -e 'cycles,instructions' ls > > you can still get group output by using --group option > in report: > > $ perf report --group --stdio > ... > # Overhead Command Shared Object Symbol > # ................ ....... ................ ...................... > # > 17.67% 0.00% ls libc-2.25.so [.] _IO_do_write@@GLIB > 15.59% 25.94% ls ls [.] calculate_columns > 15.41% 31.35% ls libc-2.25.so [.] __strcoll_l > ... > > Requested-and-Tested-by: Stephane Eranian > Link: http://lkml.kernel.org/n/tip-m1ffikw8c3a55b3uaxrmk5w3@git.kernel.org > Signed-off-by: Jiri Olsa > --- > tools/perf/Documentation/perf-report.txt | 3 ++- > tools/perf/builtin-report.c | 6 +++++- > 2 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt > index 907e505b6309..a76b871f78a6 100644 > --- a/tools/perf/Documentation/perf-report.txt > +++ b/tools/perf/Documentation/perf-report.txt > @@ -354,7 +354,8 @@ OPTIONS > Path to objdump binary. > > --group:: > - Show event group information together. > + Show event group information together. It forces group output also > + if there are no groups defined in data file. > > --demangle:: > Demangle symbol names to human readable form. It's enabled by default, > diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c > index 8ef71669e7a0..1eedb1815c4c 100644 > --- a/tools/perf/builtin-report.c > +++ b/tools/perf/builtin-report.c > @@ -938,6 +938,7 @@ int cmd_report(int argc, const char **argv) > "perf report []", > NULL > }; > + bool group_set = false; > struct report report = { > .tool = { > .sample = process_sample_event, > @@ -1057,7 +1058,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", > @@ -1174,6 +1175,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; > > -- > 2.13.6