mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
perf thread-stack: Fix thread stack processing for the idle task
perf creates a single 'struct thread' to represent the idle task. That is because threads are identified by PID and TID, and the idle task always has PID == TID == 0. However, there are actually separate idle tasks for each CPU. That creates a problem for thread stack processing which assumes that each thread has a single stack, not one stack per CPU. Fix that by passing through the CPU number, and in the case of the idle "thread", pick the thread stack from an array based on the CPU number. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Link: http://lkml.kernel.org/r/20181221120620.9659-8-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
139f42f3b3
commit
256d92bc93
5 changed files with 69 additions and 25 deletions
|
@ -1182,7 +1182,7 @@ static int perf_sample__fprintf_callindent(struct perf_sample *sample,
|
|||
struct addr_location *al, FILE *fp)
|
||||
{
|
||||
struct perf_event_attr *attr = &evsel->attr;
|
||||
size_t depth = thread_stack__depth(thread);
|
||||
size_t depth = thread_stack__depth(thread, sample->cpu);
|
||||
const char *name = NULL;
|
||||
static int spacing;
|
||||
int len = 0;
|
||||
|
@ -1716,7 +1716,7 @@ static bool show_event(struct perf_sample *sample,
|
|||
struct thread *thread,
|
||||
struct addr_location *al)
|
||||
{
|
||||
int depth = thread_stack__depth(thread);
|
||||
int depth = thread_stack__depth(thread, sample->cpu);
|
||||
|
||||
if (!symbol_conf.graph_function)
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue