mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Frederic Weisbecker <fweisbec@gmail.com>,
	David Ahern <dsahern@gmail.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 03/16] perf tools: Tag thread comm as overriden
Date: Mon, 18 Nov 2013 17:27:51 -0300	[thread overview]
Message-ID: <1384806484-29869-4-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1384806484-29869-1-git-send-email-acme@infradead.org>

From: Frederic Weisbecker <fweisbec@gmail.com>

The problem is that when a thread overrides its default ":%pid" comm, we
forget to tag the thread comm as overriden. Hence, this overriden comm
is not inherited on future forks. Fix it.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Tested-by: David Ahern <dsahern@gmail.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20131116010207.GA18855@localhost.localdomain
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/thread.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index cd8e2f592719..49eaf1d7d89d 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -70,14 +70,13 @@ int thread__set_comm(struct thread *thread, const char *str, u64 timestamp)
 	/* Override latest entry if it had no specific time coverage */
 	if (!curr->start) {
 		comm__override(curr, str, timestamp);
-		return 0;
+	} else {
+		new = comm__new(str, timestamp);
+		if (!new)
+			return -ENOMEM;
+		list_add(&new->list, &thread->comm_list);
 	}
 
-	new = comm__new(str, timestamp);
-	if (!new)
-		return -ENOMEM;
-
-	list_add(&new->list, &thread->comm_list);
 	thread->comm_set = true;
 
 	return 0;
-- 
1.8.1.4


  parent reply	other threads:[~2013-11-18 20:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-18 20:27 [GIT PULL 00/16] perf/core improvements and fixes Arnaldo Carvalho de Melo
2013-11-18 20:27 ` [PATCH 01/16] perf trace: Remove thread summary coloring Arnaldo Carvalho de Melo
2013-11-18 20:27 ` [PATCH 02/16] perf top: Make -g refer to callchains Arnaldo Carvalho de Melo
2013-11-18 20:27 ` Arnaldo Carvalho de Melo [this message]
2013-11-18 20:27 ` [PATCH 04/16] perf completion: introduce a layer of indirection Arnaldo Carvalho de Melo
2013-11-18 20:27 ` [PATCH 05/16] perf completion: factor out compgen stuff Arnaldo Carvalho de Melo
2013-11-18 20:27 ` [PATCH 06/16] perf completion: factor out call to __ltrim_colon_completions Arnaldo Carvalho de Melo
2013-11-18 20:27 ` [PATCH 07/16] perf completion: introduce zsh support Arnaldo Carvalho de Melo
2013-11-18 20:27 ` [PATCH 08/16] perf completion: rename file to reflect " Arnaldo Carvalho de Melo
2013-11-18 20:27 ` [PATCH 09/16] perf header: Fix bogus group name Arnaldo Carvalho de Melo
2013-11-18 20:27 ` [PATCH 10/16] perf header: Fix possible memory leaks in process_group_desc() Arnaldo Carvalho de Melo
2013-11-18 20:27 ` [PATCH 11/16] perf script: Move evname print code to process_event() Arnaldo Carvalho de Melo
2013-11-18 20:28 ` [PATCH 12/16] perf record: Make per-cpu mmaps the default Arnaldo Carvalho de Melo
2013-11-18 20:28 ` [PATCH 13/16] perf tools: Allow '--inherit' as the negation of '--no-inherit' Arnaldo Carvalho de Melo
2013-11-18 20:28 ` [PATCH 14/16] perf tools: Add option macro OPT_BOOLEAN_SET Arnaldo Carvalho de Melo
2013-11-18 20:28 ` [PATCH 15/16] perf record: Default -t option to no inheritance Arnaldo Carvalho de Melo
2013-11-18 20:28 ` [PATCH 16/16] tools lib traceevent: Fix use of multiple options in processing field Arnaldo Carvalho de Melo

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=1384806484-29869-4-git-send-email-acme@infradead.org \
    --to=acme@infradead.org \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=fweisbec@gmail.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

all inboxes | Powered by JetHome®