All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] perf: Fix timechart header handling
@ 2009-12-06 11:07 OGAWA Hirofumi
  2009-12-06 11:08 ` [PATCH 2/3] perf: make common SAMPLE_EVENT parser OGAWA Hirofumi
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: OGAWA Hirofumi @ 2009-12-06 11:07 UTC (permalink / raw)
  To: Peter Zijlstra, Paul Mackerras, Ingo Molnar; +Cc: linux-kernel

Hi,

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>
---

 tools/perf/builtin-timechart.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff -puN tools/perf/builtin-timechart.c~perf-fix-timechart-header-handling tools/perf/builtin-timechart.c
--- linux-2.6/tools/perf/builtin-timechart.c~perf-fix-timechart-header-handling	2009-12-06 19:27:33.000000000 +0900
+++ linux-2.6-hirofumi/tools/perf/builtin-timechart.c	2009-12-06 19:27:44.000000000 +0900
@@ -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 {
@@ -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)
@@ -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;
 
_

-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-12-06 17:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-06 11:07 [PATCH 1/3] perf: Fix timechart header handling OGAWA Hirofumi
2009-12-06 11:08 ` [PATCH 2/3] perf: make common SAMPLE_EVENT parser OGAWA Hirofumi
2009-12-06 11:10   ` [PATCH 3/3] perf: misc small fixes OGAWA Hirofumi
2009-12-06 17:19     ` [tip:perf/urgent] perf tools: Misc " tip-bot for OGAWA Hirofumi
2009-12-06 17:18   ` [tip:perf/urgent] perf: Make common SAMPLE_EVENT parser tip-bot for OGAWA Hirofumi
2009-12-06 11:54 ` [PATCH 1/3] perf: Fix timechart header handling Ingo Molnar
2009-12-06 12:11   ` OGAWA Hirofumi
2009-12-06 12:13     ` Ingo Molnar
2009-12-06 12:22       ` OGAWA Hirofumi
2009-12-06 17:18 ` [tip:perf/urgent] perf timechart: Fix " tip-bot for OGAWA Hirofumi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.