resourceview: cpu: add softirq state
[lttv.git] / ltt / branches / poly / lttv / modules / gui / interrupts / interrupts.c
index 685f3e25e433048cc8bd215d08566fb0fe38a327..6d0f07e3a210fba5717f69c1147a52e2e82b35f2 100644 (file)
  */
  
  /******************************************************************
+
+Each field of the interrupt viewer is summarized as follows:
    
 - CPUID: processor ID
 
 - IrqId: IRQ ID
 
-- Frequency (Hz): the number of interruptions per second (Hz)
+- Frequency (Hz): the number of interrupts per second (Hz). 
+                  We compute the total number of interrupts. Then 
+                 we divide it by the time interval.
 
-- Total Duration (nsec): the sum of each interrupt duration in nsec
+- Total Duration (nsec): the sum of each interrupt duration in nsec. 
+                For a given Irq ID, we sum the duration of each interrupt
+                to give us the total duration 
 
 - Duration Standard_deviation  = sqrt(1/N Sum ((xi -Xa)^2)) where
        N: number of interrupts 
        xi: duration of an interrupt (nsec)
        Xa: average duration (nsec)
+  The formula is taken from wikipedia: http://en.wikipedia.org/wiki/Standard_deviation.        
+  To calculate the duration standard deviation, we make two EventsRequest passes to the main window.
+  In the first EventsRequest pass, we calculate the total number of interrupts to compute for 
+  the average Xa. In the second  EventsRequest pass, calculate the standard deviation.
+  
 
 - Max IRQ handler duration (nsec) [time interval]:   the longest IRQ handler duration in nsec.  
 
--Average period (nsec): 1/Frequency(in HZ)
+- Min IRQ handler duration (nsec) [time interval]:   the shortest IRQ handler duration in nsec.  
+
+- Average period (nsec): 1/Frequency(in HZ). The frequency is computed above.
 
 -Period Standard_deviation  = sqrt(1/N Sum ((xi -Xa)^2)) where
-N: number of interruption
+N: number of interrupts 
 xi: duration of an interrupt
-Xa: 1/Frequency  (in Hz)
+Xa: Period = 1/Frequency  (in Hz)
  
 -Frequency Standard_deviation  = sqrt(1/N Sum ((xi -Xa)^2)) 
-N:  number of interruption
+N:  number of interrupts 
 xi: duration of an interrupt
 Xa: Frequency  (Hz)
 
-
-
-The standard deviation  calculation is based on: 
- http://en.wikipedia.org/wiki/Standard_deviation
- Standard_deviation  = sqrt(1/N Sum ((xi -Xa)^2))
-
- To compute the standard deviation, we need to make two EventRequests to LTTV. In 
- the first EventRequest, we  compute the average duration (Xa)  and the Number of interruptions (N) of 
- each IrqID.  We store the information calculated in the first EventRequest in an array  
- called  FirstRequestIrqExit. In the second  EventRequest, we compute the Sum ((xi -Xa)^2) 
- and store this information in a array called SumArray. The function CalculateDurationStandardDeviation() uses
- FirstRequestIrqExit and SumArray arrays to calculate the duration standard deviation.
   
- *******************************************************************/
+*******************************************************************/
 
  
 
@@ -75,21 +73,19 @@ The standard deviation  calculation is based on:
 #include <string.h>
 #include <ltt/ltt.h>
 #include <ltt/event.h>
-#include <ltt/type.h>
 #include <ltt/trace.h>
-#include <ltt/facility.h>
 #include <lttv/module.h>
 #include <lttv/hook.h>
 #include <lttv/tracecontext.h>
 #include <lttv/state.h>
 #include <lttv/filter.h>
 #include <lttvwindow/lttvwindow.h>
+#include <lttvwindow/lttv_plugin_tab.h>
 #include <ltt/time.h>
 
 #include "hInterruptsInsert.xpm" 
 
 #define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format)
-#define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format)
 #define NO_ITEMS 0
   
 typedef struct 
@@ -102,7 +98,7 @@ typedef struct
 typedef struct {
        guint cpu_id;
        guint id;
-       guint NumerofInterruptions;
+       guint TotalNumberOfInterrupts;
        LttTime total_duration; 
        guint average_duration;
        IrqDuration max_irq_handler;
@@ -119,7 +115,7 @@ typedef struct {
 typedef struct 
 {
        guint irqId;
-       guint NumerofInterruptions;//frequency;// 
+       guint TotalNumberOfInterrupts;//frequency;// 
        guint64 sumOfDurations; // to store the Sum ((xi -Xa)^2) of the duration Standard deviation
        guint64 sumOfPeriods;   // to store  the Sum ((xi -Xa)^2) of the period Standard deviation
        guint64 sumOfFrequencies;// to store the Sum ((xi -Xa)^2) of the frequency Standard deviation
@@ -135,7 +131,7 @@ enum type_t {
 static GSList *interrupt_data_list = NULL ;
  
 
-#define TRACE_NUMBER 0
+//fixed #define TRACE_NUMBER 0
 
 typedef struct _InterruptEventData {
 
@@ -147,6 +143,7 @@ typedef struct _InterruptEventData {
   GtkTreeSelection *SelectionTree;
   
   Tab       * tab; /* tab that contains this plug-in*/ 
+  LttvPluginTab *ptab;
   LttvHooks  * event_hooks;
   LttvHooks  * hooks_trace_after;
   LttvHooks  * hooks_trace_before;
@@ -164,11 +161,10 @@ typedef struct _InterruptEventData {
 /* Function prototypes */
  
 static gboolean interrupt_update_time_window(void * hook_data, void * call_data);
-static GtkWidget *interrupts(Tab *tab);
-static InterruptEventData *system_info(Tab *tab);
+static GtkWidget *interrupts(LttvPlugin *plugin);
+static InterruptEventData *system_info(LttvPluginTab *ptab);
 void interrupt_destructor(InterruptEventData *event_viewer_data);
 static void FirstRequest(InterruptEventData *event_data );  
-static guint64 get_interrupt_id(LttEvent *e);
 static gboolean trace_header(void *hook_data, void *call_data);
 static gboolean DisplayViewer (void *hook_data, void *call_data);
 static void CalculateData(LttTime time_exit,  guint cpu_id,  InterruptEventData *event_data);
@@ -179,11 +175,11 @@ static gboolean SecondRequest(void *hook_data, void *call_data);
 static void CalculateAverageDurationForEachIrqId(InterruptEventData *event_data);
 static gboolean SecondRequestIrqEntryCallback(void *hook_data, void *call_data);
 static gboolean SecondRequestIrqExitCallback(void *hook_data, void *call_data);
-static void CalculateXi(LttEvent *event, InterruptEventData *event_data);
+static void CalculateXi(LttEvent *event, InterruptEventData *event_data, guint cpu_id);
 static void  SumItems(gint irq_id, LttTime Xi, InterruptEventData *event_data);
 static int CalculateDurationStandardDeviation(gint id, InterruptEventData *event_data);
 static int CalculatePeriodStandardDeviation(gint id, InterruptEventData *event_data);
-static int FrequencyInHZ(gint NumerofInterruptions, TimeWindow time_window);
+static int FrequencyInHZ(gint NumberOfInterruptions, TimeWindow time_window);
 static  guint64 CalculatePeriodInnerPart(guint Xi, guint FrequencyHZ);
 static  guint64 CalculateFrequencyInnerPart(guint Xi_in_ns,  guint FrequencyHZ); 
 static void InterruptFree(InterruptEventData *event_viewer_data);
@@ -229,10 +225,10 @@ static void init() {
  *  Constructor hook
  *
  */
-static GtkWidget *interrupts(Tab * tab)
+static GtkWidget *interrupts(LttvPlugin *plugin)
 {
-
-  InterruptEventData* event_data = system_info(tab) ;
+  LttvPluginTab *ptab = LTTV_PLUGIN_TAB(plugin);
+  InterruptEventData* event_data = system_info(ptab) ;
   if(event_data)
     return event_data->Hbox;
   else 
@@ -243,14 +239,15 @@ static GtkWidget *interrupts(Tab * tab)
  * This function initializes the Event Viewer functionnality through the
  * GTK  API. 
  */
-InterruptEventData *system_info(Tab *tab)
+InterruptEventData *system_info(LttvPluginTab *ptab)
 {
   
   LttTime end;
   GtkTreeViewColumn *column;
   GtkCellRenderer *renderer;
   InterruptEventData* event_viewer_data = g_new(InterruptEventData,1) ;
-      
+  Tab *tab = ptab->tab;   
+  event_viewer_data->ptab = ptab;
   event_viewer_data->tab = tab;
   
   /*Get the current time frame from the main window */
@@ -435,7 +432,7 @@ static void FirstRequest(InterruptEventData *event_data )
    
   EventsRequest *events_request;
   
-  LttvTraceHookByFacility *thf;
+  LttvTraceHook *th;
   
   LttvTracesetContext *tsc = lttvwindow_get_traceset_context(event_data->tab);
   
@@ -446,13 +443,11 @@ static void FirstRequest(InterruptEventData *event_data )
   nb_trace = lttv_traceset_number(traceset);
   
   /* There are many traces in a traceset. Iteration for each trace. */  
-  for(i = 0; i<MIN(TRACE_NUMBER+1, nb_trace);i++)
-  {
+  //for(i = 0; i<MIN(TRACE_NUMBER+1, nb_trace);i++) {
+  for(i = 0 ; i < nb_trace ; i++) {
         events_request = g_new(EventsRequest, 1); 
        
-       hooks = g_array_new(FALSE, FALSE, sizeof(LttvTraceHook));
-       
-       hooks = g_array_set_size(hooks, 2);
+       hooks = g_array_sized_new(FALSE, FALSE, sizeof(LttvTraceHook), 2);
     
        event_data->hooks_trace_before = lttv_hooks_new();
        
@@ -466,37 +461,34 @@ static void FirstRequest(InterruptEventData *event_data )
        /* Get a trace state */
        ts = (LttvTraceState *)tsc->traces[i];
        /* Create event_by_Id hooks */
-       event_data->event_by_id_hooks = lttv_hooks_by_id_new();
+       event_data->event_by_id_hooks = lttv_hooks_by_id_new();
   
        /*Register event_by_id_hooks with a callback function*/ 
-          ret = lttv_trace_find_hook(ts->parent.t,
-               LTT_FACILITY_KERNEL, LTT_EVENT_IRQ_ENTRY,
-               LTT_FIELD_IRQ_ID, 0, 0,
+        lttv_trace_find_hook(ts->parent.t,
+               LTT_FACILITY_KERNEL,
+                LTT_EVENT_IRQ_ENTRY,
+               FIELD_ARRAY(LTT_FIELD_IRQ_ID),
                FirstRequestIrqEntryCallback,
                events_request,
-               &g_array_index(hooks, LttvTraceHook, 0));
+               &hooks);
         
-        ret = lttv_trace_find_hook(ts->parent.t,
-               LTT_FACILITY_KERNEL, LTT_EVENT_IRQ_EXIT,
-               LTT_FIELD_IRQ_ID, 0, 0,
+       lttv_trace_find_hook(ts->parent.t,
+               LTT_FACILITY_KERNEL,
+                LTT_EVENT_IRQ_EXIT,
+               NULL,
                FirstRequestIrqExitCallback,
                events_request,
-               &g_array_index(hooks, LttvTraceHook, 1));
+               &hooks);
                
-         g_assert(!ret);
         /*iterate through the facility list*/
        for(k = 0 ; k < hooks->len; k++) 
        { 
-               hook = &g_array_index(hooks, LttvTraceHook, k);
-               for(l=0; l<hook->fac_list->len; l++) 
-               {
-                       thf = g_array_index(hook->fac_list, LttvTraceHookByFacility*, l); 
-                       lttv_hooks_add(lttv_hooks_by_id_find(event_data->event_by_id_hooks, thf->id),
-                               thf->h,
-                               event_data,
-                               LTTV_PRIO_DEFAULT);
+               th = &g_array_index(hooks, LttvTraceHook, k); 
+               lttv_hooks_add(lttv_hooks_by_id_find(event_data->event_by_id_hooks, th->id),
+                       th->h,
+                       th,
+                       LTTV_PRIO_DEFAULT);
                         
-               }
        }
        /* Initalize the EventsRequest structure */
        events_request->owner       = event_data; 
@@ -540,14 +532,16 @@ static gboolean FirstRequestIrqEntryCallback(void *hook_data, void *call_data)
   irq_entry entry;
   LttvTracefileContext *tfc = (LttvTracefileContext *)call_data;
   LttvTracefileState *tfs = (LttvTracefileState *)call_data;
-  InterruptEventData *event_data = (InterruptEventData *)hook_data;
+  LttvTraceHook *th = (LttvTraceHook*) hook_data;
+  EventsRequest *events_request = (EventsRequest*)th->hook_data;
+  InterruptEventData *event_data = events_request->viewer_data;
   GArray* FirstRequestIrqEntry  = event_data->FirstRequestIrqEntry; 
   LttEvent *e = ltt_tracefile_get_event(tfc->tf); 
   event_time = ltt_event_time(e);
-  cpu_id = ltt_event_cpu_id(e);
+  cpu_id = tfs->cpu;
    
   
-  entry.id =get_interrupt_id(e);         
+  entry.id = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0));   
   entry.cpu_id = cpu_id;
   entry.event_time =  event_time;              
   g_array_append_val (FirstRequestIrqEntry, entry);
@@ -555,27 +549,6 @@ static gboolean FirstRequestIrqEntryCallback(void *hook_data, void *call_data)
   return FALSE;
 }
 
-/**
- *  This function gets the id of the interrupt. The id is stored in a dynamic structure. 
- *  Refer to the print.c file for how to extract data from a dynamic structure.
- */ 
-static guint64 get_interrupt_id(LttEvent *e)
-{
-  guint i, num_fields;
-  LttEventType *event_type;
-  LttField *element;  
-  LttField *field;
-   guint64  irq_id;
-  event_type = ltt_event_eventtype(e);
-  num_fields = ltt_eventtype_num_fields(event_type);
-  for(i = 0 ; i < num_fields-1 ; i++) 
-  {   
-        field = ltt_eventtype_field(event_type, i);
-       irq_id = ltt_event_get_long_unsigned(e,field);
-  }
-  return  irq_id;
-
-} 
 /**
  *  This function is called whenever an irq_exit event occurs.  
  *  
@@ -586,11 +559,12 @@ gboolean FirstRequestIrqExitCallback(void *hook_data, void *call_data)
   unsigned cpu_id;
   LttvTracefileContext *tfc = (LttvTracefileContext *)call_data;
   LttvTracefileState *tfs = (LttvTracefileState *)call_data;
-  InterruptEventData *event_data = (InterruptEventData *)hook_data;
+  LttvTraceHook *th = (LttvTraceHook*) hook_data;
+  EventsRequest *events_request = (EventsRequest*)th->hook_data;
+  InterruptEventData *event_data = events_request->viewer_data;
   LttEvent *e = ltt_tracefile_get_event(tfc->tf);
-  LttEventType *type = ltt_event_eventtype(e);
   event_time = ltt_event_time(e);
-  cpu_id = ltt_event_cpu_id(e);
+  cpu_id = tfs->cpu;
   
   CalculateData( event_time,  cpu_id, event_data);
    
@@ -640,7 +614,7 @@ static void CalculateTotalDurationAndMaxIrqDurationAndMinIrqDuration(irq_entry *
   {
     irq.cpu_id = e->cpu_id;
     irq.id    =  e->id;
-    irq.NumerofInterruptions++;
+    irq.TotalNumberOfInterrupts++;
     irq.total_duration =  ltt_time_sub(time_exit, e->event_time);
      
     irq.max_irq_handler.start_time = e->event_time;
@@ -663,7 +637,7 @@ static void CalculateTotalDurationAndMaxIrqDurationAndMinIrqDuration(irq_entry *
        notFound = TRUE;
        duration =  ltt_time_sub(time_exit, e->event_time);
        element->total_duration = ltt_time_add(element->total_duration, duration);
-       element->NumerofInterruptions++;
+       element->TotalNumberOfInterrupts++;
        // Max irq handler
        if(ltt_time_compare(duration,element->max_irq_handler.duration) > 0)
        {
@@ -684,7 +658,7 @@ static void CalculateTotalDurationAndMaxIrqDurationAndMinIrqDuration(irq_entry *
     {
       irq.cpu_id = e->cpu_id;
       irq.id    =  e->id;
-      irq.NumerofInterruptions++;
+      irq.TotalNumberOfInterrupts++;
       irq.total_duration =  ltt_time_sub(time_exit, e->event_time);
       // Max irq handler
       irq.max_irq_handler.start_time = e->event_time;
@@ -719,7 +693,7 @@ static gboolean SecondRequest(void *hook_data, void *call_data)
    
   EventsRequest *events_request;
   
-  LttvTraceHookByFacility *thf;
+  LttvTraceHook *th;
   
   InterruptEventData *event_data = (InterruptEventData *)hook_data;
   
@@ -733,14 +707,12 @@ static gboolean SecondRequest(void *hook_data, void *call_data)
   nb_trace = lttv_traceset_number(traceset);
   
   /* There are many traces in a traceset. Iteration for each trace. */  
-  for(i = 0; i<MIN(TRACE_NUMBER+1, nb_trace);i++)
-  {
+  for(i = 0 ; i < nb_trace ; i++) {
+  // fixed for(i = 0; i<MIN(TRACE_NUMBER+1, nb_trace);i++) {
         events_request = g_new(EventsRequest, 1); 
        
-       hooks = g_array_new(FALSE, FALSE, sizeof(LttvTraceHook));
+       hooks = g_array_sized_new(FALSE, FALSE, sizeof(LttvTraceHook), 2);
        
-       hooks = g_array_set_size(hooks, 2);
-    
        event_data->hooks_trace_after = lttv_hooks_new();
        
        /* Registers a hook function */
@@ -753,34 +725,32 @@ static gboolean SecondRequest(void *hook_data, void *call_data)
   
        /*Register event_by_id_hooks with a callback function*/ 
           ret = lttv_trace_find_hook(ts->parent.t,
-               LTT_FACILITY_KERNEL, LTT_EVENT_IRQ_ENTRY,
-               LTT_FIELD_IRQ_ID, 0, 0,
+               LTT_FACILITY_KERNEL,
+               LTT_EVENT_IRQ_ENTRY,
+               FIELD_ARRAY(LTT_FIELD_IRQ_ID),
                SecondRequestIrqEntryCallback,
                events_request,
-               &g_array_index(hooks, LttvTraceHook, 0));
+               &hooks);
         
         ret = lttv_trace_find_hook(ts->parent.t,
-               LTT_FACILITY_KERNEL, LTT_EVENT_IRQ_EXIT,
-               LTT_FIELD_IRQ_ID, 0, 0,
+               LTT_FACILITY_KERNEL,
+               LTT_EVENT_IRQ_EXIT,
+               NULL,
                SecondRequestIrqExitCallback,
                events_request,
-               &g_array_index(hooks, LttvTraceHook, 1));
+               &hooks);
                
          g_assert(!ret);
          
        /* iterate through the facility list */
        for(k = 0 ; k < hooks->len; k++) 
        { 
-               hook = &g_array_index(hooks, LttvTraceHook, k);
-               for(l=0; l<hook->fac_list->len; l++) 
-               {
-                       thf = g_array_index(hook->fac_list, LttvTraceHookByFacility*, l); 
-                       lttv_hooks_add(lttv_hooks_by_id_find(event_data->event_by_id_hooks, thf->id),
-                               thf->h,
-                               event_data,
-                               LTTV_PRIO_DEFAULT);
+               th = &g_array_index(hooks, LttvTraceHook, k); 
+               lttv_hooks_add(lttv_hooks_by_id_find(event_data->event_by_id_hooks, th->id),
+                       th->h,
+                       th,
+                       LTTV_PRIO_DEFAULT);
                         
-               }
        }
        /* Initalize the EventsRequest structure */
        events_request->owner       = event_data; 
@@ -828,8 +798,8 @@ static void CalculateAverageDurationForEachIrqId(InterruptEventData *event_data)
     real_data = element->total_duration.tv_sec;
     real_data *= NANOSECONDS_PER_SECOND;
     real_data += element->total_duration.tv_nsec;
-    if(element->NumerofInterruptions != 0)
-       element->average_duration = real_data / element->NumerofInterruptions;
+    if(element->TotalNumberOfInterrupts != 0)
+       element->average_duration = real_data / element->TotalNumberOfInterrupts;
     else
        element->average_duration = 0;
   }
@@ -848,14 +818,16 @@ static gboolean SecondRequestIrqEntryCallback(void *hook_data, void *call_data)
   irq_entry entry;
   LttvTracefileContext *tfc = (LttvTracefileContext *)call_data;
   LttvTracefileState *tfs = (LttvTracefileState *)call_data;
-  InterruptEventData *event_data = (InterruptEventData *)hook_data;
+  LttvTraceHook *th = (LttvTraceHook *)hook_data;
+  EventsRequest *events_request = (EventsRequest*)th->hook_data;
+  InterruptEventData *event_data = events_request->viewer_data;
   GArray* SecondRequestIrqEntry  = event_data->SecondRequestIrqEntry; 
   LttEvent *e = ltt_tracefile_get_event(tfc->tf); 
   event_time = ltt_event_time(e);
-  cpu_id = ltt_event_cpu_id(e);
+  cpu_id = tfs->cpu;
    
   
-  entry.id =get_interrupt_id(e);         
+  entry.id = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0));   
   entry.cpu_id = cpu_id;
   entry.event_time =  event_time;              
   g_array_append_val (SecondRequestIrqEntry, entry);
@@ -872,10 +844,13 @@ static gboolean SecondRequestIrqExitCallback(void *hook_data, void *call_data)
    
   LttvTracefileContext *tfc = (LttvTracefileContext *)call_data;
   LttvTracefileState *tfs = (LttvTracefileState *)call_data;
-  InterruptEventData *event_data = (InterruptEventData *)hook_data;
+  LttvTraceHook *th = (LttvTraceHook *)hook_data;
+  EventsRequest *events_request = (EventsRequest*)th->hook_data;
+  InterruptEventData *event_data = events_request->viewer_data;
+  
   LttEvent *event = ltt_tracefile_get_event(tfc->tf);
   
-  CalculateXi(event, event_data);
+  CalculateXi(event, event_data, tfs->cpu);
   return FALSE;
 } 
 
@@ -884,17 +859,15 @@ static gboolean SecondRequestIrqExitCallback(void *hook_data, void *call_data)
  *  This function is called whenever an irq_exit event occurs in the second request.  
  *  
  */ 
-static void CalculateXi(LttEvent *event_irq_exit, InterruptEventData *event_data)
+static void CalculateXi(LttEvent *event_irq_exit, InterruptEventData *event_data, guint cpu_id)
 {
   gint i, irq_id;
   irq_entry *element; 
   LttTime Xi;
   LttTime  exit_time; 
-  unsigned cpu_id;
   
   GArray *SecondRequestIrqExit = event_data->SecondRequestIrqExit;
   GArray *SecondRequestIrqEntry = event_data->SecondRequestIrqEntry;
-  cpu_id = ltt_event_cpu_id(event_irq_exit);
   for(i = 0; i < SecondRequestIrqEntry->len; i++)
   {
     element = &g_array_index(SecondRequestIrqEntry,irq_entry,i);
@@ -944,10 +917,10 @@ static void  SumItems(gint irq_id, LttTime Xi, InterruptEventData *event_data)
        if(irq_id == average->id)
        {
            duration_inner_part = Xi_in_ns - average->average_duration;
-           FrequencyHZ = FrequencyInHZ(average->NumerofInterruptions, event_data->time_window);
+           FrequencyHZ = FrequencyInHZ(average->TotalNumberOfInterrupts, event_data->time_window);
            sum.irqId = irq_id;
            // compute  (xi -Xa)^2 of the duration Standard deviation
-           sum.NumerofInterruptions = average->NumerofInterruptions;
+           sum.TotalNumberOfInterrupts = average->TotalNumberOfInterrupts;
            sum.sumOfDurations =  pow (duration_inner_part , 2);
             
            // compute  (xi -Xa)^2 of the period Standard deviation
@@ -1069,7 +1042,7 @@ static gboolean DisplayViewer(void *hook_data, void *call_data)
     element.min_irq_handler.end_time.tv_nsec) ;
  
     
-    FrequencyHZ = FrequencyInHZ(element.NumerofInterruptions,event_data->time_window);
+    FrequencyHZ = FrequencyInHZ(element.TotalNumberOfInterrupts,event_data->time_window);
    
    if(FrequencyHZ != 0)
    {
@@ -1091,9 +1064,7 @@ static gboolean DisplayViewer(void *hook_data, void *call_data)
       AVERAGE_PERIOD , periodInNsec,
       PERIOD_STANDARD_DEV_COLUMN,  CalculatePeriodStandardDeviation(element.id, event_data),
       FREQUENCY_STANDARD_DEV_COLUMN, CalculateFrequencyStandardDeviation(element.id, event_data),
-      -1);
-     
-  
+      -1); 
   } 
    
    
@@ -1160,8 +1131,8 @@ static int CalculateDurationStandardDeviation(gint id, InterruptEventData *event
     sumId  = g_array_index(event_data->SumArray, SumId, i);  
     if(id == sumId.irqId)
     {
-        if(sumId.NumerofInterruptions != 0)
-         inner_component = sumId.sumOfDurations/ sumId.NumerofInterruptions;
+        if(sumId.TotalNumberOfInterrupts != 0)
+         inner_component = sumId.sumOfDurations/ sumId.TotalNumberOfInterrupts;
         else  
          inner_component = 0.0;
        deviation =  sqrt(inner_component);
@@ -1194,8 +1165,8 @@ static int CalculatePeriodStandardDeviation(gint id, InterruptEventData *event_d
       sumId  = g_array_index(event_data->SumArray, SumId, i);  
       if(id == sumId.irqId)
       {
-        if(sumId.NumerofInterruptions != 0)
-           inner_component = sumId.sumOfPeriods / sumId.NumerofInterruptions;
+        if(sumId.TotalNumberOfInterrupts != 0)
+           inner_component = sumId.sumOfPeriods / sumId.TotalNumberOfInterrupts;
        else
           inner_component = 0;
           
@@ -1226,8 +1197,8 @@ static int CalculateFrequencyStandardDeviation(gint id, InterruptEventData *even
      sumId  = g_array_index(event_data->SumArray, SumId, i);   
      if(id == sumId.irqId)
      {
-        if(sumId.NumerofInterruptions != 0)
-           inner_component = sumId.sumOfFrequencies / sumId.NumerofInterruptions;
+        if(sumId.TotalNumberOfInterrupts != 0)
+           inner_component = sumId.sumOfFrequencies / sumId.TotalNumberOfInterrupts;
        else
           inner_component = 0;
        
This page took 0.029821 seconds and 4 git commands to generate.