Re: [PATCH v3 1/7] perf tools: Set vdso name to vdso[64,32] depending on platform

From: Hekuang
Date: Fri May 13 2016 - 04:55:17 EST




å 2016/5/12 18:06, Adrian Hunter åé:
On 12/05/16 11:43, He Kuang wrote:
This is a preparation for cross-platform vdso lookup.

There is a naming confusion about vdso name, vdso buildid generated by
a 32-bit machine stores it with the name 'vdso', but when processing
buildid on a 64-bit machine with the same 'perf.data', perf will
search for vdso named as 'vdso32' and get failed.

This patch uses different names when storing the buildid, i.e. vdso64
for 64-bit machine and vdso32 for 32-bit machine, and eliminates this
naming confusion.
That looks like it will break existing perf.data files because they will
have a different name recorded in the buildid section.

Also it doesn't look like it would work the other way around i.e. recording
on a 64-bit machine and processing on a 32-bit machine.

Yes, please have a look at the new patch.

Thanks
Signed-off-by: He Kuang <hekuang@xxxxxxxxxx>
---
tools/perf/util/vdso.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/vdso.h b/tools/perf/util/vdso.h
index cdc4fab..45e9ef4 100644
--- a/tools/perf/util/vdso.h
+++ b/tools/perf/util/vdso.h
@@ -4,10 +4,15 @@
#include <linux/types.h>
#include <string.h>
#include <stdbool.h>
+#include "util.h"
#define VDSO__MAP_NAME "[vdso]"
-#define DSO__NAME_VDSO "[vdso]"
+#if BITS_PER_LONG == 64
+#define DSO__NAME_VDSO "[vdso64]"
+#else
+#define DSO__NAME_VDSO "[vdso32]"
+#endif
#define DSO__NAME_VDSO32 "[vdso32]"
#define DSO__NAME_VDSOX32 "[vdsox32]"