perf tools: Fix lost and unknown events handling
[linux-2.6.git] / tools / perf / util / session.c
index 3d56047..3ae6955 100644 (file)
@@ -852,6 +852,24 @@ done:
        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;
 }