public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG] perf record: does not propagate command error code
@ 2014-04-08 18:17 Stephane Eranian
  2014-04-16  0:30 ` [PATCH 1/2] perf record: Propagate exit status of a command line workload Namhyung Kim
  0 siblings, 1 reply; 5+ messages in thread
From: Stephane Eranian @ 2014-04-08 18:17 UTC (permalink / raw)
  To: LKML
  Cc: Arnaldo Carvalho de Melo, Jiri Olsa, Namhyung Kim, mingo@elte.hu,
	Peter Zijlstra

Hi,

There is a discrepancy in the way perf stat and perf record propagate
command error code back when they launch a process:

$ perf record -e cycles false && echo "yes" || echo "no"
yes

That's wrong!

But perf stat:

$ perf stat -e cycles false && echo "yes" || echo "no"
no

That's correct!

You want the error to be propagated back because it helps
catch errors in monitoring scripts.

I looked at the perf record code handling the error from the child.
It is complicated and uses atexit() to cleanup the child. It is hard
to get the child exit status back. I wonder why this was handled
that way.

Anybody has a fix for this?

Thanks

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

end of thread, other threads:[~2014-04-17  8:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-08 18:17 [BUG] perf record: does not propagate command error code Stephane Eranian
2014-04-16  0:30 ` [PATCH 1/2] perf record: Propagate exit status of a command line workload Namhyung Kim
2014-04-16  0:30   ` [PATCH 2/2] perf tools: Get rid of on_exit() feature test Namhyung Kim
2014-04-16 13:34   ` [PATCH 1/2] perf record: Propagate exit status of a command line workload Jiri Olsa
2014-04-17  8:21     ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox