diff options
author | Leo Yan <[email protected]> | 2018-06-18 13:09:55 +0800 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2018-07-24 14:48:32 -0300 |
commit | 6cd4ac6a02c9bc6560faf567ac013902ab9cd039 (patch) | |
tree | 64fd7d4f91a18232f88f5a3fe9aa264652a18492 | |
parent | 6abf0f451087176caf0f9ad0cc2a79bcc5ebb443 (diff) |
perf cs-etm: Bail out immediately for instruction sample failure
If the instruction sample failure has happened, it isn't necessary to
execute to the end of the function cs_etm__flush(). This commit is to
bail out immediately and return the error code.
Signed-off-by: Leo Yan <[email protected]>
Reviewed-by: Mathieu Poirier <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Kim Phillips <[email protected]>
Cc: Mike Leach <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Robert Walker <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r-- | tools/perf/util/cs-etm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 822ba915d144..8b2c099e750a 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -939,6 +939,9 @@ static int cs_etm__flush(struct cs_etm_queue *etmq) err = cs_etm__synth_instruction_sample( etmq, addr, etmq->period_instructions); + if (err) + return err; + etmq->period_instructions = 0; /* |