linux_dsm_epyc7002/tools/perf/perf-read-vdso.c
Adrian Hunter e477f3f01a perf tools: Build programs to copy 32-bit compatibility
perf tools copy VDSO out of memory.  However, on 64-bit machines there
may be 32-bit compatibility VDOs also.  To copy those requires separate
32-bit executables.

This patch adds to the build additional programs perf-read-vdso32 and
perf-read-vdsox32 for 32-bit and x32 respectively.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1414061124-26830-15-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2014-10-29 10:32:48 -02:00

35 lines
510 B
C

#include <stdio.h>
#include <string.h>
#define VDSO__MAP_NAME "[vdso]"
/*
* Include definition of find_vdso_map() also used in util/vdso.c for
* building perf.
*/
#include "util/find-vdso-map.c"
int main(void)
{
void *start, *end;
size_t size, written;
if (find_vdso_map(&start, &end))
return 1;
size = end - start;
while (size) {
written = fwrite(start, 1, size, stdout);
if (!written)
return 1;
start += written;
size -= written;
}
if (fflush(stdout))
return 1;
return 0;
}