aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-08-15 06:06:12 -0400
committerIngo Molnar <mingo@elte.hu>2009-08-15 06:06:12 -0400
commitbe750231ce1599b86fbba213e3da8344ece262e2 (patch)
treea506c461082692bb5bab8b9bb63a762816329454 /tools/perf/util
parent18408ddc01136f505ae357c03f0d8e50b10e0db6 (diff)
parent39e6dd73502f64e2ae3236b304e160ae30de9384 (diff)
Merge branch 'perfcounters/urgent' into perfcounters/core
Conflicts: kernel/perf_counter.c Merge reason: update to latest upstream (-rc6) and resolve the conflict with urgent fixes. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/callchain.c5
-rw-r--r--tools/perf/util/parse-events.c10
-rw-r--r--tools/perf/util/symbol.c17
-rw-r--r--tools/perf/util/symbol.h24
4 files changed, 39 insertions, 17 deletions
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
index a8e67aa9ef49..011473411642 100644
--- a/tools/perf/util/callchain.c
+++ b/tools/perf/util/callchain.c
@@ -13,6 +13,7 @@
13#include <stdio.h> 13#include <stdio.h>
14#include <stdbool.h> 14#include <stdbool.h>
15#include <errno.h> 15#include <errno.h>
16#include <math.h>
16 17
17#include "callchain.h" 18#include "callchain.h"
18 19
@@ -112,7 +113,7 @@ static void __sort_chain_graph_rel(struct callchain_node *node,
112 u64 min_hit; 113 u64 min_hit;
113 114
114 node->rb_root = RB_ROOT; 115 node->rb_root = RB_ROOT;
115 min_hit = node->children_hit * min_percent / 100.0; 116 min_hit = ceil(node->children_hit * min_percent);
116 117
117 chain_for_each_child(child, node) { 118 chain_for_each_child(child, node) {
118 __sort_chain_graph_rel(child, min_percent); 119 __sort_chain_graph_rel(child, min_percent);
@@ -126,7 +127,7 @@ static void
126sort_chain_graph_rel(struct rb_root *rb_root, struct callchain_node *chain_root, 127sort_chain_graph_rel(struct rb_root *rb_root, struct callchain_node *chain_root,
127 u64 min_hit __used, struct callchain_param *param) 128 u64 min_hit __used, struct callchain_param *param)
128{ 129{
129 __sort_chain_graph_rel(chain_root, param->min_percent); 130 __sort_chain_graph_rel(chain_root, param->min_percent / 100.0);
130 rb_root->rb_node = chain_root->rb_root.rb_node; 131 rb_root->rb_node = chain_root->rb_root.rb_node;
131} 132}
132 133
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 4858d83b3b67..044178408783 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -379,6 +379,7 @@ static int parse_tracepoint_event(const char **strp,
379 struct perf_counter_attr *attr) 379 struct perf_counter_attr *attr)
380{ 380{
381 const char *evt_name; 381 const char *evt_name;
382 char *flags;
382 char sys_name[MAX_EVENT_LENGTH]; 383 char sys_name[MAX_EVENT_LENGTH];
383 char id_buf[4]; 384 char id_buf[4];
384 int fd; 385 int fd;
@@ -400,6 +401,15 @@ static int parse_tracepoint_event(const char **strp,
400 strncpy(sys_name, *strp, sys_length); 401 strncpy(sys_name, *strp, sys_length);
401 sys_name[sys_length] = '\0'; 402 sys_name[sys_length] = '\0';
402 evt_name = evt_name + 1; 403 evt_name = evt_name + 1;
404
405 flags = strchr(evt_name, ':');
406 if (flags) {
407 *flags = '\0';
408 flags++;
409 if (!strncmp(flags, "record", strlen(flags)))
410 attr->sample_type |= PERF_SAMPLE_RAW;
411 }
412
403 evt_length = strlen(evt_name); 413 evt_length = strlen(evt_name);
404 if (evt_length >= MAX_EVENT_LENGTH) 414 if (evt_length >= MAX_EVENT_LENGTH)
405 return 0; 415 return 0;
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index e9b13b414955..0b9862351260 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -7,23 +7,8 @@
7#include <gelf.h> 7#include <gelf.h>
8#include <elf.h> 8#include <elf.h>
9 9
10#ifndef NO_DEMANGLE
11#include <bfd.h>
12#else
13static inline
14char *bfd_demangle(void __used *v, const char __used *c, int __used i)
15{
16 return NULL;
17}
18#endif
19
20const char *sym_hist_filter; 10const char *sym_hist_filter;
21 11
22#ifndef DMGL_PARAMS
23#define DMGL_PARAMS (1 << 0) /* Include function args */
24#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
25#endif
26
27enum dso_origin { 12enum dso_origin {
28 DSO__ORIG_KERNEL = 0, 13 DSO__ORIG_KERNEL = 0,
29 DSO__ORIG_JAVA_JIT, 14 DSO__ORIG_JAVA_JIT,
@@ -816,6 +801,8 @@ more:
816 } 801 }
817out: 802out:
818 free(name); 803 free(name);
804 if (ret < 0 && strstr(self->name, " (deleted)") != NULL)
805 return 0;
819 return ret; 806 return ret;
820} 807}
821 808
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 50f723571241..48b8e5759af9 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -8,6 +8,30 @@
8#include "module.h" 8#include "module.h"
9#include "event.h" 9#include "event.h"
10 10
11#ifdef HAVE_CPLUS_DEMANGLE
12extern char *cplus_demangle(const char *, int);
13
14static inline char *bfd_demangle(void __used *v, const char *c, int i)
15{
16 return cplus_demangle(c, i);
17}
18#else
19#ifdef NO_DEMANGLE
20static inline char *bfd_demangle(void __used *v, const char __used *c,
21 int __used i)
22{
23 return NULL;
24}
25#else
26#include <bfd.h>
27#endif
28#endif
29
30#ifndef DMGL_PARAMS
31#define DMGL_PARAMS (1 << 0) /* Include function args */
32#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
33#endif
34
11struct symbol { 35struct symbol {
12 struct rb_node rb_node; 36 struct rb_node rb_node;
13 u64 start; 37 u64 start;