linux-kernel.vger.kernel.org archive mirror
 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,
	Adrian Hunter <adrian.hunter@intel.com>,
	David Ahern <dsahern@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Jiri Olsa <jolsa@redhat.com>, Mike Galbraith <efault@gmx.de>,
	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 31/47] perf tests: Adjust the vmlinux symtab matches kallsyms test again
Date: Wed,  7 Aug 2013 18:10:58 -0300	[thread overview]
Message-ID: <1375909874-22073-32-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1375909874-22073-1-git-send-email-acme@infradead.org>

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

The kallsyms maps now may map to kcore and the symbol values now may be
file offsets.  For comparison with vmlinux the virtual memory address is
needed which is obtained by unmapping the symbol value.

The "vmlinux symtab matches kallsyms" is adjusted accordingly.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
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/1375875537-4509-9-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/vmlinux-kallsyms.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c
index e2e1498..2bd13ed 100644
--- a/tools/perf/tests/vmlinux-kallsyms.c
+++ b/tools/perf/tests/vmlinux-kallsyms.c
@@ -16,6 +16,8 @@ static int vmlinux_matches_kallsyms_filter(struct map *map __maybe_unused,
 	return 0;
 }
 
+#define UM(x) kallsyms_map->unmap_ip(kallsyms_map, (x))
+
 int test__vmlinux_matches_kallsyms(void)
 {
 	int err = -1;
@@ -74,7 +76,7 @@ int test__vmlinux_matches_kallsyms(void)
 		goto out;
 	}
 
-	ref_reloc_sym.addr = sym->start;
+	ref_reloc_sym.addr = UM(sym->start);
 
 	/*
 	 * Step 5:
@@ -131,7 +133,7 @@ int test__vmlinux_matches_kallsyms(void)
 							 mem_start, NULL, NULL);
 		pair = first_pair;
 
-		if (pair && pair->start == mem_start) {
+		if (pair && UM(pair->start) == mem_start) {
 next_pair:
 			if (strcmp(sym->name, pair->name) == 0) {
 				/*
@@ -143,11 +145,11 @@ next_pair:
 				 * off the real size. More than that and we
 				 * _really_ have a problem.
 				 */
-				s64 skew = mem_end - pair->end;
+				s64 skew = mem_end - UM(pair->end);
 				if (llabs(skew) >= page_size)
 					pr_debug("%#" PRIx64 ": diff end addr for %s v: %#" PRIx64 " k: %#" PRIx64 "\n",
 						 mem_start, sym->name, mem_end,
-						 pair->end);
+						 UM(pair->end));
 
 				/*
 				 * Do not count this as a failure, because we
@@ -165,7 +167,7 @@ detour:
 				if (nnd) {
 					struct symbol *next = rb_entry(nnd, struct symbol, rb_node);
 
-					if (next->start == mem_start) {
+					if (UM(next->start) == mem_start) {
 						pair = next;
 						goto next_pair;
 					}
-- 
1.8.1.4


  parent reply	other threads:[~2013-08-07 21:15 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-07 21:10 [GIT PULL 00/47] perf/core improvements and fixes Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 01/47] perf: Add PERF_EVENT_IOC_ID ioctl to return event ID Arnaldo Carvalho de Melo
2013-08-09 14:50   ` Vince Weaver
2013-08-10 12:11     ` Jiri Olsa
2013-08-07 21:10 ` [PATCH 02/47] perf: Do not get values from disabled counters in group format read Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 03/47] perf evlist: Use PERF_EVENT_IOC_ID perf ioctl to read event id Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 04/47] perf tools: Add support for parsing PERF_SAMPLE_READ sample type Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 05/47] perf evlist: Fix event ID retrieval for group format read case Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 06/47] perf evlist: Add perf_evlist__id2sid method to get event ID related data Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 07/47] perf evsel: Add PERF_SAMPLE_READ sample related processing Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 08/47] perf tools: Add 'S' event/group modifier to read sample value Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 09/47] perf tests: Add attr record group sampling test Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 10/47] perf tests: Add parse events tests for leader sampling Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 11/47] perf evsel: Actually show symbol offset in stack trace when requested Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 12/47] perf tools: Fix compile of util/tsc.c Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 13/47] perf trace: Beautify 'connect' result Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 14/47] perf python: Remove duplicate TID bit from mask Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 15/47] perf util: Add parse_nsec_time() function Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 16/47] perf top: move CONSOLE_CLEAR to header file Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 17/47] perf stats: Add max and min stats Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 18/47] perf session: Export a few functions for event processing Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 19/47] perf kvm: Split out tracepoints from record args Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 20/47] perf evlist: Remove obsolete dummy execve Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 21/47] perf evsel: Add support for enabling counters Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 22/47] perf stat: Add support for --initial-delay option Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 23/47] perf stat: Flush output after each line in interval mode Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 24/47] perf symbols: avoid SyS kernel syscall aliases Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 25/47] perf tests: Add test for reading object code Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 26/47] perf symbols: Load kernel maps before using Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 27/47] perf tools: Make it possible to read object code from vmlinux Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 28/47] perf tests: Adjust the vmlinux symtab matches kallsyms test Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 29/47] perf tools: Make it possible to read object code from kernel modules Arnaldo Carvalho de Melo
2013-08-07 21:10 ` [PATCH 30/47] perf symbols: Add support for reading from /proc/kcore Arnaldo Carvalho de Melo
2013-08-07 21:10 ` Arnaldo Carvalho de Melo [this message]
2013-08-07 21:10 ` [PATCH 32/47] perf tests: Add kcore to the object code reading test Arnaldo Carvalho de Melo
2013-08-07 21:11 ` [PATCH 33/47] perf annotate: Allow disassembly using /proc/kcore Arnaldo Carvalho de Melo
2013-08-07 21:11 ` [PATCH 34/47] perf annotate: Put dso name in symbol annotation title Arnaldo Carvalho de Melo
2013-08-07 21:11 ` [PATCH 35/47] perf annotate: Remove nop at end of annotation Arnaldo Carvalho de Melo
2013-08-07 21:11 ` [PATCH 36/47] perf annotate: Add call target name if it is missing Arnaldo Carvalho de Melo
2013-08-07 21:11 ` [PATCH 37/47] perf annotate browser: Improve description of '?' hotkey Arnaldo Carvalho de Melo
2013-08-07 21:11 ` [PATCH 38/47] perf annotate browser: Fix typo Arnaldo Carvalho de Melo
2013-08-07 21:11 ` [PATCH 39/47] perf session: Export queue_event function Arnaldo Carvalho de Melo
2013-08-07 21:11 ` [PATCH 40/47] perf kvm: Add live mode Arnaldo Carvalho de Melo
2013-08-07 21:11 ` [PATCH 41/47] perf kvm: Add min and max stats to display Arnaldo Carvalho de Melo
2013-08-07 21:11 ` [PATCH 42/47] perf kvm stat report: Add option to analyze specific VM Arnaldo Carvalho de Melo
2013-08-07 21:11 ` [PATCH 43/47] perf ui/gtk: Fix segmentation fault on perf_hpp__for_each_format loop Arnaldo Carvalho de Melo
2013-08-07 21:11 ` [PATCH 44/47] perf tools: Add support for pinned modifier Arnaldo Carvalho de Melo
2013-08-07 21:11 ` [PATCH 45/47] perf tests: Add tests of new " Arnaldo Carvalho de Melo
2013-08-07 21:11 ` [PATCH 46/47] perf machine: Do not require /lib/modules/* on a guest Arnaldo Carvalho de Melo
2013-08-07 21:11 ` [PATCH 47/47] Revert "tools lib lk: Fix for cross build" Arnaldo Carvalho de Melo
2013-08-12  8:17 ` [GIT PULL 00/47] 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=1375909874-22073-32-git-send-email-acme@infradead.org \
    --to=acme@infradead.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=efault@gmx.de \
    --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).