Skip to contentSkip to conversation

perf annotate: __symbol__acount_cycles doesn't need notes

tip:perf/urgent tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Jun 7, 2018 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  f40dd6d1b4b29208a7232693746575f7ae6365a5
Gitweb:     https://git.kernel.org/tip/f40dd6d1b4b29208a7232693746575f7ae6365a5
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Thu, 24 May 2018 15:20:18 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 4 Jun 2018 10:28:51 -0300

perf annotate: __symbol__acount_cycles doesn't need notes

It only operates on the notes->src->cyc_hist, just pass that to it.

---
 tools/perf/util/annotate.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
tools/perf/util/annotate.c +2 -5
index 0f5ed6091e00..a7221f9fa504 100644
@@ -741,14 +741,11 @@ void symbol__annotate_zero_histograms(struct symbol *sym)
 	pthread_mutex_unlock(&notes->lock);
 }
 
-static int __symbol__account_cycles(struct annotation *notes,
+static int __symbol__account_cycles(struct cyc_hist *ch,
 				    u64 start,
 				    unsigned offset, unsigned cycles,
 				    unsigned have_start)
 {
-	struct cyc_hist *ch;
-
-	ch = notes->src->cycles_hist;
 	/*
 	 * For now we can only account one basic block per
 	 * final jump. But multiple could be overlapping.
@@ -870,7 +867,7 @@ static int symbol__account_cycles(u64 addr, u64 start,
 			start = 0;
 	}
 	offset = addr - sym->start;
-	return __symbol__account_cycles(notes,
+	return __symbol__account_cycles(notes->src->cycles_hist,
 					start ? start - sym->start : 0,
 					offset, cycles,
 					!!start);