Received: by 10.223.185.116 with SMTP id b49csp1704721wrg; Sat, 17 Feb 2018 03:35:31 -0800 (PST) X-Google-Smtp-Source: AH8x224/nUVnORdLPPOwU+WqmLh+iLTVxRf366QBjpXkrQ5wmAV1PvbjdABlG4QHumS6Gnvz6BVl X-Received: by 2002:a17:902:7808:: with SMTP id p8-v6mr8788865pll.161.1518867331373; Sat, 17 Feb 2018 03:35:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518867331; cv=none; d=google.com; s=arc-20160816; b=j4DLt+YRlKjYh6eU7YXJJAblQwsRCXHBludyawqncOxBQdU1/3hJkfd9mD8ZbjTapt TQ+BTAMjIWB4JbcFa50oJw/kxp+NK44E6vG5moMP1X3fU4PPJO8U1J4AO3ctWFeuldL6 5iMW50XCARLmE2YpjQriwKf9JiT+pU1/QdqC646LCnEXSqVfv0aaRaWx0RQ/0XJc3gzI sv5loxQ14L+QGsJhg1dKNvwaKfTamb2KjgXAH1pjziLtXuZ8JGFQL12tYESSB/rYAFee nr+v/anzKtsvOz1/gx4Ugx/CfgkeWLTHA5H1zg5qEBiJqV/2lgZp2TRNX38CSsbFbP1Z KQOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=5p9qPuXt3UbP/+jIStMMpnXAfnweeXeQYbp/045PQEc=; b=aM6SBdUoxdsTF96VtNequ9d71cd2pFqM1WXZPK3HfDl0N5kEnlC2TYSVPEBoaXZAAD kemuSSl5qjhbvV7OdNilApa0adfvjlhrA5cYiqqNBu7TP1MOwN+ATBdkq+aV9QBQESd+ eVA97u2Lw0eZwo5P14O0NvLLQRU0wTsoeDqObNYPkc+0Y9U7JJR70DYVgYTac+PZR7ab UxoK/J+M9Nx6IpfkXvEfi76RnwRqvJywHRUu8ZyqTCODiCQHnSj9iErs3irmelRQctyF zMUlt3eUkIK/nD2z0l7ZIIFBvawL04Bmazra75+wREpeB0W9xOKuGjD90zwV1QShtN0T yKzg== 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 n13si2441813pgq.674.2018.02.17.03.35.17; Sat, 17 Feb 2018 03:35:31 -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 S1751297AbeBQLdZ (ORCPT + 99 others); Sat, 17 Feb 2018 06:33:25 -0500 Received: from terminus.zytor.com ([198.137.202.136]:42563 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751021AbeBQLdY (ORCPT ); Sat, 17 Feb 2018 06:33:24 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w1HBN4hW003303; Sat, 17 Feb 2018 03:23:04 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w1HBN3Ew003299; Sat, 17 Feb 2018 03:23:03 -0800 Date: Sat, 17 Feb 2018 03:23:03 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Jiri Olsa Message-ID: Cc: namhyung@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, mingo@kernel.org, peterz@infradead.org, ak@linux.intel.com, dsahern@gmail.com, eranian@google.com, alexander.shishkin@linux.intel.com, acme@redhat.com, tglx@linutronix.de, hpa@zytor.com, jolsa@redhat.com Reply-To: ak@linux.intel.com, dsahern@gmail.com, peterz@infradead.org, mingo@kernel.org, jolsa@redhat.com, hpa@zytor.com, tglx@linutronix.de, acme@redhat.com, eranian@google.com, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, jolsa@kernel.org, namhyung@kernel.org In-Reply-To: <20180209092734.GB20449@krava> References: <20180209092734.GB20449@krava> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf report: Add support to display group output for non group events Git-Commit-ID: ad52b8cb4886f572b147b02f4c59a648bbf05f9c 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 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: ad52b8cb4886f572b147b02f4c59a648bbf05f9c Gitweb: https://git.kernel.org/tip/ad52b8cb4886f572b147b02f4c59a648bbf05f9c Author: Jiri Olsa AuthorDate: Fri, 9 Feb 2018 10:27:34 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 16 Feb 2018 10:09:24 -0300 perf report: Add support to display group output for non group events 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 ... Committer note: We should improve on this by making sure that the first line states that this is not a group, but since the user doesn't have to force group view when really using grouped events (e.g. '{cycles,instructions}'), the user better know what is being done... Requested-by: Stephane Eranian Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Tested-by: Stephane Eranian Cc: Alexander Shishkin Cc: Andi Kleen Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180209092734.GB20449@krava Signed-off-by: Arnaldo Carvalho de Melo --- 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 907e505..a76b871 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 8ef7166..1eedb18 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 @@ repeat: 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;