X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fresourceview%2Feventhooks.c;h=2c7d1e0c07e1c499163067ca46ea9ff07710bcd3;hb=508cde4f64f99883380eca83b1840cc65e8dfc1b;hp=432931c8f7bf2bd5679c10d31ec296474f97d429;hpb=a53e6234cf0a2b52fd395a3dbf297f97914ff57d;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/resourceview/eventhooks.c b/ltt/branches/poly/lttv/modules/gui/resourceview/eventhooks.c index 432931c8..2c7d1e0c 100644 --- a/ltt/branches/poly/lttv/modules/gui/resourceview/eventhooks.c +++ b/ltt/branches/poly/lttv/modules/gui/resourceview/eventhooks.c @@ -61,7 +61,6 @@ #include #include -#include #include #include @@ -403,8 +402,8 @@ static void bdev_set_line_color(PropertiesLine *prop_line, LttvBdevState *s) int before_schedchange_hook(void *hook_data, void *call_data) { - LttvTraceHookByFacility *thf = (LttvTraceHookByFacility*)hook_data; - EventsRequest *events_request = (EventsRequest*)thf->hook_data; + LttvTraceHook *th = (LttvTraceHook*)hook_data; + EventsRequest *events_request = (EventsRequest*)th->hook_data; ControlFlowData *control_flow_data = events_request->viewer_data; LttvTracefileContext *tfc = (LttvTracefileContext *)call_data; @@ -428,8 +427,8 @@ int before_schedchange_hook(void *hook_data, void *call_data) guint pid_out; guint pid_in; - pid_out = ltt_event_get_long_unsigned(e, thf->f1); - pid_in = ltt_event_get_long_unsigned(e, thf->f2); + pid_out = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0)); + pid_in = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1)); // if(pid_in != 0 && pid_out != 0) { // /* not a transition to/from idle */ // return 0; @@ -815,8 +814,8 @@ int before_schedchange_hook(void *hook_data, void *call_data) */ int after_schedchange_hook(void *hook_data, void *call_data) { - LttvTraceHookByFacility *thf = (LttvTraceHookByFacility*)hook_data; - EventsRequest *events_request = (EventsRequest*)thf->hook_data; + LttvTraceHook *th = (LttvTraceHook*)hook_data; + EventsRequest *events_request = (EventsRequest*)th->hook_data; ControlFlowData *control_flow_data = events_request->viewer_data; LttvTracefileContext *tfc = (LttvTracefileContext *)call_data; @@ -849,8 +848,8 @@ int after_schedchange_hook(void *hook_data, void *call_data) guint pid_in; { guint pid_out; - pid_out = ltt_event_get_long_unsigned(e, thf->f1); - pid_in = ltt_event_get_long_unsigned(e, thf->f2); + pid_out = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0)); + pid_in = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1)); } @@ -951,8 +950,8 @@ int after_schedchange_hook(void *hook_data, void *call_data) int before_execmode_hook(void *hook_data, void *call_data) { - LttvTraceHookByFacility *thf = (LttvTraceHookByFacility*)hook_data; - EventsRequest *events_request = (EventsRequest*)thf->hook_data; + LttvTraceHook *th = (LttvTraceHook*)hook_data; + EventsRequest *events_request = (EventsRequest*)th->hook_data; ControlFlowData *control_flow_data = events_request->viewer_data; LttvTracefileContext *tfc = (LttvTracefileContext *)call_data; @@ -1147,8 +1146,8 @@ int before_execmode_hook(void *hook_data, void *call_data) int before_execmode_hook_irq(void *hook_data, void *call_data) { - LttvTraceHookByFacility *thf = (LttvTraceHookByFacility*)hook_data; - EventsRequest *events_request = (EventsRequest*)thf->hook_data; + LttvTraceHook *th = (LttvTraceHook*)hook_data; + EventsRequest *events_request = (EventsRequest*)th->hook_data; ControlFlowData *control_flow_data = events_request->viewer_data; LttvTracefileContext *tfc = (LttvTracefileContext *)call_data; @@ -1161,6 +1160,8 @@ int before_execmode_hook_irq(void *hook_data, void *call_data) LttTime evtime = ltt_event_time(e); + LttTrace *trace = tfc->t_context->t; + GQuark resourceq; /* we are in a execmode, before the state update. We must draw the @@ -1172,17 +1173,12 @@ int before_execmode_hook_irq(void *hook_data, void *call_data) guint64 irq; guint cpu = tfs->cpu; - LttFacility *ev_facility = ltt_event_facility(e); - if(ltt_facility_name(ev_facility) != LTT_FACILITY_KERNEL) - return 0; - guint8 ev_id_entry = ltt_eventtype_id(ltt_facility_eventtype_get_by_name(ev_facility, LTT_EVENT_IRQ_ENTRY)); - guint8 ev_id_exit = ltt_eventtype_id(ltt_facility_eventtype_get_by_name(ev_facility, LTT_EVENT_IRQ_EXIT)); - if(ltt_facility_name(ev_facility) == LTT_FACILITY_KERNEL && - ev_id_entry == ltt_event_eventtype_id(e)) { - irq = ltt_event_get_long_unsigned(e, thf->f1); + guint16 ev_id_entry = marker_get_id_from_info(trace, marker_get_info_from_name(trace, lttv_merge_facility_event_name(LTT_FACILITY_KERNEL, LTT_EVENT_IRQ_ENTRY))); + guint16 ev_id_exit = marker_get_id_from_info(trace, marker_get_info_from_name(trace, lttv_merge_facility_event_name(LTT_FACILITY_KERNEL, LTT_EVENT_IRQ_EXIT))); + if(ev_id_entry == e->event_id) { + irq = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0)); } - else if(ltt_facility_name(ev_facility) == LTT_FACILITY_KERNEL && - ev_id_exit == ltt_event_eventtype_id(e)) { + else if(ev_id_exit == e->event_id) { irq = ts->cpu_states[cpu].last_irq; } else { @@ -1358,8 +1354,8 @@ int before_execmode_hook_irq(void *hook_data, void *call_data) int before_bdev_event_hook(void *hook_data, void *call_data) { - LttvTraceHookByFacility *thf = (LttvTraceHookByFacility*)hook_data; - EventsRequest *events_request = (EventsRequest*)thf->hook_data; + LttvTraceHook *th = (LttvTraceHook*)hook_data; + EventsRequest *events_request = (EventsRequest*)th->hook_data; ControlFlowData *control_flow_data = events_request->viewer_data; LttvTracefileContext *tfc = (LttvTracefileContext *)call_data; @@ -1381,9 +1377,9 @@ int before_bdev_event_hook(void *hook_data, void *call_data) /* For the pid */ guint cpu = tfs->cpu; - guint8 major = ltt_event_get_long_unsigned(e, thf->f1); - guint8 minor = ltt_event_get_long_unsigned(e, thf->f2); - guint oper = ltt_event_get_long_unsigned(e, thf->f3); + guint8 major = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0)); + guint8 minor = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1)); + guint oper = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 2)); gint devcode_gint = MKDEV(major,minor); { @@ -2282,8 +2278,8 @@ int after_chunk(void *hook_data, void *call_data) */ int before_statedump_end(void *hook_data, void *call_data) { - LttvTraceHookByFacility *thf = (LttvTraceHookByFacility*)hook_data; - EventsRequest *events_request = (EventsRequest*)thf->hook_data; + LttvTraceHook *th = (LttvTraceHook*)hook_data; + EventsRequest *events_request = (EventsRequest*)th->hook_data; ControlFlowData *control_flow_data = events_request->viewer_data; LttvTracefileContext *tfc = (LttvTracefileContext *)call_data;