All of lore.kernel.org
 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, Jan Stancek <jstancek@redhat.com>,
	Corey Ashford <cjashfor@linux.vnet.ibm.com>,
	David Ahern <dsahern@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 04/15] perf tests: Print objdump/dso buffers if they don't match
Date: Fri,  4 Sep 2015 22:06:32 -0300	[thread overview]
Message-ID: <1441415203-7484-5-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1441415203-7484-1-git-send-email-acme@kernel.org>

From: Jan Stancek <jstancek@redhat.com>

Signed-off-by: Jan Stancek <jstancek@redhat.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/d0f42f786bc0e965918e0f422df25617a12a4021.1441181335.git.jstancek@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/code-reading.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 8145c67fb43a..2d21183bd661 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -162,6 +162,18 @@ static int read_via_objdump(const char *filename, u64 addr, void *buf,
 	return ret;
 }
 
+static void dump_buf(unsigned char *buf, size_t len)
+{
+	size_t i;
+
+	for (i = 0; i < len; i++) {
+		pr_debug("0x%02x ", buf[i]);
+		if (i % 16 == 15)
+			pr_debug("\n");
+	}
+	pr_debug("\n");
+}
+
 static int read_object_code(u64 addr, size_t len, u8 cpumode,
 			    struct thread *thread, struct state *state)
 {
@@ -264,6 +276,10 @@ static int read_object_code(u64 addr, size_t len, u8 cpumode,
 	/* The results should be identical */
 	if (memcmp(buf1, buf2, len)) {
 		pr_debug("Bytes read differ from those read by objdump\n");
+		pr_debug("buf1 (dso):\n");
+		dump_buf(buf1, len);
+		pr_debug("buf2 (objdump):\n");
+		dump_buf(buf2, len);
 		return -1;
 	}
 	pr_debug("Bytes read match those read by objdump\n");
-- 
2.1.0


  parent reply	other threads:[~2015-09-05  1:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-05  1:06 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-09-05  1:06 ` [PATCH 01/15] perf tests: Take into account address of each objdump line Arnaldo Carvalho de Melo
2015-09-05  1:06 ` [PATCH 02/15] perf tests: Make objdump disassemble zero blocks Arnaldo Carvalho de Melo
2015-09-05  1:06 ` [PATCH 03/15] perf tests: Stop reading if objdump output crossed sections Arnaldo Carvalho de Melo
2015-09-05  1:06 ` Arnaldo Carvalho de Melo [this message]
2015-09-05  1:06 ` [PATCH 05/15] tools lib api fs: Make tracing_path_strerror_open message generic Arnaldo Carvalho de Melo
2015-09-05  1:06 ` [PATCH 06/15] tools lib api fs: Replace debugfs/tracefs objects interface with fs.c Arnaldo Carvalho de Melo
2015-09-05  1:06 ` [PATCH 07/15] tools lib api fs: Remove debugfs, tracefs and findfs objects Arnaldo Carvalho de Melo
2015-09-05  1:06 ` [PATCH 08/15] perf tools: Switch to tracing_path interface on appropriate places Arnaldo Carvalho de Melo
2015-09-05  1:06 ` [PATCH 09/15] perf test: Add entry to test cpu topology Arnaldo Carvalho de Melo
2015-09-05  1:06 ` [PATCH 10/15] perf tools: Add processor socket info to hist_entry and addr_location Arnaldo Carvalho de Melo
2015-09-05  1:06 ` [PATCH 11/15] perf tools: Introduce new sort type "socket" for the processor socket Arnaldo Carvalho de Melo
2015-09-05  1:06 ` [PATCH 12/15] perf report: Introduce --socket-filter option Arnaldo Carvalho de Melo
2015-09-05  1:06 ` [PATCH 13/15] perf hists browser: Zoom in/out for processor socket Arnaldo Carvalho de Melo
2015-09-05  1:06 ` [PATCH 14/15] perf test: Add entry for hists socket filter Arnaldo Carvalho de Melo
2015-09-05  1:06 ` [PATCH 15/15] perf stat: Move sw clock metrics printout to stat-shadow Arnaldo Carvalho de Melo
2015-09-08 14:09 ` [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-09-08 14:21   ` Ingo Molnar
2015-09-08 14:30     ` Arnaldo Carvalho de Melo
2015-09-14  8:41       ` Ingo Molnar
2015-09-14  9:07         ` Wangnan (F)

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=1441415203-7484-5-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=dsahern@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=jstancek@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.