add debug
[lttv.git] / ltt / branches / poly / lttv / lttv / main.c
index f984df1414c656f26557059adc4487081c1a64dd..4e306c6d4ef97d288952540e54a3cdf83fadfc83 100644 (file)
@@ -16,6 +16,9 @@
  * MA 02111-1307, USA.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <lttv/hook.h>
 #include <lttv/module.h>
@@ -26,6 +29,7 @@
 #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
@@ -71,14 +75,16 @@ static void lttv_help(void *hook_data);
    messages. It receives the message and does nothing. */
 
 void ignore_and_drop_message(const gchar *log_domain, GLogLevelFlags log_level,
-    const gchar *message, gpointer user_data) {
+    const gchar *message, gpointer user_data)
+{
 }
 
 
 /* Since everything is done in modules, the main program only takes care
    of the infrastructure. */
 
-int main(int argc, char **argv) {
+int main(int argc, char **argv)
+{
 
   int i;
 
@@ -147,9 +153,9 @@ int main(int argc, char **argv) {
   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);
-  if(error != NULL) g_error(error->message);
+  if(error != NULL) g_error("%s", error->message);
 
   /* Initialize the module loading */
 
@@ -233,11 +239,11 @@ LttvAttribute *lttv_global_attributes()
 
 
 void lttv_module_option(void *hook_data)
-{ 
+{
   GError *error = NULL;
 
   lttv_module_require(a_module, &error);
-  if(error != NULL) g_error(error->message);
+  if(error != NULL) g_error("%s", error->message);
 }
 
 
@@ -261,17 +267,17 @@ void lttv_debug(void *hook_data)
 
 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_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");
-       printf("\n");
-       lttv_option_show_help();
-       printf("\n");
+  printf("Linux Trace Toolkit Visualizer " VERSION "\n");
+  printf("\n");
+  lttv_option_show_help();
+  printf("\n");
 }
 
 /* 
This page took 0.024218 seconds and 4 git commands to generate.