Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1235709

[PATCH 3/3] perf top: Register idle thread

From Namhyung Kim <namhyung@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 3/3] perf top: Register idle thread
Date 2015-09-30 04:00 +0200
Message-ID <qeeQy-7rT-5@gated-at.bofh.it> (permalink)
References <qeeQx-7rT-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 tools/perf/builtin-top.c  | 3 +++
 tools/perf/util/session.c | 2 +-
 tools/perf/util/session.h | 2 ++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index ae4c6420300b..6f641fd68296 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -964,6 +964,9 @@ static int __cmd_top(struct perf_top *top)
 	if (ret)
 		goto out_delete;
 
+	if (perf_session__register_idle_thread(top->session) == NULL)
+		goto out_delete;
+
 	machine__synthesize_threads(&top->session->machines.host, &opts->target,
 				    top->evlist->threads, false, opts->proc_map_timeout);
 
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 84a02eae4394..428149bc64d2 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1311,7 +1311,7 @@ struct thread *perf_session__findnew(struct perf_session *session, pid_t pid)
 	return machine__findnew_thread(&session->machines.host, -1, pid);
 }
 
-static struct thread *perf_session__register_idle_thread(struct perf_session *session)
+struct thread *perf_session__register_idle_thread(struct perf_session *session)
 {
 	struct thread *thread;
 
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index b44afc75d1cc..3e900c0efc73 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -89,6 +89,8 @@ struct machine *perf_session__findnew_machine(struct perf_session *session, pid_
 }
 
 struct thread *perf_session__findnew(struct perf_session *session, pid_t pid);
+struct thread *perf_session__register_idle_thread(struct perf_session *session);
+
 size_t perf_session__fprintf(struct perf_session *session, FILE *fp);
 
 size_t perf_session__fprintf_dsos(struct perf_session *session, FILE *fp);
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] perf record: Allocate area for sample_id_hdr in a synthesized comm event Namhyung Kim <namhyung@kernel.org> - 2015-09-30 04:00 +0200
  [PATCH 3/3] perf top: Register idle thread Namhyung Kim <namhyung@kernel.org> - 2015-09-30 04:00 +0200
    [tip:perf/core] perf top: Register idle thread tip-bot for Namhyung Kim <tipbot@zytor.com> - 2015-10-03 09:50 +0200
  Re: [PATCH 1/3] perf record: Allocate area for sample_id_hdr in a  synthesized comm event Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-10-01 00:10 +0200
  [tip:perf/core] perf record:   Allocate area for sample_id_hdr in a synthesized comm event tip-bot for Namhyung Kim <tipbot@zytor.com> - 2015-10-03 09:50 +0200

csiph-web