perf_counter: Improve perf stat and perf record option parsing
authorAnton Blanchard <anton@samba.org>
Wed, 22 Jul 2009 13:04:12 +0000 (23:04 +1000)
committerPeter Zijlstra <a.p.zijlstra@chello.nl>
Wed, 22 Jul 2009 16:05:56 +0000 (18:05 +0200)
commita0541234f89c93f313961ce7b28676e11488a5f0
treeb6006cad6fc36f60c8c027f4b6493a8cc686c37f
parent7f453c24b95a085fc7bd35d53b33abc4dc5a048b
perf_counter: Improve perf stat and perf record option parsing

perf stat and perf record currently look for all options on the command
line. This can lead to some confusion:

# perf stat ls -l
  Error: unknown switch `l'

While we can work around this by adding '--' before the command, the git
option parsing code can stop at the first non option:

# perf stat ls -l
 Performance counter stats for 'ls -l':
....

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090722130412.GD9029@kryten>
tools/perf/builtin-record.c
tools/perf/builtin-stat.c