From 3a16d6494d6117c7515ad9000b1f9d86a54bb536 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 17 Jan 2011 16:49:30 +0100 Subject: remove dumpoops and KerneloopsScanner plugin Signed-off-by: Denys Vlasenko --- src/hooks/Makefile.am | 22 --------- src/hooks/dumpoops.cpp | 130 ------------------------------------------------- 2 files changed, 152 deletions(-) delete mode 100644 src/hooks/dumpoops.cpp (limited to 'src/hooks') diff --git a/src/hooks/Makefile.am b/src/hooks/Makefile.am index 34cd942e..6ebf3628 100644 --- a/src/hooks/Makefile.am +++ b/src/hooks/Makefile.am @@ -1,7 +1,5 @@ libexec_PROGRAMS = abrt-hook-ccpp -bin_PROGRAMS = dumpoops - # abrt-hook-ccpp abrt_hook_ccpp_SOURCES = \ abrt-hook-ccpp.c @@ -17,26 +15,6 @@ abrt_hook_ccpp_CPPFLAGS = \ abrt_hook_ccpp_LDADD = \ ../lib/libreport.la -# dumpoops -dumpoops_SOURCES = \ - dumpoops.cpp -dumpoops_CPPFLAGS = \ - -I$(srcdir)/../include/report -I$(srcdir)/../include \ - -I$(srcdir)/../lib \ - -I$(srcdir)/../plugins \ - -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ - -DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" \ - -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ - -DCONF_DIR=\"$(CONF_DIR)\" \ - -DVAR_RUN=\"$(VAR_RUN)\" \ - $(GLIB_CFLAGS) \ - -Wall -Werror \ - -D_GNU_SOURCE -# build will succeed without it, but at runtime plugins do need libabrt_daemon -dumpoops_LDADD = \ - ../lib/libabrt_daemon.la \ - ../lib/libreport.la - python_PYTHON = abrt.pth abrt_exception_handler.py EXTRA_DIST = abrt_exception_handler.py.in $(man_MANS) diff --git a/src/hooks/dumpoops.cpp b/src/hooks/dumpoops.cpp deleted file mode 100644 index cb89a75d..00000000 --- a/src/hooks/dumpoops.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - Copyright (C) 2010 ABRT team - Copyright (C) 2010 RedHat Inc - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Authors: - Denys Vlasenko - Zdenek Prikryl -*/ - -#include "abrtlib.h" -#include "KerneloopsScanner.h" -#include -#include - -#define LOADSYM(fp, name) \ -do { \ - fp = (typeof(fp)) (dlsym(handle, name)); \ - if (!fp) \ - perror_msg_and_die(PLUGINS_LIB_DIR"/libKerneloopsScanner.so has no %s", name); \ -} while (0) - - -int main(int argc, char **argv) -{ - char *program_name = strrchr(argv[0], '/'); - program_name = program_name ? program_name + 1 : argv[0]; - - /* Parse options */ - bool opt_d = 0, opt_s = 0; - int opt; - while ((opt = getopt(argc, argv, "dsv")) != -1) { - switch (opt) { - case 'd': - opt_d = 1; - break; - case 's': - opt_s = 1; - break; - case 'v': - /* Kerneloops code uses VERB3, thus: */ - g_verbose = 3; - break; - default: -usage: - error_msg_and_die( - "Usage: %s [-dsv] FILE\n\n" - "Options:\n" - "\t-d\tCreate ABRT dump for every oops found\n" - "\t-s\tPrint found oopses on standard output\n" - "\t-v\tBe verbose\n" - , program_name - ); - } - } - argv += optind; - if (!argv[0]) - goto usage; - - msg_prefix = program_name; - - /* Load KerneloopsScanner plugin */ - // const plugin_info_t *plugin_info; - CPlugin* (*plugin_newf)(void); - int (*scan_syslog_file)(GList **oopsList, const char *filename, time_t *last_changed_p); - int (*save_oops_to_debug_dump)(GList **oopsList); - void *handle; - - errno = 0; - //TODO: use it directly, not via dlopen? - handle = dlopen(PLUGINS_LIB_DIR"/libKerneloopsScanner.so", RTLD_NOW); - if (!handle) - perror_msg_and_die("can't load %s", PLUGINS_LIB_DIR"/libKerneloopsScanner.so"); - - // LOADSYM(plugin_info, "plugin_info"); - LOADSYM(plugin_newf, "plugin_new"); - LOADSYM(scan_syslog_file, "scan_syslog_file"); - LOADSYM(save_oops_to_debug_dump, "save_oops_to_debug_dump"); - - // CKerneloopsScanner* scanner = (CKerneloopsScanner*) plugin_newf(); - // scanner->Init(); - // scanner->LoadSettings(path); - - /* Use it: parse and dump the oops */ - GList *oopsList = NULL; - int cnt = scan_syslog_file(&oopsList, argv[0], NULL); - log("found oopses: %d", cnt); - - if (cnt > 0) { - if (opt_s) { - int i = 0; - int length = g_list_length(oopsList); - while (i < length) { - printf("\nVersion: %s", (char*)g_list_nth_data(oopsList, i)); - i++; - } - } - if (opt_d) { - log("dumping oopses"); - int errors = save_oops_to_debug_dump(&oopsList); - if (errors > 0) - { - log("%d errors while dumping oopses", errors); - return 1; - } - } - } - - for (GList *li = oopsList; li != NULL; li = g_list_next(li)) - free((char*)li->data); - - g_list_free(oopsList); - /*dlclose(handle); - why bother? - * cos we are handsome and good lookin' guys :D - */ - return 0; -} -- cgit