Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752482AbbKIFpw (ORCPT ); Mon, 9 Nov 2015 00:45:52 -0500 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:52737 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750798AbbKIFpt (ORCPT ); Mon, 9 Nov 2015 00:45:49 -0500 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: namhyung@kernel.org X-Original-SENDERIP: 10.177.227.17 X-Original-MAILFROM: namhyung@kernel.org From: Namhyung Kim To: Arnaldo Carvalho de Melo Cc: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , Brendan Gregg , David Ahern , Frederic Weisbecker , Andi Kleen , Kan Liang Subject: [PATCHSET 0/9] perf report: Support folded callchain output (v5) Date: Mon, 9 Nov 2015 14:45:36 +0900 Message-Id: <1447047946-1691-1-git-send-email-namhyung@kernel.org> X-Mailer: git-send-email 2.6.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4227 Lines: 127 Hello, This is what Brendan requested on the perf-users mailing list [1] to support FlameGraphs [2] more efficiently. This patchset adds a few more callchain options to adjust the output for it. * changes in v5) - honor field separator from -t option - add support for TUI and GTK * changes in v4) - add missing doc update - cleanup/fix callchain value print code - add Acked-by from Brendan and Jiri * changes in v3) - put the value before callchains - fix compile error At first, 'folded' output mode was added. The folded output puts the value, a space and all calchain nodes separated by semicolons. Now it only supports --stdio as other UI provides some way of folding and/or expanding callchains dynamically. The value is now can be one of 'percent', 'period', or 'count'. The percent is current default output and the period is the raw number of sample periods. The count is the number of samples for each callchain. The proposed features of hiding hist lines with '-F none' and showing hist info with callchains can be added as later work. Here's an example: $ perf report --no-children --show-nr-samples --stdio -g folded,count ... 39.93% 80 swapper [kernel.vmlinux] [k] intel_idel 57 intel_idle;cpuidle_enter_state;cpuidle_enter;call_cpuidle;cpu_startup_entry;start_secondary 23 intel_idle;cpuidle_enter_state;cpuidle_enter;call_cpuidle;cpu_startup_entry;rest_init;... $ perf report --no-children --stdio -g percent ... 39.93% swapper [kernel.vmlinux] [k] intel_idel | ---intel_idle cpuidle_enter_state cpuidle_enter call_cpuidle cpu_startup_entry | |--28.63%-- start_secondary | --11.30%-- rest_init $ perf report --no-children --stdio --show-total-period -g period ... 39.93% 13018705 swapper [kernel.vmlinux] [k] intel_idel | ---intel_idle cpuidle_enter_state cpuidle_enter call_cpuidle cpu_startup_entry | |--9334403-- start_secondary | --3684302-- rest_init $ perf report --no-children --stdio --show-nr-samples -g count ... 39.93% 80 swapper [kernel.vmlinux] [k] intel_idel | ---intel_idle cpuidle_enter_state cpuidle_enter call_cpuidle cpu_startup_entry | |--57-- start_secondary | --23-- rest_init You can get it from 'perf/callchain-fold-v5' branch on my tree: git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git Any comments are welcome, thanks Namhyung [1] http://www.spinics.net/lists/linux-perf-users/msg02498.html [2] http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html Namhyung Kim (9): perf report: Support folded callchain mode on --stdio perf callchain: Abstract callchain print function perf callchain: Add count fields to struct callchain_node perf report: Add callchain value option perf hists browser: Factor out hist_browser__show_callchain_list() perf hists browser: Support flat callchains perf hists browser: Support folded callchains perf ui/gtk: Support flat callchains perf ui/gtk: Support folded callchains tools/perf/Documentation/perf-report.txt | 14 +- tools/perf/builtin-report.c | 4 +- tools/perf/ui/browsers/hists.c | 316 ++++++++++++++++++++++++++++--- tools/perf/ui/gtk/hists.c | 148 ++++++++++++++- tools/perf/ui/stdio/hist.c | 94 +++++++-- tools/perf/util/callchain.c | 135 ++++++++++++- tools/perf/util/callchain.h | 28 ++- tools/perf/util/util.c | 3 +- 8 files changed, 679 insertions(+), 63 deletions(-) -- 2.6.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/