perf tools: Don't trow away old map slices not overlapped by new maps

Previous thread: Btrfs: make df be a little bit more understandable by Linux Kernel Mailing List on Thursday, March 18, 2010 - 5:59 pm. (1 message)

Next thread: perf: Provide better condition for event rotation by Linux Kernel Mailing List on Thursday, March 18, 2010 - 6:00 pm. (1 message)
From: Linux Kernel Mailing List
Date: Thursday, March 18, 2010 - 6:00 pm

Gitweb:     http://git.kernel.org/linus/1224550969e0bf18785786a1a9f801cd86d68586
Commit:     1224550969e0bf18785786a1a9f801cd86d68586
Parent:     d4944a06666054707d23e11888e480af239e5abf
Author:     Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Fri Mar 5 11:54:02 2010 -0300
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed Mar 10 13:52:25 2010 +0100

    perf tools: Don't trow away old map slices not overlapped by new maps
    
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: David S. Miller <davem@davemloft.net>
    Cc: Frédéric Weisbecker <fweisbec@gmail.com>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Paul Mackerras <paulus@samba.org>
    LKML-Reference: <1267800842-22324-1-git-send-email-acme@infradead.org>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 tools/perf/util/thread.c |   35 ++++++++++++++++++++++++++++++++---
 1 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index 21b9216..9024fa1 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -183,8 +183,8 @@ struct thread *perf_session__findnew(struct perf_session *self, pid_t pid)
 	return th;
 }
 
-static void map_groups__remove_overlappings(struct map_groups *self,
-					    struct map *map)
+static int map_groups__fixup_overlappings(struct map_groups *self,
+					  struct map *map)
 {
 	struct rb_root *root = &self->maps[map->type];
 	struct rb_node *next = rb_first(root);
@@ -209,7 +209,36 @@ static void map_groups__remove_overlappings(struct map_groups *self,
 		 * list.
 		 */
 		list_add_tail(&pos->node, &self->removed_maps[map->type]);
+		/*
+		 * Now check if we need to create new maps for areas not
+		 * overlapped by the new map:
+		 */
+		if (map->start > pos->start) {
+			struct map *before = map__clone(pos);
+
+			if (before == NULL)
+				return -ENOMEM;
+
+			before->end = map->start - ...
Previous thread: Btrfs: make df be a little bit more understandable by Linux Kernel Mailing List on Thursday, March 18, 2010 - 5:59 pm. (1 message)

Next thread: perf: Provide better condition for event rotation by Linux Kernel Mailing List on Thursday, March 18, 2010 - 6:00 pm. (1 message)