Skip to contentSkip to conversation

perf annotate: Move annotate functions to util/

tip:perf/core In review tip-bot for Arnaldo Carvalho de Melo 2 participants 4 messages Feb 7, 2011 – Feb 8, 2011 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  78f7defedbb4da73b9a07635c357c1afcaa55c8f
Gitweb:     http://git.kernel.org/tip/78f7defedbb4da73b9a07635c357c1afcaa55c8f
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Fri, 4 Feb 2011 09:45:46 -0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Sat, 5 Feb 2011 12:28:21 -0200

perf annotate: Move annotate functions to util/

They will be used by perf top, so that we have just one set of routines to do annotation.

Rename "struct sym_priv" to "struct annotation", etc, to clarify this code a bit.

Rename "struct sym_ext" to "struct source_line", to give it a meaningful name, that clarifies that it is a the result of an addr2line call, that is sorted by percentage one particular source code line appeared in the annotation.

And since we're moving things around also rename 'sym_hist->ip' to 'sym_hist->addr' as we want to do data structure annotation at some point.

Cc: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Tom Zanussi <[email protected]>
LKML-Reference: <new-submission>

---
 tools/perf/Makefile                    |    2 +
 tools/perf/builtin-annotate.c          |  255 +-----------------
 tools/perf/builtin-report.c            |    3 +-
 tools/perf/util/annotate.c             |  467 ++++++++++++++++++++++++++++++++
 tools/perf/util/annotate.h             |   65 +++++
 tools/perf/util/hist.c                 |  219 +---------------
 tools/perf/util/hist.h                 |   27 --
 tools/perf/util/ui/browsers/annotate.c |   43 ++--
 8 files changed, 578 insertions(+), 503 deletions(-)
tools/perf/Makefile +2 -0
index 4c9499c..be3eb1d 100644
@@ -401,6 +401,7 @@ LIB_H += util/include/dwarf-regs.h
 LIB_H += util/include/asm/dwarf2.h
 LIB_H += util/include/asm/cpufeature.h
 LIB_H += perf.h
+LIB_H += util/annotate.h
 LIB_H += util/cache.h
 LIB_H += util/callchain.h
 LIB_H += util/build-id.h
@@ -444,6 +445,7 @@ LIB_H += $(ARCH_INCLUDE)
 
 LIB_OBJS += $(OUTPUT)util/abspath.o
 LIB_OBJS += $(OUTPUT)util/alias.o
+LIB_OBJS += $(OUTPUT)util/annotate.o
 LIB_OBJS += $(OUTPUT)util/build-id.o
 LIB_OBJS += $(OUTPUT)util/config.o
 LIB_OBJS += $(OUTPUT)util/ctype.o
tools/perf/builtin-annotate.c +11 -244

299 lines not on this page · raw message

tools/perf/builtin-report.c +2 -1
index 080937c..91e4cdb 100644
@@ -9,6 +9,7 @@
 
 #include "util/util.h"
 
+#include "util/annotate.h"
 #include "util/color.h"
 #include <linux/list.h>
 #include "util/cache.h"
@@ -508,7 +509,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __used)
 	 * implementation.
 	 */
 	if (use_browser > 0) {
-		symbol_conf.priv_size = sizeof(struct sym_priv);
+		symbol_conf.priv_size = sizeof(struct annotation);
 		/*
  		 * For searching by name on the "Browse map details".
  		 * providing it only in verbose mode not to bloat too
tools/perf/util/annotate.c new file +467 -0

467 lines not on this page · raw message

tools/perf/util/annotate.h new file +65 -0

65 lines not on this page · raw message

tools/perf/util/hist.c +5 -214

233 lines not on this page · raw message

tools/perf/util/hist.h +0 -27
index 889559b..8a201f7 100644
@@ -9,33 +9,6 @@ extern struct callchain_param callchain_param;
 struct hist_entry;
 struct addr_location;
 struct symbol;
-struct rb_root;
-
-struct objdump_line {
-	struct list_head node;
-	s64		 offset;
-	char		 *line;
-};
-
-void objdump_line__free(struct objdump_line *self);
-struct objdump_line *objdump__get_next_ip_line(struct list_head *head,
-					       struct objdump_line *pos);
-
-struct sym_hist {
-	u64		sum;
-	u64		ip[0];
-};
-
-struct sym_ext {
-	struct rb_node	node;
-	double		percent;
-	char		*path;
-};
-
-struct sym_priv {
-	struct sym_hist	*hist;
-	struct sym_ext	*ext;
-};
 
 /*
  * The kernel collects the number of events it couldn't send in a stretch and
tools/perf/util/ui/browsers/annotate.c +26 -17

101 lines not on this page · raw message

#1 lore raw

PATCH 1/1 perf annotate: Fix build error

Quoted 8 lines · tip-bot for Arnaldo Carvalho de Melo
Commit-ID:  78f7defedbb4da73b9a07635c357c1afcaa55c8f
Gitweb:     http://git.kernel.org/tip/78f7defedbb4da73b9a07635c357c1afcaa55c8f
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Fri, 4 Feb 2011 09:45:46 -0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Sat, 5 Feb 2011 12:28:21 -0200

perf annotate: Move annotate functions to util/

A small fix for when NO_NEWT_SUPPORT is defined.

--
From: Borislav Petkov <[email protected]>
Date: Mon, 7 Feb 2011 15:26:52 +0100
Subject: [PATCH] perf annotate: Fix build error

Add a missing "struct" to the function prototype.

---
 tools/perf/util/annotate.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/perf/util/annotate.h +1 -1
index b1253aa..bc08b36 100644
@@ -82,7 +82,7 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map, int evidx,
 			 int max_lines);
 
 #ifdef NO_NEWT_SUPPORT
-static inline int symbol__tui_annotate(symbol *sym __used,
+static inline int symbol__tui_annotate(struct symbol *sym __used,
 				       struct map *map __used, int evidx __used)
 {
 	return 0;
Signature · 11 lines
1.7.4.rc1.7.g2cf08

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
#2 lore raw

Re: [PATCH] perf annotate: Fix build error

Em Mon, Feb 07, 2011 at 03:32:18PM +0100, Borislav Petkov escreveu:

Quoted 11 lines · tip-bot for Arnaldo Carvalho de Melo
Quoted 8 lines
Commit-ID:  78f7defedbb4da73b9a07635c357c1afcaa55c8f
Gitweb:     http://git.kernel.org/tip/78f7defedbb4da73b9a07635c357c1afcaa55c8f
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Fri, 4 Feb 2011 09:45:46 -0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Sat, 5 Feb 2011 12:28:21 -0200

perf annotate: Move annotate functions to util/

A small fix for when NO_NEWT_SUPPORT is defined.

Thanks, applying.

- Arnaldo

#3 lore raw

[tip:perf/core] perf annotate: Fix build error

In reply to Borislav Petkov
Commit-ID:  a2221796256ea7b236cec6bf027c1c1de5b8ccd7
Gitweb:     http://git.kernel.org/tip/a2221796256ea7b236cec6bf027c1c1de5b8ccd7
Author:     Borislav Petkov <[email protected]>
AuthorDate: Mon, 7 Feb 2011 15:32:18 +0100
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 7 Feb 2011 12:41:55 -0200

perf annotate: Fix build error

A small fix for when NO_NEWT_SUPPORT is defined.

Add a missing "struct" to the function prototype.

Cc: Frederic Weisbecker <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Tom Zanussi <[email protected]>
LKML-Reference: <[email protected]>

---
 tools/perf/util/annotate.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/perf/util/annotate.h +1 -1
index b1253aa..bc08b36 100644
@@ -82,7 +82,7 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map, int evidx,
 			 int max_lines);
 
 #ifdef NO_NEWT_SUPPORT
-static inline int symbol__tui_annotate(symbol *sym __used,
+static inline int symbol__tui_annotate(struct symbol *sym __used,
 				       struct map *map __used, int evidx __used)
 {
 	return 0;