All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn@suse.de>
To: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>, linux-perf-users@vger.kernel.org
Subject: perf timechart broken
Date: Fri, 7 Jan 2011 11:04:37 +0100	[thread overview]
Message-ID: <201101071104.37576.trenn@suse.de> (raw)

Hi,

Latest x86 tip has another perf timechart issue introduce
by latest commits.

./perf timechart
gives me:
"no trace data in the file"

I reverted  the latest changes and things seem to break
between d854861c4292a4e675a5d3bfd862c5f7421c81e8
and
69aad6f1ee69546dea8535ab8f3da9f445d57328
(linux-2.6-x86 tree ids)

Be aware that ./perf timechart is currently broken
and segfaults on idle events (in 2.6.36 and 2.6.37).
I submitted a patch to stable@ but it did not get accepted,
becaust it's not mainline yet.
I concentrated on my latest patches instead of making sure
the tiny fix gets into 2.6.37 first.

Ingo: It's a bit late for 2.6.37, if there is any chance
to still get it in, the patch below is against linus master...
otherwise I'll submit it for stable 36+37 asap.

Anyway to test above regression this mail is about, first
apply below patch otherwise you get a segfault if idle
(power_start/end) events got logged.

Thanks,

   Thomas

---
perf timechart: Fix segfault on cpu idle (power_start/end) events

power_end event does not have type and other attributes and thus does
not match struct power_event.
Another struct could be created, but data.cpu is fine for fixing the segfault
and will work as long as C-states got initiated on the same CPU the idle state
takes place which is the case for all recent HW.

The power_start/end events get deprecated anyway, thus this is an easy,
riskless and sufficient solution for the segfault problem.

Signed-off-by: Thomas Renninger <trenn@suse.de>
CC: mingo@elte.hu
CC: arjan@linux.intel.com

---
 tools/perf/builtin-timechart.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index 9bcc38f..b3028eb 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -502,7 +502,7 @@ static int process_sample_event(event_t *event, struct perf_session *session)
 			c_state_start(pe->cpu_id, data.time, pe->value);
 
 		if (strcmp(event_str, "power:power_end") == 0)
-			c_state_end(pe->cpu_id, data.time);
+			c_state_end(data.cpu, data.time);
 
 		if (strcmp(event_str, "power:power_frequency") == 0)
 			p_state_change(pe->cpu_id, data.time, pe->value);

             reply	other threads:[~2011-01-07 10:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07 10:04 Thomas Renninger [this message]
2011-01-07 12:33 ` perf timechart broken Ingo Molnar
2011-01-11  1:36 ` Frederic Weisbecker
2011-01-11  8:55   ` Thomas Renninger
2011-01-11 11:49     ` Arnaldo Carvalho de Melo
2011-01-11 14:51       ` Arnaldo Carvalho de Melo
2011-01-14 16:49         ` Thomas Renninger
2011-01-14 17:37           ` Arnaldo Carvalho de Melo
2011-01-11 18:56     ` David Ahern
2011-01-14 17:00       ` Thomas Renninger
2011-01-14 17:09         ` David Ahern
2011-01-17 10:50           ` Thomas Renninger

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=201101071104.37576.trenn@suse.de \
    --to=trenn@suse.de \
    --cc=acme@redhat.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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 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.