Skip to contentSkip to conversation

perf ui: Add search by name/addr to the map__browser

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Aug 6, 2010 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  80d50cae1b9cc958171c36fffc7357a5abad808c
Gitweb:     http://git.kernel.org/tip/80d50cae1b9cc958171c36fffc7357a5abad808c
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Thu, 5 Aug 2010 19:28:27 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 5 Aug 2010 19:38:02 -0300

perf ui: Add search by name/addr to the map__browser

Only in verbose mode so as not to bloat struct symbol too much.

The key used is '/', just like in vi, less, etc.

More work is needed to allocate space on the symbol in a more clear way.

This experiment shows how to do it for the hist_browser, in the main window.

Cc: Frederic Weisbecker <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Srikar Dronamraju <[email protected]>
Cc: Stephane Eranian <[email protected]>
LKML-Reference: <new-submission>

---
 tools/perf/builtin-report.c |   18 +++++++-
 tools/perf/util/newt.c      |  109 +++++++++++++++++++++++++++++++++++++++----
 2 files changed, 117 insertions(+), 10 deletions(-)
tools/perf/builtin-report.c +17 -1
index 2f4b929..4a7a743 100644
@@ -478,8 +478,24 @@ int cmd_report(int argc, const char **argv, const char *prefix __used)
 	 * so don't allocate extra space that won't be used in the stdio
 	 * implementation.
 	 */
-	if (use_browser > 0)
+	if (use_browser > 0) {
 		symbol_conf.priv_size = sizeof(struct sym_priv);
+		/*
+ 		 * For searching by name on the "Browse map details".
+ 		 * providing it only in verbose mode not to bloat too
+ 		 * much struct symbol.
+ 		 */
+		if (verbose) {
+			/*
+			 * XXX: Need to provide a less kludgy way to ask for
+			 * more space per symbol, the u32 is for the index on
+			 * the ui browser.
+			 * See symbol__browser_index.
+			 */
+			symbol_conf.priv_size += sizeof(u32);
+			symbol_conf.sort_by_name = true;
+		}
+	}
 
 	if (symbol__init() < 0)
 		return -1;
tools/perf/util/newt.c +100 -9

143 lines not on this page · raw message