[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1395689676-214799-6-git-send-email-dzickus@redhat.com>
Date: Mon, 24 Mar 2014 15:34:35 -0400
From: Don Zickus <dzickus@...hat.com>
To: acme@...stprotocols.net, peterz@...radead.org
Cc: LKML <linux-kernel@...r.kernel.org>, jolsa@...hat.com,
jmario@...hat.com, fowles@...each.com, eranian@...gle.com,
andi.kleen@...el.com, Don Zickus <dzickus@...hat.com>
Subject: [PATCH 5/6] perf: Update sort to handle MAP_SHARED bits
Remove some of the false positives when sorting by utilizing the MAP_SHARED bit.
This helps deal with the COW cases where a virtual address is modified but is
mapped to a read-only shared library area because the perf tool doesn't understand
COW faults.
Using the MAP_SHARED bit tells the tool in this example the memory is private
and will not cause contention with other processes accessing the same shared
library area.
Signed-off-by: Don Zickus <dzickus@...hat.com>
---
tools/perf/util/sort.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index e016fc1..be675f4 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -1,3 +1,4 @@
+#include <sys/mman.h>
#include "sort.h"
#include "hist.h"
#include "comm.h"
@@ -1001,7 +1002,8 @@ sort__physid_daddr_cmp(struct hist_entry *left, struct hist_entry *right)
* assumed to be unity mapped. Sort those on address then pid.
*/
- if (l_map->maj || l_map->min || l_map->ino || l_map->ino_generation) {
+ if ((l_map->flags & MAP_SHARED) &&
+ (l_map->maj || l_map->min || l_map->ino || l_map->ino_generation)) {
/* mmapped areas */
if (l_map->maj > r_map->maj) return -1;
--
1.7.11.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists