Skip to content
Commit 51433ead authored by Michael Petlan's avatar Michael Petlan Committed by Arnaldo Carvalho de Melo
Browse files

perf stat: Avoid segfaults caused by negated options



Some 'perf stat' options do not make sense to be negated (event,
cgroup), some do not have negated path implemented (metrics). Due to
that, it is better to disable the "no-" prefix for them, since
otherwise, the later opt-parsing segfaults.

Before:

  $ perf stat --no-metrics -- ls
  Segmentation fault (core dumped)

After:

  $ perf stat --no-metrics -- ls
   Error: option `no-metrics' isn't available
   Usage: perf stat [<options>] [<command>]

Signed-off-by: default avatarMichael Petlan <mpetlan@redhat.com>
Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
LPU-Reference: 1485912065.62416880.1544457604340.JavaMail.zimbra@redhat.com
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 4eaf97e8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment