Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933093AbaDHSRK (ORCPT ); Tue, 8 Apr 2014 14:17:10 -0400 Received: from mail-ob0-f171.google.com ([209.85.214.171]:33876 "EHLO mail-ob0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932644AbaDHSRI (ORCPT ); Tue, 8 Apr 2014 14:17:08 -0400 MIME-Version: 1.0 Date: Tue, 8 Apr 2014 11:17:07 -0700 Message-ID: Subject: [BUG] perf record: does not propagate command error code From: Stephane Eranian To: LKML Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , "mingo@elte.hu" , Peter Zijlstra Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/