aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r--tools/perf/util/session.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 78a067777144..5456c84c7dd1 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1527,6 +1527,13 @@ struct thread *perf_session__findnew(struct perf_session *session, pid_t pid)
1527 return machine__findnew_thread(&session->machines.host, -1, pid); 1527 return machine__findnew_thread(&session->machines.host, -1, pid);
1528} 1528}
1529 1529
1530/*
1531 * Threads are identified by pid and tid, and the idle task has pid == tid == 0.
1532 * So here a single thread is created for that, but actually there is a separate
1533 * idle task per cpu, so there should be one 'struct thread' per cpu, but there
1534 * is only 1. That causes problems for some tools, requiring workarounds. For
1535 * example get_idle_thread() in builtin-sched.c, or thread_stack__per_cpu().
1536 */
1530int perf_session__register_idle_thread(struct perf_session *session) 1537int perf_session__register_idle_thread(struct perf_session *session)
1531{ 1538{
1532 struct thread *thread; 1539 struct thread *thread;