Received: by 10.223.176.5 with SMTP id f5csp999061wra; Wed, 7 Feb 2018 10:54:00 -0800 (PST) X-Google-Smtp-Source: AH8x226UwYNLxaqa80DlgnF66lDcDA3wy8B6E3hTv9SKz/cl+qD3l4+l04WRL+nHHRUd9a4mJuVu X-Received: by 2002:a17:902:1683:: with SMTP id h3-v6mr7042777plh.433.1518029640806; Wed, 07 Feb 2018 10:54:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518029640; cv=none; d=google.com; s=arc-20160816; b=LLNdfPESq8Xrt06h8ddBM0lfouthg4mim3iI7ITG75HVkoOpUzeOKIgNSlU6MUx5wK 9pqPoAm196LhHnDWBJvpf+EHQIz3AUfeNBcke58FYUVnK5K+3jlRVBEMUH8Zrer9O66W r6wE/xZb2YcXzsclfDDnev3TyTUwfyh5KuI+EaiVrtrsfjF1sxTpm3b+kU1wG9lzmsAO i2LAWx112WSv/PtvTM3neIb8ycm41OMMC7Zrq1EkEgnnf9LGccVoDg1bb8X/SwqBg1CM PLu2ozp8j0QB4ODoWB/Nk5wY4RCWDTFHg4XTITcomoejcGZCD25zekzYJnMYtfUe6kum e+aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=e71UwwYAfdm0vUNJ/MeKn3XA2tDjP4nG3uWXvW2hKr8=; b=a6An0SipD0Gck4sYnqHlIsiR1i+YUJYtyngzEv/crN8Za3L7sgrPk4y+gCFRIIdV+s CAzxa7gszYm+cuB5WV+a4EpxlI6IT8/ijA21PdjSjT/bOGD77Bnv2hHRcYwxcvXflzqe cfdZKEL9ml3mB0EBsw//QVSaOWFZXjjsMpAwueNzjLTFTDnmJXXycUTwpZ7jK4EYXePf aBCdltANVuYygKj5QmqDYJRG1A3z3qofYpbrJwmVlY1nZ+lWIuBSVH3mZ23C0igHejoa c+itHQNC44CJOTKWfNFlFJt/E8ltK53plJROS4Cqu167AqCll1Uacp7Ar+5grknj3vmX 8l2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JYsIk/uB; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i6-v6si279233plt.26.2018.02.07.10.53.46; Wed, 07 Feb 2018 10:54:00 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=JYsIk/uB; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754258AbeBGSwi (ORCPT + 99 others); Wed, 7 Feb 2018 13:52:38 -0500 Received: from mail-it0-f68.google.com ([209.85.214.68]:40665 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753390AbeBGSwh (ORCPT ); Wed, 7 Feb 2018 13:52:37 -0500 Received: by mail-it0-f68.google.com with SMTP id 196so3437458iti.5 for ; Wed, 07 Feb 2018 10:52:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=e71UwwYAfdm0vUNJ/MeKn3XA2tDjP4nG3uWXvW2hKr8=; b=JYsIk/uBm03A7Xt0MNTOhCGYgVoc2hnbbwstBB/F7t+fIZB4LGLqEeyFnpmdNFdY9z litmOx0zGeVdUUEH45T99wdy+NMg1Mm3FZRQMwGGLhbuiUiss6nf9oX50KR+VxASsADI Wvs07nOvC8f4lT6lKgqlknGm1JfZRzW0TbG7TeAuGRGHkEPcicBC3YY5oIEIeDfcJ2+J J8oVbeQKgMHYaAnEPbljEOUkOf8kE8JKRJuE3ildQUiDQIIHZjn5pSJAj5L4yyPCjcMy 1VcQCIlkD7ANzl4FKQrvcHG9kTnrbtgHas2jYCEYens/VpT7BXeMdVb0rTNkp/2MvV3g +8IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=e71UwwYAfdm0vUNJ/MeKn3XA2tDjP4nG3uWXvW2hKr8=; b=GnES7rm8BH3ra1FGejdx7jWz+xl5jrsFNlKnYflp72zxAtOQMjzUYBFwdb05hG32Nq VzFzrpvCQqQIOKSkRro8Gj+oSl8ofYs+aUgbSqPz7AsSeXpOLWD0kVixrtdD/PEBUwW9 h+L/zB7cKtQjFvdgJAfDwF7Dm/SCEGd8tnVYZi/1bNehSoHNB3ZsZwqfGgon2VM9O7W8 efvwayP6yroC9ZsoqL+xNYzpegu2bROdnnFoUKWklMb6HMOsaLJXx4ogxa3Uq1VQytIy GARjwjasCd4CxovG7PB1B+cQREn3CQnXn+/DNxB8oGHSh7+HTmRBlLLblfdB9u34AfLE HYCA== X-Gm-Message-State: APf1xPBoQWwN8RhU1mH7ykU3dpeuu/Yhiv+9AqaqXm5K8bwTBmMMgvBc SZf3ojbBvWoTmXVdDHLrQxteiiRu6joWRVSpLEgExw== X-Received: by 10.36.43.20 with SMTP id h20mr7283127ita.42.1518029556250; Wed, 07 Feb 2018 10:52:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.170.39 with HTTP; Wed, 7 Feb 2018 10:52:35 -0800 (PST) In-Reply-To: <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> <20180206093553.GA8065@krava> From: Stephane Eranian Date: Wed, 7 Feb 2018 10:52:35 -0800 Message-ID: Subject: Re: [PATCH 1/3] perf tools: Fix period/freq terms setup To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Jiri Olsa , lkml , Ingo Molnar , Namhyung Kim , David Ahern , Andi Kleen , Alexander Shishkin , Peter Zijlstra Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 6, 2018 at 1:35 AM, Jiri Olsa wrote: > 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 > Works for me. That's great! Thanks. Tested-By: Stephane Eranian > 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; >