OLD | NEW |
1 // Copyright (c) 2010 Google Inc. | 1 // Copyright (c) 2010 Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 printf("CPU: %s\n", cpu.c_str()); | 796 printf("CPU: %s\n", cpu.c_str()); |
797 if (!cpu_info.empty()) { | 797 if (!cpu_info.empty()) { |
798 // This field is optional. | 798 // This field is optional. |
799 printf(" %s\n", cpu_info.c_str()); | 799 printf(" %s\n", cpu_info.c_str()); |
800 } | 800 } |
801 printf(" %d CPU%s\n", | 801 printf(" %d CPU%s\n", |
802 process_state.system_info()->cpu_count, | 802 process_state.system_info()->cpu_count, |
803 process_state.system_info()->cpu_count != 1 ? "s" : ""); | 803 process_state.system_info()->cpu_count != 1 ? "s" : ""); |
804 printf("\n"); | 804 printf("\n"); |
805 | 805 |
| 806 // Print GPU information |
| 807 string gl_version = process_state.system_info()->gl_version; |
| 808 string gl_vendor = process_state.system_info()->gl_vendor; |
| 809 string gl_renderer = process_state.system_info()->gl_renderer; |
| 810 printf("GPU:"); |
| 811 if (!gl_version.empty() || !gl_vendor.empty() || !gl_renderer.empty()) { |
| 812 printf(" %s\n", gl_version.c_str()); |
| 813 printf(" %s\n", gl_vendor.c_str()); |
| 814 printf(" %s\n", gl_renderer.c_str()); |
| 815 } else { |
| 816 printf(" UNKNOWN\n"); |
| 817 } |
| 818 printf("\n"); |
| 819 |
806 // Print crash information. | 820 // Print crash information. |
807 if (process_state.crashed()) { | 821 if (process_state.crashed()) { |
808 printf("Crash reason: %s\n", process_state.crash_reason().c_str()); | 822 printf("Crash reason: %s\n", process_state.crash_reason().c_str()); |
809 printf("Crash address: 0x%" PRIx64 "\n", process_state.crash_address()); | 823 printf("Crash address: 0x%" PRIx64 "\n", process_state.crash_address()); |
810 } else { | 824 } else { |
811 printf("No crash\n"); | 825 printf("No crash\n"); |
812 } | 826 } |
813 | 827 |
814 string assertion = process_state.assertion(); | 828 string assertion = process_state.assertion(); |
815 if (!assertion.empty()) { | 829 if (!assertion.empty()) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 | 872 |
859 PrintModules(process_state.modules(), | 873 PrintModules(process_state.modules(), |
860 process_state.modules_without_symbols(), | 874 process_state.modules_without_symbols(), |
861 process_state.modules_with_corrupt_symbols()); | 875 process_state.modules_with_corrupt_symbols()); |
862 } | 876 } |
863 | 877 |
864 void PrintProcessStateMachineReadable(const ProcessState& process_state) { | 878 void PrintProcessStateMachineReadable(const ProcessState& process_state) { |
865 // Print OS and CPU information. | 879 // Print OS and CPU information. |
866 // OS|{OS Name}|{OS Version} | 880 // OS|{OS Name}|{OS Version} |
867 // CPU|{CPU Name}|{CPU Info}|{Number of CPUs} | 881 // CPU|{CPU Name}|{CPU Info}|{Number of CPUs} |
| 882 // GPU|{GPU version}|{GPU vendor}|{GPU renderer} |
868 printf("OS%c%s%c%s\n", kOutputSeparator, | 883 printf("OS%c%s%c%s\n", kOutputSeparator, |
869 StripSeparator(process_state.system_info()->os).c_str(), | 884 StripSeparator(process_state.system_info()->os).c_str(), |
870 kOutputSeparator, | 885 kOutputSeparator, |
871 StripSeparator(process_state.system_info()->os_version).c_str()); | 886 StripSeparator(process_state.system_info()->os_version).c_str()); |
872 printf("CPU%c%s%c%s%c%d\n", kOutputSeparator, | 887 printf("CPU%c%s%c%s%c%d\n", kOutputSeparator, |
873 StripSeparator(process_state.system_info()->cpu).c_str(), | 888 StripSeparator(process_state.system_info()->cpu).c_str(), |
874 kOutputSeparator, | 889 kOutputSeparator, |
875 // this may be empty | 890 // this may be empty |
876 StripSeparator(process_state.system_info()->cpu_info).c_str(), | 891 StripSeparator(process_state.system_info()->cpu_info).c_str(), |
877 kOutputSeparator, | 892 kOutputSeparator, |
878 process_state.system_info()->cpu_count); | 893 process_state.system_info()->cpu_count); |
| 894 printf("GPU%c%s%c%s%c%s\n", kOutputSeparator, |
| 895 StripSeparator(process_state.system_info()->gl_version).c_str(), |
| 896 kOutputSeparator, |
| 897 StripSeparator(process_state.system_info()->gl_vendor).c_str(), |
| 898 kOutputSeparator, |
| 899 StripSeparator(process_state.system_info()->gl_renderer).c_str()); |
879 | 900 |
880 int requesting_thread = process_state.requesting_thread(); | 901 int requesting_thread = process_state.requesting_thread(); |
881 | 902 |
882 // Print crash information. | 903 // Print crash information. |
883 // Crash|{Crash Reason}|{Crash Address}|{Crashed Thread} | 904 // Crash|{Crash Reason}|{Crash Address}|{Crashed Thread} |
884 printf("Crash%c", kOutputSeparator); | 905 printf("Crash%c", kOutputSeparator); |
885 if (process_state.crashed()) { | 906 if (process_state.crashed()) { |
886 printf("%s%c0x%" PRIx64 "%c", | 907 printf("%s%c0x%" PRIx64 "%c", |
887 StripSeparator(process_state.crash_reason()).c_str(), | 908 StripSeparator(process_state.crash_reason()).c_str(), |
888 kOutputSeparator, process_state.crash_address(), kOutputSeparator); | 909 kOutputSeparator, process_state.crash_address(), kOutputSeparator); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 for (int thread_index = 0; thread_index < thread_count; ++thread_index) { | 941 for (int thread_index = 0; thread_index < thread_count; ++thread_index) { |
921 if (thread_index != requesting_thread) { | 942 if (thread_index != requesting_thread) { |
922 // Don't print the crash thread again, it was already printed. | 943 // Don't print the crash thread again, it was already printed. |
923 PrintStackMachineReadable(thread_index, | 944 PrintStackMachineReadable(thread_index, |
924 process_state.threads()->at(thread_index)); | 945 process_state.threads()->at(thread_index)); |
925 } | 946 } |
926 } | 947 } |
927 } | 948 } |
928 | 949 |
929 } // namespace google_breakpad | 950 } // namespace google_breakpad |
OLD | NEW |