From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752040AbbJCHti (ORCPT ); Sat, 3 Oct 2015 03:49:38 -0400 Received: from terminus.zytor.com ([198.137.202.10]:59111 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751712AbbJCHtg (ORCPT ); Sat, 3 Oct 2015 03:49:36 -0400 Date: Sat, 3 Oct 2015 00:49:20 -0700 From: tip-bot for Namhyung Kim Message-ID: Cc: hpa@zytor.com, acme@redhat.com, namhyung@kernel.org, a.p.zijlstra@chello.nl, jolsa@redhat.com, mingo@kernel.org, dsahern@gmail.com, linux-kernel@vger.kernel.org, tglx@linutronix.de Reply-To: dsahern@gmail.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, jolsa@redhat.com, mingo@kernel.org, acme@redhat.com, hpa@zytor.com, namhyung@kernel.org, a.p.zijlstra@chello.nl In-Reply-To: <1443577526-3240-3-git-send-email-namhyung@kernel.org> References: <1443577526-3240-3-git-send-email-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf top: Register idle thread Git-Commit-ID: c53d138d41a7f33cf085762c64b4b61e8d223e1c X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: c53d138d41a7f33cf085762c64b4b61e8d223e1c Gitweb: http://git.kernel.org/tip/c53d138d41a7f33cf085762c64b4b61e8d223e1c Author: Namhyung Kim AuthorDate: Wed, 30 Sep 2015 10:45:26 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 1 Oct 2015 09:54:33 -0300 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 Cc: David Ahern Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1443577526-3240-3-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- 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 ae4c642..6f641fd 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 84a02eae..428149b 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 b44afc7..3e900c0 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);