| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef _CRASH_REPORTER_KERNEL_COLLECTOR_H_ | 5 #ifndef _CRASH_REPORTER_KERNEL_COLLECTOR_H_ |
| 6 #define _CRASH_REPORTER_KERNEL_COLLECTOR_H_ | 6 #define _CRASH_REPORTER_KERNEL_COLLECTOR_H_ |
| 7 | 7 |
| 8 #include <pcrecpp.h> | 8 #include <pcrecpp.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
| 13 #include "crash-reporter/crash_collector.h" | 13 #include "crash-reporter/crash_collector.h" |
| 14 #include "gtest/gtest_prod.h" // for FRIEND_TEST | 14 #include "gtest/gtest_prod.h" // for FRIEND_TEST |
| 15 | 15 |
| 16 class FilePath; | 16 class FilePath; |
| 17 | 17 |
| 18 // Kernel crash collector. | 18 // Kernel crash collector. |
| 19 class KernelCollector : public CrashCollector { | 19 class KernelCollector : public CrashCollector { |
| 20 public: | 20 public: |
| 21 // Enumeration to specify architecture type. |
| 22 enum ArchKind { |
| 23 archArm, // ARM variant. |
| 24 archX86, // X86 variant. |
| 25 archUnknown, // We don't know. |
| 26 |
| 27 archCount // Number of architectures. |
| 28 }; |
| 29 |
| 21 KernelCollector(); | 30 KernelCollector(); |
| 22 | 31 |
| 23 virtual ~KernelCollector(); | 32 virtual ~KernelCollector(); |
| 24 | 33 |
| 25 void OverridePreservedDumpPath(const FilePath &file_path); | 34 void OverridePreservedDumpPath(const FilePath &file_path); |
| 26 | 35 |
| 27 // Enable collection. | 36 // Enable collection. |
| 28 bool Enable(); | 37 bool Enable(); |
| 29 | 38 |
| 30 // Returns true if the kernel collection currently enabled. | 39 // Returns true if the kernel collection currently enabled. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 55 unsigned *hash, | 64 unsigned *hash, |
| 56 float *last_stack_timestamp); | 65 float *last_stack_timestamp); |
| 57 bool FindCrashingFunction(pcrecpp::StringPiece kernel_dump, | 66 bool FindCrashingFunction(pcrecpp::StringPiece kernel_dump, |
| 58 bool print_diagnostics, | 67 bool print_diagnostics, |
| 59 float stack_trace_timestamp, | 68 float stack_trace_timestamp, |
| 60 std::string *crashing_function); | 69 std::string *crashing_function); |
| 61 bool FindPanicMessage(pcrecpp::StringPiece kernel_dump, | 70 bool FindPanicMessage(pcrecpp::StringPiece kernel_dump, |
| 62 bool print_diagnostics, | 71 bool print_diagnostics, |
| 63 std::string *panic_message); | 72 std::string *panic_message); |
| 64 | 73 |
| 74 // Returns the architecture kind for which we are build - enum ArchKind |
| 75 enum ArchKind GetArch(void); |
| 76 |
| 65 bool is_enabled_; | 77 bool is_enabled_; |
| 66 FilePath preserved_dump_path_; | 78 FilePath preserved_dump_path_; |
| 67 static const char kClearingSequence[]; | 79 static const char kClearingSequence[]; |
| 68 }; | 80 }; |
| 69 | 81 |
| 70 #endif // _CRASH_REPORTER_KERNEL_COLLECTOR_H_ | 82 #endif // _CRASH_REPORTER_KERNEL_COLLECTOR_H_ |
| OLD | NEW |