aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-08-03 11:33:24 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-08-03 11:33:24 -0400
commit00894ce9b85887caa0c16e18757004b9cc9f64cf (patch)
tree0f64fd92048d0b782c7fa025625f97bb06391207 /tools
parent3e9f45a7a4179604ccbae1589de0e7165bc6fcd0 (diff)
perf report: Use ui__warning in some more places
So that we get a proper warning in the TUI in cases like: $ perf report --stdio -g fractal,0.5,caller --sort pid Selected -g but no callchain data. Did you call 'perf record' without -g? $ The --stdio case is ok because it uses fprintf, ui__warning is needed to figure out if --stdio or --tui is being used. Cc: Arun Sharma <asharma@fb.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sam Liao <phyomh@gmail.com> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-ag9fz2wd17mbbfjsbznq1wms@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-report.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index f854efda768..d7ff277bdb7 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -162,23 +162,22 @@ static int perf_session__setup_sample_type(struct perf_session *self)
162{ 162{
163 if (!(self->sample_type & PERF_SAMPLE_CALLCHAIN)) { 163 if (!(self->sample_type & PERF_SAMPLE_CALLCHAIN)) {
164 if (sort__has_parent) { 164 if (sort__has_parent) {
165 fprintf(stderr, "selected --sort parent, but no" 165 ui__warning("Selected --sort parent, but no "
166 " callchain data. Did you call" 166 "callchain data. Did you call "
167 " perf record without -g?\n"); 167 "'perf record' without -g?\n");
168 return -EINVAL; 168 return -EINVAL;
169 } 169 }
170 if (symbol_conf.use_callchain) { 170 if (symbol_conf.use_callchain) {
171 fprintf(stderr, "selected -g but no callchain data." 171 ui__warning("Selected -g but no callchain data. Did "
172 " Did you call perf record without" 172 "you call 'perf record' without -g?\n");
173 " -g?\n");
174 return -1; 173 return -1;
175 } 174 }
176 } else if (!dont_use_callchains && callchain_param.mode != CHAIN_NONE && 175 } else if (!dont_use_callchains && callchain_param.mode != CHAIN_NONE &&
177 !symbol_conf.use_callchain) { 176 !symbol_conf.use_callchain) {
178 symbol_conf.use_callchain = true; 177 symbol_conf.use_callchain = true;
179 if (callchain_register_param(&callchain_param) < 0) { 178 if (callchain_register_param(&callchain_param) < 0) {
180 fprintf(stderr, "Can't register callchain" 179 ui__warning("Can't register callchain "
181 " params\n"); 180 "params.\n");
182 return -EINVAL; 181 return -EINVAL;
183 } 182 }
184 } 183 }