mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 15:27:29 +00:00
perf tools: Move mem_bswap32/64 to util.c
Move functions mem_bswap_32() and mem_bswap_64() so they can be reused. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> 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 <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1386765443-26966-21-git-send-email-alexander.shishkin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
c09ec62262
commit
71db07b12e
4 changed files with 25 additions and 23 deletions
|
@ -247,27 +247,6 @@ void perf_tool__fill_defaults(struct perf_tool *tool)
|
|||
}
|
||||
}
|
||||
|
||||
void mem_bswap_32(void *src, int byte_size)
|
||||
{
|
||||
u32 *m = src;
|
||||
while (byte_size > 0) {
|
||||
*m = bswap_32(*m);
|
||||
byte_size -= sizeof(u32);
|
||||
++m;
|
||||
}
|
||||
}
|
||||
|
||||
void mem_bswap_64(void *src, int byte_size)
|
||||
{
|
||||
u64 *m = src;
|
||||
|
||||
while (byte_size > 0) {
|
||||
*m = bswap_64(*m);
|
||||
byte_size -= sizeof(u64);
|
||||
++m;
|
||||
}
|
||||
}
|
||||
|
||||
static void swap_sample_id_all(union perf_event *event, void *data)
|
||||
{
|
||||
void *end = (void *) event + event->header.size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue