Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(570)

Unified Diff: kernel_collector.h

Issue 3179006: Collect and send kernel crash diagnostics (Closed) Base URL: ssh://git@chromiumos-git//crash-reporter.git
Patch Set: Respond to reviews Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « crash_sender ('k') | kernel_collector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: kernel_collector.h
diff --git a/kernel_collector.h b/kernel_collector.h
new file mode 100644
index 0000000000000000000000000000000000000000..3e2944245957cf685e3a09c45ed5892648fcf7d1
--- /dev/null
+++ b/kernel_collector.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef _CRASH_REPORTER_KERNEL_COLLECTOR_H_
+#define _CRASH_REPORTER_KERNEL_COLLECTOR_H_
+
+#include <string>
+
+#include "base/file_path.h"
+#include "crash-reporter/crash_collector.h"
+#include "gtest/gtest_prod.h" // for FRIEND_TEST
+
+class FilePath;
+
+// Kernel crash collector.
+class KernelCollector : public CrashCollector {
+ public:
+ KernelCollector();
+
+ virtual ~KernelCollector();
+
+ void OverridePreservedDumpPath(const FilePath &file_path);
+
+ // Enable collection.
+ bool Enable();
+
+ // Returns true if the kernel collection currently enabled.
+ bool IsEnabled() {
+ return is_enabled_;
+ }
+
+ // Collect any preserved kernel crash dump. Returns true if there was
+ // a dump (even if there were problems storing the dump), false otherwise.
+ bool Collect();
+
+ private:
+ friend class KernelCollectorTest;
+ FRIEND_TEST(KernelCollectorTest, ClearPreservedDump);
+ FRIEND_TEST(KernelCollectorTest, GetKernelCrashPath);
+ FRIEND_TEST(KernelCollectorTest, LoadPreservedDump);
+ FRIEND_TEST(KernelCollectorTest, CollectOK);
+
+ bool LoadPreservedDump(std::string *contents);
+ bool ClearPreservedDump();
+ FilePath GetKernelCrashPath(const FilePath &root_crash_path,
+ time_t timestamp);
+
+ bool is_enabled_;
+ FilePath preserved_dump_path_;
+ static const char kClearingSequence[];
+};
+
+#endif // _CRASH_REPORTER_KERNEL_COLLECTOR_H_
« no previous file with comments | « crash_sender ('k') | kernel_collector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698