perf report: Fix --no-call-chain option handling
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 5 Jan 2010 13:54:45 +0000 (11:54 -0200)
committerIngo Molnar <mingo@elte.hu>
Wed, 13 Jan 2010 09:09:10 +0000 (10:09 +0100)
commitb9a63b9b56d6910a25e3d4905525aef150420a9b
treefb31094583f801d9ceae0bfea465244c07686b90
parentde1764892a61a3ed212973cc028c80dd083179dd
perf report: Fix --no-call-chain option handling

To avoid the funny:

 [root@doppio ~]# perf record -a -f sleep 2s
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.334 MB perf.data (~14572 samples) ]
 [root@doppio ~]# perf report --no-call-graph
 selected -g but no callchain data. Did you call perf record without -g?

And fix the bug reported by peterz when we do indeed record with
callchains and then ask for a report without:

[root@doppio ~]# perf record -a -g -f sleep 2s
[root@doppio ~]# perf report --no-call-graph
Segmentation fault
[root@doppio ~]#

Reported-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1262699685-27820-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/builtin-report.c