aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-annotate.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-05-09 12:02:23 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-05-09 12:10:39 -0400
commit28e2a106d16046ca792722795f809e3f80a5af80 (patch)
treec84149ddf45d02044187fe4511cead93d009b6ee /tools/perf/builtin-annotate.c
parent39d1e1b1e26dc84d40bf2792287d0d61e44b57df (diff)
perf hist: Simplify the insertion of new hist_entry instances
And with that fix at least one bug: The first hit for an entry, the one that calls malloc to create a new instance in __perf_session__add_hist_entry, wasn't adding the count to the per cpumode (PERF_RECORD_MISC_USER, etc) total variable. Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index ee154b58772b..c7ac45a59ed5 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -72,8 +72,6 @@ static int annotate__hist_hit(struct hist_entry *he, u64 ip)
72 struct sym_priv *priv; 72 struct sym_priv *priv;
73 struct sym_hist *h; 73 struct sym_hist *h;
74 74
75 he->count++;
76
77 if (!sym || !he->ms.map) 75 if (!sym || !he->ms.map)
78 return 0; 76 return 0;
79 77
@@ -99,9 +97,8 @@ static int annotate__hist_hit(struct hist_entry *he, u64 ip)
99} 97}
100 98
101static int perf_session__add_hist_entry(struct perf_session *self, 99static int perf_session__add_hist_entry(struct perf_session *self,
102 struct addr_location *al, u64 count) 100 struct addr_location *al)
103{ 101{
104 bool hit;
105 struct hist_entry *he; 102 struct hist_entry *he;
106 103
107 if (sym_hist_filter != NULL && 104 if (sym_hist_filter != NULL &&
@@ -115,7 +112,7 @@ static int perf_session__add_hist_entry(struct perf_session *self,
115 return 0; 112 return 0;
116 } 113 }
117 114
118 he = __perf_session__add_hist_entry(&self->hists, al, NULL, count, &hit); 115 he = __perf_session__add_hist_entry(&self->hists, al, NULL, 1);
119 if (he == NULL) 116 if (he == NULL)
120 return -ENOMEM; 117 return -ENOMEM;
121 118
@@ -135,7 +132,7 @@ static int process_sample_event(event_t *event, struct perf_session *session)
135 return -1; 132 return -1;
136 } 133 }
137 134
138 if (!al.filtered && perf_session__add_hist_entry(session, &al, 1)) { 135 if (!al.filtered && perf_session__add_hist_entry(session, &al)) {
139 pr_warning("problem incrementing symbol count, " 136 pr_warning("problem incrementing symbol count, "
140 "skipping event\n"); 137 "skipping event\n");
141 return -1; 138 return -1;