linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] perf: cannot read counts in per-process mode in 3.17-rcX
@ 2014-09-08 12:35 Stephane Eranian
  2014-09-08 12:49 ` Jiri Olsa
  0 siblings, 1 reply; 8+ messages in thread
From: Stephane Eranian @ 2014-09-08 12:35 UTC (permalink / raw)
  To: LKML
  Cc: Peter Zijlstra, Jiri Olsa, mingo, Arnaldo Carvalho de Melo,
	Namhyung Kim, ak, David Ahern

Hi,

It seems something is seriously broken with perf_events in
3.17-rcX. I have tried rc3, rc4. No way to get any counts
out using perf stat in per-process mode. I am trying on Intel
and the PMU is correctly detected:

$ perf stat -e cycles ls
      <not counted> cycles

It is not a permission problem. It is a read problem!
$ strace perf stat -e cycles ls

perf_event_open(0x27d7e20, 2261, -1, -1, 0x8 /* PERF_FLAG_??? */) = 3
write(6, "\0", 1)                       = 1
close(6)                                = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 2261
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=2261,
si_status=0, si_utime=0, si_stime=0} ---
rt_sigreturn()                          = 2261
read(3, "", 24)                         = 0
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Looks like read() on the perf returns 0 (nothing read!).

It seems to work fine in system-wide mode. So I bet  there were some
recent changes in the way the events are stored when the process
terminates.

I think the perf tool is not to blame here. I see the same problem with my
libpfm4 toy examples.

Can you reproduce the problem on your system?

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

end of thread, other threads:[~2014-09-16 10:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-08 12:35 [BUG] perf: cannot read counts in per-process mode in 3.17-rcX Stephane Eranian
2014-09-08 12:49 ` Jiri Olsa
2014-09-08 13:21   ` Stephane Eranian
2014-09-08 14:31     ` [PATCH] perf: Do not check PERF_EVENT_STATE_EXIT on syscall read path Jiri Olsa
2014-09-08 15:22       ` Peter Zijlstra
2014-09-10 13:49         ` Stephane Eranian
2014-09-15 10:29           ` Stephane Eranian
2014-09-16 10:58       ` [tip:perf/core] " tip-bot for Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).