Re: [PATCH] perf stat: Do not show stats if workload fails
From: Ingo Molnar
Date: Fri Dec 20 2013 - 02:58:10 EST
* David Ahern <dsahern@xxxxxxxxx> wrote:
> Currently perf-stat attempts to show counter stats even if the workload
> is bogus:
>
> $ perf stat -- foo
> foo: No such file or directory
>
> Performance counter stats for 'foo':
>
> <not counted> task-clock
> <not counted> context-switches
> <not counted> cpu-migrations
> <not counted> page-faults
> <not counted> cycles
> <not counted> stalled-cycles-frontend
> <not counted> stalled-cycles-backend
> <not counted> instructions
> <not counted> branches
> <not counted> branch-misses
>
> 0.009769943 seconds time elapsed
>
> It is impossible to differentiate all the failure modes, but it seems
> reasonable that if the workload handling fails, perf-stat should not try
> to print stats.
>
> With this change:
>
> $ perf stat -v -- foo
> Failed to start workload
>
> Signed-off-by: David Ahern <dsahern@xxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Nice!
Acked-by: Ingo Molnar <mingo@xxxxxxxxxx>
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/