diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-11-26 23:41:01 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-11-26 23:41:01 -0500 |
commit | 068ffaa8bfb67c2ddb3ecaf38cc90f94a1a92fe3 (patch) | |
tree | 7e57995a5a2844f9a2d33859216b5f4b55e47f14 | |
parent | 008f29d3865828bb27e35d6d3fa889d0853b469f (diff) |
perf tools: Fix lost and unknown events handling
Fix it by explaining what can be happening and giving the number of processed
and lost events.
Also holler if unknown events were found, that can be due to processing a
perf.data file collected using a newer tool where newer events got added on
reporting using an older perf tool, that or a bug, so ask for a report to be
made.
Works on both --tui and --stdio.
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
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>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/util/debug.c | 11 | ||||
-rw-r--r-- | tools/perf/util/debug.h | 2 | ||||
-rw-r--r-- | tools/perf/util/session.c | 18 | ||||
-rw-r--r-- | tools/perf/util/ui/util.c | 16 |
4 files changed, 46 insertions, 1 deletions
diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c index c8d81b00089d..e5161e8f9915 100644 --- a/tools/perf/util/debug.c +++ b/tools/perf/util/debug.c | |||
@@ -46,6 +46,17 @@ int dump_printf(const char *fmt, ...) | |||
46 | return ret; | 46 | return ret; |
47 | } | 47 | } |
48 | 48 | ||
49 | #ifdef NO_NEWT_SUPPORT | ||
50 | void ui__warning(const char *format, ...) | ||
51 | { | ||
52 | va_list args; | ||
53 | |||
54 | va_start(args, format); | ||
55 | vfprintf(stderr, format, args); | ||
56 | va_end(args); | ||
57 | } | ||
58 | #endif | ||
59 | |||
49 | static int dump_printf_color(const char *fmt, const char *color, ...) | 60 | static int dump_printf_color(const char *fmt, const char *color, ...) |
50 | { | 61 | { |
51 | va_list args; | 62 | va_list args; |
diff --git a/tools/perf/util/debug.h b/tools/perf/util/debug.h index 7b514082bbaf..ca35fd66b5df 100644 --- a/tools/perf/util/debug.h +++ b/tools/perf/util/debug.h | |||
@@ -35,4 +35,6 @@ int ui_helpline__show_help(const char *format, va_list ap); | |||
35 | #include "ui/progress.h" | 35 | #include "ui/progress.h" |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | void ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2))); | ||
39 | |||
38 | #endif /* __PERF_DEBUG_H */ | 40 | #endif /* __PERF_DEBUG_H */ |
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 3d5604739493..3ae69550fa0b 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -852,6 +852,24 @@ done: | |||
852 | flush_sample_queue(self, ops); | 852 | flush_sample_queue(self, ops); |
853 | out_err: | 853 | out_err: |
854 | ui_progress__delete(progress); | 854 | ui_progress__delete(progress); |
855 | |||
856 | if (ops->lost == event__process_lost && | ||
857 | self->hists.stats.total_lost != 0) { | ||
858 | ui__warning("Processed %Lu events and LOST %Lu!\n\n" | ||
859 | "Check IO/CPU overload!\n\n", | ||
860 | self->hists.stats.total_period, | ||
861 | self->hists.stats.total_lost); | ||
862 | } | ||
863 | |||
864 | if (self->hists.stats.nr_unknown_events != 0) { | ||
865 | ui__warning("Found %u unknown events!\n\n" | ||
866 | "Is this an older tool processing a perf.data " | ||
867 | "file generated by a more recent tool?\n\n" | ||
868 | "If that is not the case, consider " | ||
869 | "reporting to linux-kernel@vger.kernel.org.\n\n", | ||
870 | self->hists.stats.nr_unknown_events); | ||
871 | } | ||
872 | |||
855 | return err; | 873 | return err; |
856 | } | 874 | } |
857 | 875 | ||
diff --git a/tools/perf/util/ui/util.c b/tools/perf/util/ui/util.c index 056c69521a38..7b5a8926624e 100644 --- a/tools/perf/util/ui/util.c +++ b/tools/perf/util/ui/util.c | |||
@@ -104,10 +104,24 @@ out_destroy_form: | |||
104 | return rc; | 104 | return rc; |
105 | } | 105 | } |
106 | 106 | ||
107 | static const char yes[] = "Yes", no[] = "No"; | 107 | static const char yes[] = "Yes", no[] = "No", |
108 | warning_str[] = "Warning!", ok[] = "Ok"; | ||
108 | 109 | ||
109 | bool ui__dialog_yesno(const char *msg) | 110 | bool ui__dialog_yesno(const char *msg) |
110 | { | 111 | { |
111 | /* newtWinChoice should really be accepting const char pointers... */ | 112 | /* newtWinChoice should really be accepting const char pointers... */ |
112 | return newtWinChoice(NULL, (char *)yes, (char *)no, (char *)msg) == 1; | 113 | return newtWinChoice(NULL, (char *)yes, (char *)no, (char *)msg) == 1; |
113 | } | 114 | } |
115 | |||
116 | void ui__warning(const char *format, ...) | ||
117 | { | ||
118 | va_list args; | ||
119 | |||
120 | va_start(args, format); | ||
121 | if (use_browser > 0) | ||
122 | newtWinMessagev((char *)warning_str, (char *)ok, | ||
123 | (char *)format, args); | ||
124 | else | ||
125 | vfprintf(stderr, format, args); | ||
126 | va_end(args); | ||
127 | } | ||