diff options
Diffstat (limited to 'tools/perf/util')
| -rw-r--r-- | tools/perf/util/session.c | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index b163dfd6cbc..6fb4694d05f 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
| @@ -838,6 +838,35 @@ static struct thread *perf_session__register_idle_thread(struct perf_session *se | |||
| 838 | return thread; | 838 | return thread; |
| 839 | } | 839 | } |
| 840 | 840 | ||
| 841 | static void perf_session__warn_about_errors(const struct perf_session *session, | ||
| 842 | const struct perf_event_ops *ops) | ||
| 843 | { | ||
| 844 | if (ops->lost == event__process_lost && | ||
| 845 | session->hists.stats.total_lost != 0) { | ||
| 846 | ui__warning("Processed %Lu events and LOST %Lu!\n\n" | ||
| 847 | "Check IO/CPU overload!\n\n", | ||
| 848 | session->hists.stats.total_period, | ||
| 849 | session->hists.stats.total_lost); | ||
| 850 | } | ||
| 851 | |||
| 852 | if (session->hists.stats.nr_unknown_events != 0) { | ||
| 853 | ui__warning("Found %u unknown events!\n\n" | ||
| 854 | "Is this an older tool processing a perf.data " | ||
| 855 | "file generated by a more recent tool?\n\n" | ||
| 856 | "If that is not the case, consider " | ||
| 857 | "reporting to linux-kernel@vger.kernel.org.\n\n", | ||
| 858 | session->hists.stats.nr_unknown_events); | ||
| 859 | } | ||
| 860 | |||
| 861 | if (session->hists.stats.nr_invalid_chains != 0) { | ||
| 862 | ui__warning("Found invalid callchains!\n\n" | ||
| 863 | "%u out of %u events were discarded for this reason.\n\n" | ||
| 864 | "Consider reporting to linux-kernel@vger.kernel.org.\n\n", | ||
| 865 | session->hists.stats.nr_invalid_chains, | ||
| 866 | session->hists.stats.nr_events[PERF_RECORD_SAMPLE]); | ||
| 867 | } | ||
| 868 | } | ||
| 869 | |||
| 841 | #define session_done() (*(volatile int *)(&session_done)) | 870 | #define session_done() (*(volatile int *)(&session_done)) |
| 842 | volatile int session_done; | 871 | volatile int session_done; |
| 843 | 872 | ||
| @@ -911,6 +940,7 @@ more: | |||
| 911 | done: | 940 | done: |
| 912 | err = 0; | 941 | err = 0; |
| 913 | out_err: | 942 | out_err: |
| 943 | perf_session__warn_about_errors(self, ops); | ||
| 914 | perf_session_free_sample_buffers(self); | 944 | perf_session_free_sample_buffers(self); |
| 915 | return err; | 945 | return err; |
| 916 | } | 946 | } |
| @@ -1023,32 +1053,7 @@ more: | |||
| 1023 | flush_sample_queue(session, ops); | 1053 | flush_sample_queue(session, ops); |
| 1024 | out_err: | 1054 | out_err: |
| 1025 | ui_progress__delete(progress); | 1055 | ui_progress__delete(progress); |
| 1026 | 1056 | perf_session__warn_about_errors(session, ops); | |
| 1027 | if (ops->lost == event__process_lost && | ||
| 1028 | session->hists.stats.total_lost != 0) { | ||
| 1029 | ui__warning("Processed %Lu events and LOST %Lu!\n\n" | ||
| 1030 | "Check IO/CPU overload!\n\n", | ||
| 1031 | session->hists.stats.total_period, | ||
| 1032 | session->hists.stats.total_lost); | ||
| 1033 | } | ||
| 1034 | |||
| 1035 | if (session->hists.stats.nr_unknown_events != 0) { | ||
| 1036 | ui__warning("Found %u unknown events!\n\n" | ||
| 1037 | "Is this an older tool processing a perf.data " | ||
| 1038 | "file generated by a more recent tool?\n\n" | ||
| 1039 | "If that is not the case, consider " | ||
| 1040 | "reporting to linux-kernel@vger.kernel.org.\n\n", | ||
| 1041 | session->hists.stats.nr_unknown_events); | ||
| 1042 | } | ||
| 1043 | |||
| 1044 | if (session->hists.stats.nr_invalid_chains != 0) { | ||
| 1045 | ui__warning("Found invalid callchains!\n\n" | ||
| 1046 | "%u out of %u events were discarded for this reason.\n\n" | ||
| 1047 | "Consider reporting to linux-kernel@vger.kernel.org.\n\n", | ||
| 1048 | session->hists.stats.nr_invalid_chains, | ||
| 1049 | session->hists.stats.nr_events[PERF_RECORD_SAMPLE]); | ||
| 1050 | } | ||
| 1051 | |||
| 1052 | perf_session_free_sample_buffers(session); | 1057 | perf_session_free_sample_buffers(session); |
| 1053 | return err; | 1058 | return err; |
| 1054 | } | 1059 | } |
