Skip to content

Commit

Permalink
perf timechart: Fix header handling
Browse files Browse the repository at this point in the history
Update "struct trace_entry" to match with current one. And
remove "size" field from it.

If it has "size", it become cause of alignment mismatch of
structure with kernel.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Acked-by: Arjan van de Ven <arjan@infradead.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <87ljhg8ioe.fsf@devron.myhome.or.jp>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
OGAWA Hirofumi authored and Ingo Molnar committed Dec 6, 2009
1 parent be2bf0a commit 028c515
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tools/perf/builtin-timechart.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,11 @@ process_exit_event(event_t *event)
}

struct trace_entry {
u32 size;
unsigned short type;
unsigned char flags;
unsigned char preempt_count;
int pid;
int tgid;
int lock_depth;
};

struct power_entry {
Expand Down Expand Up @@ -489,6 +488,7 @@ process_sample_event(event_t *event)
u64 stamp = 0;
u32 cpu = 0;
u32 pid = 0;
u32 size, *size_ptr;
struct trace_entry *te;

if (sample_type & PERF_SAMPLE_IP)
Expand Down Expand Up @@ -518,9 +518,13 @@ process_sample_event(event_t *event)
if (sample_type & PERF_SAMPLE_PERIOD)
cursor++;

te = (void *)&event->sample.array[cursor];
size_ptr = (void *)&event->sample.array[cursor];

if (sample_type & PERF_SAMPLE_RAW && te->size > 0) {
size = *size_ptr;
size_ptr++;

te = (void *)size_ptr;
if (sample_type & PERF_SAMPLE_RAW && size > 0) {
char *event_str;
struct power_entry *pe;

Expand Down

0 comments on commit 028c515

Please sign in to comment.