Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf top: Register idle thread

The perf top didn't add the idle/swapper thread to the machine's thread
list and its comm was displayed as ':0'. Fix it.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1443577526-3240-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
c53d138d 4b37af59

+6 -1
+3
tools/perf/builtin-top.c
··· 964 964 if (ret) 965 965 goto out_delete; 966 966 967 + if (perf_session__register_idle_thread(top->session) == NULL) 968 + goto out_delete; 969 + 967 970 machine__synthesize_threads(&top->session->machines.host, &opts->target, 968 971 top->evlist->threads, false, opts->proc_map_timeout); 969 972
+1 -1
tools/perf/util/session.c
··· 1311 1311 return machine__findnew_thread(&session->machines.host, -1, pid); 1312 1312 } 1313 1313 1314 - static struct thread *perf_session__register_idle_thread(struct perf_session *session) 1314 + struct thread *perf_session__register_idle_thread(struct perf_session *session) 1315 1315 { 1316 1316 struct thread *thread; 1317 1317
+2
tools/perf/util/session.h
··· 89 89 } 90 90 91 91 struct thread *perf_session__findnew(struct perf_session *session, pid_t pid); 92 + struct thread *perf_session__register_idle_thread(struct perf_session *session); 93 + 92 94 size_t perf_session__fprintf(struct perf_session *session, FILE *fp); 93 95 94 96 size_t perf_session__fprintf_dsos(struct perf_session *session, FILE *fp);