projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
0.8.35
[lttv.git]
/
ltt
/
branches
/
poly
/
lttv
/
lttv
/
main.c
diff --git
a/ltt/branches/poly/lttv/lttv/main.c
b/ltt/branches/poly/lttv/lttv/main.c
index a27519e8fe2c1791a912bc43742fe7bad34a8630..29aa288e43a5715ec8dc284004c6bb3d3e8dc76e 100644
(file)
--- a/
ltt/branches/poly/lttv/lttv/main.c
+++ b/
ltt/branches/poly/lttv/lttv/main.c
@@
-16,6
+16,9
@@
* MA 02111-1307, USA.
*/
* MA 02111-1307, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <lttv/hook.h>
#include <lttv/module.h>
#include <lttv/hook.h>
#include <lttv/module.h>
@@
-26,6
+29,7
@@
#include <lttv/traceset.h>
#include <ltt/trace.h>
#include <stdio.h>
#include <lttv/traceset.h>
#include <ltt/trace.h>
#include <stdio.h>
+#include <string.h>
/* The main program maintains a few central data structures and relies
/* The main program maintains a few central data structures and relies
@@
-46,7
+50,8
@@
static char
static gboolean
a_verbose,
static gboolean
a_verbose,
- a_debug;
+ a_debug,
+ a_fatal;
gboolean lttv_profile_memory;
gboolean lttv_profile_memory;
@@
-62,6
+67,8
@@
static void lttv_verbose(void *hook_data);
static void lttv_debug(void *hook_data);
static void lttv_debug(void *hook_data);
+static void lttv_fatal(void *hook_data);
+
static void lttv_help(void *hook_data);
/* This is the handler to specify when we dont need all the debugging
static void lttv_help(void *hook_data);
/* This is the handler to specify when we dont need all the debugging
@@
-144,9
+151,9
@@
int main(int argc, char **argv) {
GError *error = NULL;
LttvModule *module_module = lttv_module_require("module", &error);
GError *error = NULL;
LttvModule *module_module = lttv_module_require("module", &error);
- if(error != NULL) g_error(error->message);
+ if(error != NULL) g_error(
"%s",
error->message);
LttvModule *module_option = lttv_module_require("option", &error);
LttvModule *module_option = lttv_module_require("option", &error);
- if(error != NULL) g_error(error->message);
+ if(error != NULL) g_error(
"%s",
error->message);
/* Initialize the module loading */
/* Initialize the module loading */
@@
-173,6
+180,11
@@
int main(int argc, char **argv) {
a_debug = FALSE;
lttv_option_add("debug",'d', "print debugging messages", "none",
LTTV_OPT_NONE, NULL, lttv_debug, NULL);
a_debug = FALSE;
lttv_option_add("debug",'d', "print debugging messages", "none",
LTTV_OPT_NONE, NULL, lttv_debug, NULL);
+
+ a_fatal = FALSE;
+ lttv_option_add("fatal",'f', "make critical messages fatal",
+ "none",
+ LTTV_OPT_NONE, NULL, lttv_fatal, NULL);
lttv_profile_memory = FALSE;
lttv_option_add(profile_memory_long_option + 2,
lttv_profile_memory = FALSE;
lttv_option_add(profile_memory_long_option + 2,
@@
-229,7
+241,7
@@
void lttv_module_option(void *hook_data)
GError *error = NULL;
lttv_module_require(a_module, &error);
GError *error = NULL;
lttv_module_require(a_module, &error);
- if(error != NULL) g_error(error->message);
+ if(error != NULL) g_error(
"%s",
error->message);
}
}
@@
-251,6
+263,13
@@
void lttv_debug(void *hook_data)
g_info("Logging set to include DEBUG level messages");
}
g_info("Logging set to include DEBUG level messages");
}
+void lttv_fatal(void *hook_data)
+{
+ g_log_set_always_fatal(G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL);
+ //g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
+ g_info("Critical log from glib will abort execution");
+}
+
void lttv_help(void *hook_data)
{
printf("Linux Trace Toolkit Visualizer\n");
void lttv_help(void *hook_data)
{
printf("Linux Trace Toolkit Visualizer\n");
This page took
0.0234 seconds
and
4
git commands to generate.