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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « crash_sender ('k') | kernel_collector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef _CRASH_REPORTER_KERNEL_COLLECTOR_H_
6 #define _CRASH_REPORTER_KERNEL_COLLECTOR_H_
7
8 #include <string>
9
10 #include "base/file_path.h"
11 #include "crash-reporter/crash_collector.h"
12 #include "gtest/gtest_prod.h" // for FRIEND_TEST
13
14 class FilePath;
15
16 // Kernel crash collector.
17 class KernelCollector : public CrashCollector {
18 public:
19 KernelCollector();
20
21 virtual ~KernelCollector();
22
23 void OverridePreservedDumpPath(const FilePath &file_path);
24
25 // Enable collection.
26 bool Enable();
27
28 // Returns true if the kernel collection currently enabled.
29 bool IsEnabled() {
30 return is_enabled_;
31 }
32
33 // Collect any preserved kernel crash dump. Returns true if there was
34 // a dump (even if there were problems storing the dump), false otherwise.
35 bool Collect();
36
37 private:
38 friend class KernelCollectorTest;
39 FRIEND_TEST(KernelCollectorTest, ClearPreservedDump);
40 FRIEND_TEST(KernelCollectorTest, GetKernelCrashPath);
41 FRIEND_TEST(KernelCollectorTest, LoadPreservedDump);
42 FRIEND_TEST(KernelCollectorTest, CollectOK);
43
44 bool LoadPreservedDump(std::string *contents);
45 bool ClearPreservedDump();
46 FilePath GetKernelCrashPath(const FilePath &root_crash_path,
47 time_t timestamp);
48
49 bool is_enabled_;
50 FilePath preserved_dump_path_;
51 static const char kClearingSequence[];
52 };
53
54 #endif // _CRASH_REPORTER_KERNEL_COLLECTOR_H_
OLDNEW
« 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