Skip to content

Commit

Permalink
perf top: Fix sample counting
Browse files Browse the repository at this point in the history
Broken since "5b2bb75 perf top: Support userspace symbols too".

Reported-by: Mike Galbraith <efault@gmx.de>
Tested-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1264086284-1431-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Jan 27, 2010
1 parent abd5071 commit 24bfef0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,8 +934,11 @@ static void event__process_sample(const event_t *self,
struct addr_location al;
u8 origin = self->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;

++samples;

switch (origin) {
case PERF_RECORD_MISC_USER:
++userspace_samples;
if (hide_user_symbols)
return;
break;
Expand All @@ -960,9 +963,6 @@ static void event__process_sample(const event_t *self,
if (list_empty(&syme->node) || !syme->node.next)
__list_insert_active_sym(syme);
pthread_mutex_unlock(&active_symbols_lock);
if (origin == PERF_RECORD_MISC_USER)
++userspace_samples;
++samples;
}
}

Expand Down

0 comments on commit 24bfef0

Please sign in to comment.