mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, paulus@samba.org, hpa@zytor.com,
	mingo@redhat.com, a.p.zijlstra@chello.nl, arjan@infradead.org,
	hirofumi@mail.parknet.co.jp, tglx@linutronix.de, mingo@elte.hu
Subject: [tip:perf/urgent] perf timechart: Fix header handling
Date: Sun, 6 Dec 2009 17:18:40 GMT	[thread overview]
Message-ID: <tip-028c515253761084c6594bf9ac9b194b51d87065@git.kernel.org> (raw)
In-Reply-To: <87ljhg8ioe.fsf@devron.myhome.or.jp>

Commit-ID:  028c515253761084c6594bf9ac9b194b51d87065
Gitweb:     http://git.kernel.org/tip/028c515253761084c6594bf9ac9b194b51d87065
Author:     OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
AuthorDate: Sun, 6 Dec 2009 20:07:29 +0900
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sun, 6 Dec 2009 18:15:01 +0100

perf timechart: Fix header handling

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>
---
 tools/perf/builtin-timechart.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index cb58b66..c0f29ed 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -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;
 

      parent reply	other threads:[~2009-12-06 17:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-06 11:07 [PATCH 1/3] perf: Fix timechart " 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-bot for OGAWA Hirofumi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-028c515253761084c6594bf9ac9b194b51d87065@git.kernel.org \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=a.p.zijlstra@chello.nl \
    --cc=arjan@infradead.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome