linux-kernel.vger.kernel.org archive mirror
 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,
	Adrian Hunter <adrian.hunter@intel.com>,
	David Ahern <dsahern@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@gmail.com>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Stephane Eranian <eranian@google.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 26/33] perf thread: Allow deletion of a thread with no map groups
Date: Thu, 17 Jul 2014 13:12:28 -0300	[thread overview]
Message-ID: <1405613555-23380-27-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1405613555-23380-1-git-send-email-acme@kernel.org>

From: Adrian Hunter <adrian.hunter@intel.com>

It needs to be possible to call thread__delete() on a thread with no map
groups.

This is needed for a subsequent patch which deletes a thread on the
error path before map groups have been attached.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1405495184-20441-2-git-send-email-adrian.hunter@intel.com
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/thread.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index 7a32f447a8e7..b9c36ef42d2f 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -60,8 +60,10 @@ void thread__delete(struct thread *thread)
 {
 	struct comm *comm, *tmp;
 
-	map_groups__put(thread->mg);
-	thread->mg = NULL;
+	if (thread->mg) {
+		map_groups__put(thread->mg);
+		thread->mg = NULL;
+	}
 	list_for_each_entry_safe(comm, tmp, &thread->comm_list, list) {
 		list_del(&comm->list);
 		comm__free(comm);
-- 
1.9.3


  parent reply	other threads:[~2014-07-17 16:17 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-17 16:12 [GIT PULL 00/33] perf/core improvements and fixes Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 01/33] perf kvm: Use defines of kvm events Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 02/33] perf kvm: Move arch specific code into arch/ Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 03/33] perf kvm: Add skip_event() for --duration option Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 04/33] perf kvm: Add stat support on s390 Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 05/33] perf script: Add missing calls to Py_DECREF for return values Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 06/33] perf script: Add callchain to generic and tracepoint events Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 07/33] perf script: Provide additional sample information on generic events Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 08/33] perf machine: Fix the value used for unknown pids Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 09/33] perf script: Display PERF_RECORD_MISC_COMM_EXEC flag Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 10/33] perf record: Select comm_exec flag if supported Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 11/33] perf tools: Fix missing kernel map load Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 12/33] perf symbols: Fix missing GNU IFUNC symbols Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 13/33] perf inject: Fix build id injection Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 14/33] perf callchain: Fix appending a callchain from a previous sample Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 15/33] perf buildid-cache: Apply force option to copying kcore Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 16/33] perf symbols: Record whether a dso is 64-bit Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 17/33] perf symbols: Do not attempt to read data from kallsyms Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 18/33] perf symbols: Add ability to iterate over a dso's symbols Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 19/33] perf session: Flag if the event stream is entirely in memory Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 20/33] perf evlist: Pass mmap parameters in a struct Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 21/33] perf tools: Add feature test for __sync_val_compare_and_swap Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 22/33] perf tools: Add option macro OPT_CALLBACK_OPTARG Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 23/33] perf evsel: Add 'no_aux_samples' option Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 24/33] perf evsel: Add 'immediate' option Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 25/33] perf machine: Fix map groups of threads with unknown pids Arnaldo Carvalho de Melo
2014-07-17 16:12 ` Arnaldo Carvalho de Melo [this message]
2014-07-17 16:12 ` [PATCH 27/33] perf machine: Fix leak of 'struct thread' on error path Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 28/33] perf tools: Remove verbose from functions prototypes Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 29/33] perf tools: Move pr_* debug macros into debug object Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 30/33] perf tools: Factor eprintf to allow different debug variables Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 31/33] perf tools: Add --debug optionto set debug variable Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 32/33] perf tools: Remove needless getopt.h includes Arnaldo Carvalho de Melo
2014-07-17 16:12 ` [PATCH 33/33] perf tools: Allow TSC conversion on any arch Arnaldo Carvalho de Melo
2014-07-18  4:17 ` [GIT PULL 00/33] perf/core 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=1405613555-23380-27-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@gmail.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).