aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/builtin-kmem.c11
-rw-r--r--tools/perf/builtin-sched.c11
2 files changed, 16 insertions, 6 deletions
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index f218990de0cd..f84d7a3db681 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -289,13 +289,17 @@ static void process_free_event(struct raw_event_sample *raw,
289} 289}
290 290
291static void 291static void
292process_raw_event(event_t *raw_event __used, void *more_data, 292process_raw_event(event_t *raw_event __used, u32 size, void *data,
293 int cpu, u64 timestamp, struct thread *thread) 293 int cpu, u64 timestamp, struct thread *thread)
294{ 294{
295 struct raw_event_sample *raw = more_data; 295 struct raw_event_sample *raw;
296 struct event *event; 296 struct event *event;
297 int type; 297 int type;
298 298
299 raw = malloc_or_die(sizeof(*raw)+size);
300 raw->size = size;
301 memcpy(raw->data, data, size);
302
299 type = trace_parse_common_type(raw->data); 303 type = trace_parse_common_type(raw->data);
300 event = trace_find_event(type); 304 event = trace_find_event(type);
301 305
@@ -345,7 +349,8 @@ static int process_sample_event(event_t *event)
345 349
346 dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid); 350 dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid);
347 351
348 process_raw_event(event, data.raw_data, data.cpu, data.time, thread); 352 process_raw_event(event, data.raw_size, data.raw_data, data.cpu,
353 data.time, thread);
349 354
350 return 0; 355 return 0;
351} 356}
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 7481ebdb17ef..4655e16b929b 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -1570,13 +1570,17 @@ process_sched_migrate_task_event(struct raw_event_sample *raw,
1570} 1570}
1571 1571
1572static void 1572static void
1573process_raw_event(event_t *raw_event __used, void *more_data, 1573process_raw_event(event_t *raw_event __used, u32 size, void *data,
1574 int cpu, u64 timestamp, struct thread *thread) 1574 int cpu, u64 timestamp, struct thread *thread)
1575{ 1575{
1576 struct raw_event_sample *raw = more_data; 1576 struct raw_event_sample *raw;
1577 struct event *event; 1577 struct event *event;
1578 int type; 1578 int type;
1579 1579
1580 raw = malloc_or_die(sizeof(*raw)+size);
1581 raw->size = size;
1582 memcpy(raw->data, data, size);
1583
1580 type = trace_parse_common_type(raw->data); 1584 type = trace_parse_common_type(raw->data);
1581 event = trace_find_event(type); 1585 event = trace_find_event(type);
1582 1586
@@ -1629,7 +1633,8 @@ static int process_sample_event(event_t *event)
1629 if (profile_cpu != -1 && profile_cpu != (int)data.cpu) 1633 if (profile_cpu != -1 && profile_cpu != (int)data.cpu)
1630 return 0; 1634 return 0;
1631 1635
1632 process_raw_event(event, data.raw_data, data.cpu, data.time, thread); 1636 process_raw_event(event, data.raw_size, data.raw_data, data.cpu,
1637 data.time, thread);
1633 1638
1634 return 0; 1639 return 0;
1635} 1640}