2 * Copyright 2007, Intel Corporation
4 * This file is part of corewatcher.org
6 * This program file is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * You should have received a copy of the GNU General Public License
16 * along with this program in a file named COPYING; if not, write to the
17 * Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301 USA
22 * Arjan van de Ven <arjan@linux.intel.com>
23 * William Douglas <william.douglas@intel.com>
27 #ifndef __INCLUDE_GUARD_KERNELOOPS_H_
28 #define __INCLUDE_GUARD_KERNELOOPS_H_
30 /* borrowed from the kernel */
31 #define barrier() __asm__ __volatile__("": : :"memory")
32 #define __unused __attribute__ ((__unused__))
34 #define MAX_PROCESSING_OOPS 10
37 #define FREE_OOPS(oops) \
40 free(oops->application); \
42 free(oops->filename); \
43 free(oops->detail_filename); \
53 char *detail_filename;
56 /* Always pick up the queued_mtx and then the
57 processing_mtx, reverse for setting down */
58 /* Considering the static mutexes the total global order should be:
59 queued_mtx -> processing_mtx -> gdb_mtx ->processing_queue_mtx */
60 /* The asked_mtx doesn't overlap with any of these */
62 GHashTable *asked_oops;
63 GHashTable *processing_oops;
64 GHashTable *queued_oops;
65 pthread_mutex_t asked_mtx;
66 pthread_mutex_t processing_mtx;
67 pthread_mutex_t queued_mtx;
71 extern void queue_backtrace(struct oops *oops);
72 extern void submit_queue(void);
73 extern char *replace_name(char *filename, char *replace, char *new);
76 extern int move_core(char *fullpath, char *ext);
77 extern int scan_dmesg(void * unused);
78 extern char *strip_directories(char *fullpath);
79 extern char *get_core_filename(char *filename, char *ext);
80 extern void remove_pid_from_hash(char *fullpath, GHashTable *ht);
85 extern void read_config_file(char *filename);
87 extern int allow_distro_to_pass_on;
88 extern char *submit_url[MAX_URLS];
89 extern char *build_release;
90 extern char *core_folder;
93 extern int private_report;
96 extern void dbus_ask_permission(char *fullpath, char *appfile);
97 extern void dbus_say_thanks(char *url);
98 extern void dbus_say_found(char *fullpath, char *appfile);
101 extern struct core_status core_status;
104 extern char *find_executable(char *fragment);
105 extern char *find_coredump(char *fullpath);