diff options
author | Nikola Pajkovsky <npajkovs@redhat.com> | 2011-05-16 14:02:10 +0200 |
---|---|---|
committer | Nikola Pajkovsky <npajkovs@redhat.com> | 2011-05-19 09:59:52 +0200 |
commit | 1edb8cb72e7fe7912b94c12d35ea0d5a1a4bb86c (patch) | |
tree | e810c600c6361f98051450d401b882f595e00323 /src/plugins | |
parent | bff5a712e09174b055fa1ed57ffbc4f08629cb25 (diff) | |
download | abrt-1edb8cb72e7fe7912b94c12d35ea0d5a1a4bb86c.tar.gz abrt-1edb8cb72e7fe7912b94c12d35ea0d5a1a4bb86c.tar.xz abrt-1edb8cb72e7fe7912b94c12d35ea0d5a1a4bb86c.zip |
reenable kernel taint
abrt-dump-oops stores two new files into dump dir. kernel_tainted_short which is
representation of kernel tainted value (P----T). kernel_tainted_long contains human
readable strings of short version
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/abrt-action-bugzilla.c | 63 | ||||
-rw-r--r-- | src/plugins/abrt-dump-oops.c | 14 | ||||
-rw-r--r-- | src/plugins/rhbz.c | 19 |
3 files changed, 20 insertions, 76 deletions
diff --git a/src/plugins/abrt-action-bugzilla.c b/src/plugins/abrt-action-bugzilla.c index ee678fe8..e56ce99b 100644 --- a/src/plugins/abrt-action-bugzilla.c +++ b/src/plugins/abrt-action-bugzilla.c @@ -24,69 +24,6 @@ #define XML_RPC_SUFFIX "/xmlrpc.cgi" -/* From RHEL6 kernel/panic.c: - * { TAINT_PROPRIETARY_MODULE, 'P', 'G' }, - * { TAINT_FORCED_MODULE, 'F', ' ' }, - * { TAINT_UNSAFE_SMP, 'S', ' ' }, - * { TAINT_FORCED_RMMOD, 'R', ' ' }, - * { TAINT_MACHINE_CHECK, 'M', ' ' }, - * { TAINT_BAD_PAGE, 'B', ' ' }, - * { TAINT_USER, 'U', ' ' }, - * { TAINT_DIE, 'D', ' ' }, - * { TAINT_OVERRIDDEN_ACPI_TABLE, 'A', ' ' }, - * { TAINT_WARN, 'W', ' ' }, - * { TAINT_CRAP, 'C', ' ' }, - * { TAINT_FIRMWARE_WORKAROUND, 'I', ' ' }, - * entries 12 - 27 are unused - * { TAINT_HARDWARE_UNSUPPORTED, 'H', ' ' }, - * entries 29 - 31 are unused - */ - -static const char * const taint_warnings[] = { - "Proprietary Module", - "Forced Module", - "Unsafe SMP", - "Forced rmmod", - "Machine Check", - "Bad Page", - "User", - "Die", - "Overriden ACPI Table", - "Warning Issued", - "Experimental Module Loaded", - "Firmware Workaround", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - "Hardware Unsupported", - NULL, - NULL, -}; - -/* TODO: npajkovs: fix tainted string */ -static const char *tainted_string(unsigned tainted) -{ - unsigned idx = 0; - while ((tainted >>= 1) != 0) - idx++; - - return taint_warnings[idx]; -} - static void report_to_bugzilla(const char *dump_dir_name, map_string_h *settings) { struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0); diff --git a/src/plugins/abrt-dump-oops.c b/src/plugins/abrt-dump-oops.c index c2879caa..5eba8036 100644 --- a/src/plugins/abrt-dump-oops.c +++ b/src/plugins/abrt-dump-oops.c @@ -542,7 +542,21 @@ static unsigned save_oops_to_dump_dir(GList *oops_list, unsigned oops_cnt) dd_save_text(dd, FILENAME_REASON, second_line); if (tainted_str && tainted_str[0] != '0') + { + unsigned long tainted = xatoi_positive(tainted_str); + char *tainted_short = kernel_tainted_short(tainted); + GList *tainted_long = kernel_tainted_long(tainted); + + struct strbuf *tnt_long = strbuf_new(); + for (GList *li = tainted_long; li; li = li->next) + strbuf_append_strf(tnt_long, "%s\n", (char*) li->data); + dd_save_text(dd, FILENAME_TAINTED, tainted_str); + dd_save_text(dd, FILENAME_TAINTED_SHORT, tainted_short); + dd_save_text(dd, FILENAME_TAINTED_LONG, tnt_long->buf); + strbuf_free(tnt_long); + list_free_with_free(tainted_long); + } dd_close(dd); } diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c index 83c3d20a..86cd86d7 100644 --- a/src/plugins/rhbz.c +++ b/src/plugins/rhbz.c @@ -300,8 +300,8 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t *problem_data, FILENAME_CRASH_FUNCTION); const char *analyzer = get_problem_item_content_or_NULL(problem_data, FILENAME_ANALYZER); - const char *tainted_str = get_problem_item_content_or_NULL(problem_data, - FILENAME_TAINTED); + const char *tainted_short = get_problem_item_content_or_NULL(problem_data, + FILENAME_TAINTED_SHORT); struct strbuf *buf_summary = strbuf_new(); strbuf_append_strf(buf_summary, "[abrt] %s", package); @@ -312,17 +312,10 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t *problem_data, if (reason != NULL) strbuf_append_strf(buf_summary, ": %s", reason); - if (tainted_str && analyzer - && (strcmp(analyzer, "Kerneloops") == 0) - ) { - //TODO: fix me; basically it doesn't work as it suppose to work - // I will fix it immediately when this patch land into abrt git - /* - unsigned long tainted = xatoi_positive(tainted_str); - const char *tainted_warning = tainted_string(tainted); - if (tainted_warning) - strbuf_append_strf(buf_summary, ": TAINTED %s", tainted_warning); - */ + if (tainted_short && analyzer + && (strcmp(analyzer, "Kerneloops") == 0)) + { + strbuf_append_strf(buf_summary, ": TAINTED %s", tainted_short); } char *status_whiteboard = xasprintf("abrt_hash:%s", duphash); |