enhance depanalysis
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 15 Nov 2010 13:21:07 +0000 (08:21 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 15 Nov 2010 13:21:07 +0000 (08:21 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttv/modules/text/depanalysis.c

index 0c984711b5fd7203417894b00507b99263b9c370..2dfc522b2e9c6381b1c5169fd704dfae5aa0138a 100644 (file)
@@ -49,6 +49,7 @@ static int depanalysis_range_pid = -1;
 static int depanalysis_range_pid_searching = -1;
 static int depanalysis_use_time=0;
 static int depanalysis_event_limit = -1;
+static int a_print_simple_summary = 0;
 static LttTime depanalysis_time1, depanalysis_time2;
 static char *arg_t1_str,*arg_t2_str;
 static int statedump_finished = 0;
@@ -454,7 +455,7 @@ static int try_pop_blocked_llev_preempted(struct process *p, LttTime t)
                pwstate = g_array_index(p->stack->array, struct sstack_item *, push_idx)->data_val;
 
                if(!(pwstate->state.bstate == LLEV_PREEMPTED && ((struct llev_state_info_preempted *)pwstate->state.private)->prev_state > 0)) {
-                       printf("double try wake up\n");
+                       //printf("double try wake up\n");
                        return 0;
                }
        }
@@ -508,7 +509,7 @@ static gboolean write_traceset_header(void *hook_data, void *call_data)
   g_info("Traceset header");
 
   /* Print the trace set header */
-  fprintf(a_file,"Trace set contains %d traces\n\n",
+  g_info(a_file,"Trace set contains %d traces\n\n",
       lttv_traceset_number(tc->ts));
 
   return FALSE;
@@ -1022,6 +1023,8 @@ static void print_process_critical_path_summary()
                struct process_state *hlev_state_cur;
 
                pinfo = (struct process *)pinfos->data;
+               if (depanalysis_range_pid_searching != -1 && pinfo->pid != depanalysis_range_pid_searching)
+                       goto next_iter;
                printf("\tProcess %d [%s]\n", pinfo->pid, g_quark_to_string(pinfo->name));
 
                if(pinfo->hlev_history->len < 1)
@@ -1048,7 +1051,7 @@ gint compare_states_length(gconstpointer a, gconstpointer b)
        return val;
 }
 
-static void print_simple_summary()
+static void print_simple_summary(void)
 {
        struct process *pinfo;
        GList *pinfos;
@@ -1056,6 +1059,9 @@ static void print_simple_summary()
        int i,j;
        int id_for_episodes = 0;
 
+       if (!a_print_simple_summary)
+               return;
+
        /* we save all the nodes here to print the episodes table quickly */
        GArray *all_nodes = g_array_new(FALSE, FALSE, sizeof(struct summary_tree_node *));
 
@@ -1356,7 +1362,7 @@ static gboolean write_traceset_footer(void *hook_data, void *call_data)
 
        g_info("TextDump traceset footer");
 
-       fprintf(a_file,"End trace set\n\n");
+       g_info(a_file,"End trace set\n\n");
 
 //     if(LTTV_IS_TRACESET_STATS(tc)) {
 //             lttv_stats_sum_traceset((LttvTracesetStats *)tc, ltt_time_infinite);
@@ -1372,8 +1378,8 @@ static gboolean write_traceset_footer(void *hook_data, void *call_data)
        /* print the reports */
        print_simple_summary();
        print_process_critical_path_summary();
-       printf("depanalysis_use_time = %d\n", depanalysis_use_time);
        if(depanalysis_use_time == 3) {
+               printf("depanalysis_use_time = %d\n", depanalysis_use_time);
                if(depanalysis_range_pid == -1 && depanalysis_range_pid_searching >= 0)
                        depanalysis_range_pid = depanalysis_range_pid_searching;
 
@@ -1965,6 +1971,10 @@ static void arg_limit(void *hook_data)
 {
 }
 
+static void arg_sum(void *hook_data)
+{
+}
+
 static void init()
 {
   gboolean result;
@@ -1985,6 +1995,8 @@ static void init()
       LTTV_OPT_INT, &depanalysis_range_pid_searching, arg_pid, NULL);
   lttv_option_add("limit-events", 0, "dependency limit event count", "count",
       LTTV_OPT_INT, &depanalysis_event_limit, arg_limit, NULL);
+  lttv_option_add("print-summary", 0, "print simple summary", "sum",
+      LTTV_OPT_INT, &a_print_simple_summary, arg_sum, NULL);
 
   process_hash_table = g_hash_table_new(g_int_hash, g_int_equal);
   syscall_table = g_hash_table_new(g_int_hash, g_int_equal);
@@ -2030,6 +2042,7 @@ static void destroy()
   lttv_option_remove("dep-time-end");
   lttv_option_remove("dep-pid");
   lttv_option_remove("limit-events");
+  lttv_option_remove("print-summary");
 
   g_hash_table_destroy(process_hash_table);
   g_hash_table_destroy(syscall_table);
This page took 0.033902 seconds and 4 git commands to generate.