#define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format)
#define NO_ITEMS 0
+typedef struct
+{
+ LttTime duration;
+ LttTime start_time;
+ LttTime end_time;
+}MaxDuration;
+
typedef struct {
guint cpu_id;
guint id;
guint frequency;
LttTime total_duration;
guint average_duration;
+ MaxDuration max_irq_handler;
}Irq;
static void CalculateXi(LttEvent *event, InterruptEventData *event_data);
static void SumItems(gint irq_id, LttTime Xi, InterruptEventData *event_data);
static int CalculateStandardDeviation(gint id, InterruptEventData *event_data);
-static void CalculateMaxIRQHandler();
+static void CalculateMaxIRQHandler(LttEvent *event);
/* Enumeration of the columns */
enum{
CPUID_COLUMN,
FREQUENCY_COLUMN,
DURATION_COLUMN,
DURATION_STANDARD_DEV_COLUMN,
+ MAX_IRQ_HANDLER_COLUMN,
N_COLUMNS
};
G_TYPE_INT, /* IRQ_ID */
G_TYPE_INT, /* Frequency */
G_TYPE_UINT64, /* Duration */
- G_TYPE_INT /* standard deviation */
+ G_TYPE_INT, /* standard deviation */
+ G_TYPE_INT /* Max IRQ handler */
);
event_viewer_data->TreeView = gtk_tree_view_new_with_model (GTK_TREE_MODEL (event_viewer_data->ListStore));
"text", DURATION_STANDARD_DEV_COLUMN,
NULL);
gtk_tree_view_column_set_alignment (column, 0.0);
- gtk_tree_view_column_set_fixed_width (column, 250);
+ gtk_tree_view_column_set_fixed_width (column, 200);
gtk_tree_view_append_column (GTK_TREE_VIEW (event_viewer_data->TreeView), column);
+ renderer = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new_with_attributes ("Max IRQ handler duration (nsec)",
+ renderer,
+ "text", MAX_IRQ_HANDLER_COLUMN,
+ NULL);
+ gtk_tree_view_column_set_alignment (column, 0.0);
+ gtk_tree_view_column_set_fixed_width (column, 250);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (event_viewer_data->TreeView), column);
event_viewer_data->SelectionTree = gtk_tree_view_get_selection (GTK_TREE_VIEW (event_viewer_data->TreeView));
cpu_id = ltt_event_cpu_id(e);
calcul_duration( event_time, cpu_id, event_data);
- CalculateMaxIRQHandler();
+ CalculateMaxIRQHandler(e);
return FALSE;
}
}
}
-static void CalculateMaxIRQHandler()
+static void CalculateMaxIRQHandler(LttEvent *event)
{
}
irq.id = e->id;
irq.frequency++;
irq.total_duration = ltt_time_sub(time_exit, e->event_time);
+
+ /* test code */
+ irq.max_irq_handler.start_time = e->event_time;
+ irq.max_irq_handler.end_time = time_exit;
+ irq.max_irq_handler.duration = ltt_time_sub(time_exit, e->event_time);
+ /*
+ irq.max_irq_handler.duration = duration.tv_sec;
+ irq.max_irq_handler.duration *= NANOSECONDS_PER_SECOND;
+ irq.max_irq_handler.duration += element.total_duration.tv_nsec;
+ */
+ /* test code */
+
g_array_append_val (FirstRequestIrqExit, irq);
}
else
duration = ltt_time_sub(time_exit, e->event_time);
element->total_duration = ltt_time_add(element->total_duration, duration);
element->frequency++;
+ if(ltt_time_compare(duration,element->max_irq_handler.duration) > 0)
+ {
+ element->max_irq_handler.duration = duration;
+ element->max_irq_handler.start_time = e->event_time;
+ element->max_irq_handler.end_time = time_exit;
+ }
}
}
if(!notFound)
irq.id = e->id;
irq.frequency++;
irq.total_duration = ltt_time_sub(time_exit, e->event_time);
+
+ irq.max_irq_handler.start_time = e->event_time;
+ irq.max_irq_handler.end_time = time_exit;
+ irq.max_irq_handler.duration = ltt_time_sub(time_exit, e->event_time);
+
g_array_append_val (FirstRequestIrqExit, irq);
}
}
LttTime average_duration;
GtkTreeIter iter;
guint64 real_data;
+ guint maxIRQduration;
InterruptEventData *event_data = (InterruptEventData *)hook_data;
GArray *FirstRequestIrqExit = event_data->FirstRequestIrqExit;
gtk_list_store_clear(event_data->ListStore);
real_data = element.total_duration.tv_sec;
real_data *= NANOSECONDS_PER_SECOND;
real_data += element.total_duration.tv_nsec;
+
+
+ maxIRQduration = element.max_irq_handler.duration.tv_sec;
+ maxIRQduration *= NANOSECONDS_PER_SECOND;
+ maxIRQduration += element.max_irq_handler.duration.tv_nsec;
+
gtk_list_store_append (event_data->ListStore, &iter);
gtk_list_store_set (event_data->ListStore, &iter,
CPUID_COLUMN, element.cpu_id,
FREQUENCY_COLUMN, element.frequency,
DURATION_COLUMN, real_data,
DURATION_STANDARD_DEV_COLUMN, CalculateStandardDeviation(element.id, event_data),
+ MAX_IRQ_HANDLER_COLUMN, maxIRQduration,
-1);
+
}