Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223847
b: refs/heads/master
c: 068ffaa
h: refs/heads/master
i:
  223845: cd3eb41
  223843: 8ce0671
  223839: 0d8a730
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Nov 27, 2010
1 parent cbb6920 commit 2a9c4e2
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 008f29d3865828bb27e35d6d3fa889d0853b469f
refs/heads/master: 068ffaa8bfb67c2ddb3ecaf38cc90f94a1a92fe3
11 changes: 11 additions & 0 deletions trunk/tools/perf/util/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ int dump_printf(const char *fmt, ...)
return ret;
}

#ifdef NO_NEWT_SUPPORT
void ui__warning(const char *format, ...)
{
va_list args;

va_start(args, format);
vfprintf(stderr, format, args);
va_end(args);
}
#endif

static int dump_printf_color(const char *fmt, const char *color, ...)
{
va_list args;
Expand Down
2 changes: 2 additions & 0 deletions trunk/tools/perf/util/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ int ui_helpline__show_help(const char *format, va_list ap);
#include "ui/progress.h"
#endif

void ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2)));

#endif /* __PERF_DEBUG_H */
18 changes: 18 additions & 0 deletions trunk/tools/perf/util/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,24 @@ int __perf_session__process_events(struct perf_session *self,
flush_sample_queue(self, ops);
out_err:
ui_progress__delete(progress);

if (ops->lost == event__process_lost &&
self->hists.stats.total_lost != 0) {
ui__warning("Processed %Lu events and LOST %Lu!\n\n"
"Check IO/CPU overload!\n\n",
self->hists.stats.total_period,
self->hists.stats.total_lost);
}

if (self->hists.stats.nr_unknown_events != 0) {
ui__warning("Found %u unknown events!\n\n"
"Is this an older tool processing a perf.data "
"file generated by a more recent tool?\n\n"
"If that is not the case, consider "
"reporting to linux-kernel@vger.kernel.org.\n\n",
self->hists.stats.nr_unknown_events);
}

return err;
}

Expand Down
16 changes: 15 additions & 1 deletion trunk/tools/perf/util/ui/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,24 @@ int ui__help_window(const char *text)
return rc;
}

static const char yes[] = "Yes", no[] = "No";
static const char yes[] = "Yes", no[] = "No",
warning_str[] = "Warning!", ok[] = "Ok";

bool ui__dialog_yesno(const char *msg)
{
/* newtWinChoice should really be accepting const char pointers... */
return newtWinChoice(NULL, (char *)yes, (char *)no, (char *)msg) == 1;
}

void ui__warning(const char *format, ...)
{
va_list args;

va_start(args, format);
if (use_browser > 0)
newtWinMessagev((char *)warning_str, (char *)ok,
(char *)format, args);
else
vfprintf(stderr, format, args);
va_end(args);
}

0 comments on commit 2a9c4e2

Please sign in to comment.