diff options
author | Søren Sandmann Pedersen <sandmann@daimi.au.dk> | 2009-10-21 12:28:43 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <sandmann@daimi.au.dk> | 2009-10-21 12:28:43 -0400 |
commit | ecb15e0b7fc6c695ced6bdac4444e014686b16d8 (patch) | |
tree | d6c1fb36762bdf11cb1cc0170895f88e0b943145 | |
parent | 393a26dad67c7a08a3e234f46c6f1c6b072286fe (diff) |
Show the "-- kernel --" marker in kernel threads
The innermost context is normally user mode, so we don't show. For
kernel threads, the innermost context is the kernel, so don't filter
it out.
-rw-r--r-- | tracker.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -932,7 +932,7 @@ process_sample (state_t *state, StackStash *resolved, sample_t *sample) return; } - len = 4; + len = 5; for (n = sample->trace; n != NULL; n = n->parent) len++; @@ -969,6 +969,17 @@ process_sample (state_t *state, StackStash *resolved, sample_t *sample) resolved_traces[len++] = POINTER_TO_U64 (symbol); } + if (context && context->context != PERF_CONTEXT_USER) + { + /* Kernel threads do not have a user part, so we end up here + * without ever getting a user context. If this happens, + * add the '- - kernel - - ' name, so that kernel threads + * are properly blamed on the kernel + */ + resolved_traces[len++] = + POINTER_TO_U64 (unique_dup (state->unique_symbols, context->name)); + } + cmdline = make_message (state, "[%s]", process->comm); resolved_traces[len++] = POINTER_TO_U64 (cmdline); |