public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Namhyung Kim <namhyung@kernel.org>,
	David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@redhat.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 03/10] perf top: Register idle thread
Date: Fri,  2 Oct 2015 17:25:38 -0300	[thread overview]
Message-ID: <1443817545-8551-4-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1443817545-8551-1-git-send-email-acme@kernel.org>

From: Namhyung Kim <namhyung@kernel.org>

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>
---
 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.1.0


  parent reply	other threads:[~2015-10-02 20:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-02 20:25 [GIT PULL 00/10] perf/cover improvements and fixes Arnaldo Carvalho de Melo
2015-10-02 20:25 ` [PATCH 01/10] perf record: Allocate area for sample_id_hdr in a synthesized comm event Arnaldo Carvalho de Melo
2015-10-02 20:25 ` [PATCH 02/10] perf top: Fix unresolved comm when -s comm is used Arnaldo Carvalho de Melo
2015-10-02 20:25 ` Arnaldo Carvalho de Melo [this message]
2015-10-02 20:25 ` [PATCH 04/10] perf report: Fix a bug on "--call-graph none" option Arnaldo Carvalho de Melo
2015-10-02 20:25 ` [PATCH 05/10] perf callchain: Allow for max_stack greater than PERF_MAX_STACK_DEPTH Arnaldo Carvalho de Melo
2015-10-02 20:25 ` [PATCH 06/10] perf list: Do event name substring search as last resort when no events found Arnaldo Carvalho de Melo
2015-10-02 20:25 ` [PATCH 07/10] perf list: Honour 'event_glob' whem printing selectable PMUs Arnaldo Carvalho de Melo
2015-10-02 20:25 ` [PATCH 08/10] perf probe: Allow probing on kmodules without dwarf Arnaldo Carvalho de Melo
2015-10-02 20:25 ` [PATCH 09/10] perf record: Change 'record.samples' type to unsigned long long Arnaldo Carvalho de Melo
2015-10-02 20:25 ` [PATCH 10/10] perf stat: Reduce min --interval-print to 10ms Arnaldo Carvalho de Melo
2015-10-03  6:32 ` [GIT PULL 00/10] perf/cover improvements and fixes Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1443817545-8551-4-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox