diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-29 01:57:07 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-29 01:57:07 +0100 |
commit | f5f29b1aa55aba06498171ad64421424372f1682 (patch) | |
tree | 5b026498c30187d85e33ff2fbe1f7c59f934145a /lib | |
parent | f369ec1fa4e2886ce01aeea51044d15f0407fed3 (diff) | |
download | abrt-f5f29b1aa55aba06498171ad64421424372f1682.tar.gz abrt-f5f29b1aa55aba06498171ad64421424372f1682.tar.xz abrt-f5f29b1aa55aba06498171ad64421424372f1682.zip |
dumpoops: add -s option to dump results to stdout
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Plugins/KerneloopsScanner.cpp | 3 | ||||
-rw-r--r-- | lib/Plugins/KerneloopsScanner.h | 10 | ||||
-rw-r--r-- | lib/Plugins/KerneloopsSysLog.cpp | 38 |
3 files changed, 29 insertions, 22 deletions
diff --git a/lib/Plugins/KerneloopsScanner.cpp b/lib/Plugins/KerneloopsScanner.cpp index 14eb72a8..4caa4593 100644 --- a/lib/Plugins/KerneloopsScanner.cpp +++ b/lib/Plugins/KerneloopsScanner.cpp @@ -31,6 +31,7 @@ #include "DebugDump.h" #include "ABRTException.h" #include "CommLayerInner.h" +#include "KerneloopsSysLog.h" #include "KerneloopsScanner.h" @@ -202,7 +203,7 @@ PLUGIN_INFO(ACTION, "http://people.redhat.com/aarapov", ""); -/* for dumpoops tool */ +/* For "dumpoops" tool */ extern "C" { int scan_syslog_file(CKerneloopsScanner *This, const char *filename) diff --git a/lib/Plugins/KerneloopsScanner.h b/lib/Plugins/KerneloopsScanner.h index caa5f72d..6ac0461f 100644 --- a/lib/Plugins/KerneloopsScanner.h +++ b/lib/Plugins/KerneloopsScanner.h @@ -27,7 +27,7 @@ #ifndef KERNELOOPSSCANNER_H_ #define KERNELOOPSSCANNER_H_ -#include "KerneloopsSysLog.h" +#include "abrt_types.h" #include "Plugin.h" #include "Action.h" @@ -35,15 +35,19 @@ class CKerneloopsScanner : public CAction { private: std::string m_sSysLogFile; - vector_string_t m_pOopsList; + /* For "dumpoops" tool */ public: + vector_string_t m_pOopsList; + /* For "dumpoops" tool */ + public: void SaveOopsToDebugDump(); int ScanDmesg(); int ScanSysLogFile(const char *filename); /* Plugin interface */ + public: CKerneloopsScanner(); virtual void Run(const std::string& pActionDir, const std::string& pArgs); @@ -51,4 +55,4 @@ class CKerneloopsScanner : public CAction virtual map_plugin_settings_t GetSettings(); }; -#endif /* KERNELOOPSSCANNER_H_ */ +#endif diff --git a/lib/Plugins/KerneloopsSysLog.cpp b/lib/Plugins/KerneloopsSysLog.cpp index d6f257ec..ed8ca17b 100644 --- a/lib/Plugins/KerneloopsSysLog.cpp +++ b/lib/Plugins/KerneloopsSysLog.cpp @@ -200,36 +200,36 @@ next_line: /* find start-of-oops markers */ if (strstr(c, "general protection fault:")) oopsstart = i; - if (strstr(c, "BUG:")) + else if (strstr(c, "BUG:")) oopsstart = i; - if (strstr(c, "kernel BUG at")) + else if (strstr(c, "kernel BUG at")) oopsstart = i; - if (strstr(c, "do_IRQ: stack overflow:")) + else if (strstr(c, "do_IRQ: stack overflow:")) oopsstart = i; - if (strstr(c, "RTNL: assertion failed")) + else if (strstr(c, "RTNL: assertion failed")) oopsstart = i; - if (strstr(c, "Eeek! page_mapcount(page) went negative!")) + else if (strstr(c, "Eeek! page_mapcount(page) went negative!")) oopsstart = i; - if (strstr(c, "near stack overflow (cur:")) + else if (strstr(c, "near stack overflow (cur:")) oopsstart = i; - if (strstr(c, "double fault:")) + else if (strstr(c, "double fault:")) oopsstart = i; - if (strstr(c, "Badness at")) + else if (strstr(c, "Badness at")) oopsstart = i; - if (strstr(c, "NETDEV WATCHDOG")) + else if (strstr(c, "NETDEV WATCHDOG")) oopsstart = i; - if (strstr(c, "WARNING:") && - !strstr(c, "appears to be on the same physical disk")) + else if (strstr(c, "WARNING:") && + !strstr(c, "appears to be on the same physical disk")) oopsstart = i; - if (strstr(c, "Unable to handle kernel")) + else if (strstr(c, "Unable to handle kernel")) oopsstart = i; - if (strstr(c, "sysctl table check failed")) + else if (strstr(c, "sysctl table check failed")) oopsstart = i; - if (strstr(c, "------------[ cut here ]------------")) + else if (strstr(c, "------------[ cut here ]------------")) oopsstart = i; - if (strstr(c, "list_del corruption.")) + else if (strstr(c, "list_del corruption.")) oopsstart = i; - if (strstr(c, "list_add corruption.")) + else if (strstr(c, "list_add corruption.")) oopsstart = i; if (strstr(c, "Oops:") && i >= 3) oopsstart = i-3; @@ -332,8 +332,10 @@ next_line: for (q = oopsstart; q <= oopsend; q++) { if (!is_version) is_version = extract_version(lines_info[q].ptr, version); - strcat(oops, lines_info[q].ptr); - strcat(oops, "\n"); + if (lines_info[q].ptr[0]) { + strcat(oops, lines_info[q].ptr); + strcat(oops, "\n"); + } } /* too short oopses are invalid */ if (strlen(oops) > 100) { |