From a81d2a59d85b15507a64cc2e8cc53b7be4330fdc Mon Sep 17 00:00:00 2001 From: pmf Date: Tue, 27 Nov 2007 16:43:28 +0000 Subject: [PATCH] resourceview: trap resource fixes git-svn-id: http://ltt.polymtl.ca/svn@2771 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/state.c | 11 +++++++++++ .../poly/lttv/modules/gui/resourceview/drawing.c | 2 +- .../poly/lttv/modules/gui/resourceview/eventhooks.c | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index 17c5906e..3ef8a216 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -2314,6 +2314,7 @@ static gboolean syscall_exit(void *hook_data, void *call_data) static gboolean trap_entry(void *hook_data, void *call_data) { LttvTracefileState *s = (LttvTracefileState *)call_data; + LttvTraceState *ts = (LttvTraceState *)s->parent.t_context; LttEvent *e = ltt_tracefile_get_event(s->parent.tf); LttvTraceHook *th = (LttvTraceHook *)hook_data; struct marker_field *f = lttv_trace_get_hook_field(th, 0); @@ -2338,18 +2339,28 @@ static gboolean trap_entry(void *hook_data, void *call_data) /* update cpu status */ cpu_push_mode(s->cpu_state, LTTV_CPU_TRAP); + /* update trap status */ + s->cpu_state->last_trap = trap; + ts->trap_states[trap].running++; + return FALSE; } static gboolean trap_exit(void *hook_data, void *call_data) { LttvTracefileState *s = (LttvTracefileState *)call_data; + LttvTraceState *ts = (LttvTraceState *)s->parent.t_context; + guint trap = s->cpu_state->last_trap; pop_state(s, LTTV_STATE_TRAP); /* update cpu status */ cpu_pop_mode(s->cpu_state); + /* update trap status */ + if(ts->trap_states[trap].running) + ts->trap_states[trap].running--; + return FALSE; } diff --git a/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.c b/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.c index a78fd2e5..294b8339 100644 --- a/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.c +++ b/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.c @@ -110,7 +110,7 @@ GdkColor drawing_colors_soft_irq[NUM_COLORS_SOFT_IRQ] = GdkColor drawing_colors_trap[NUM_COLORS_TRAP] = { /* Pixel, R, G, B */ { 0, 0x0000, 0x0000, 0x0000 }, /* COL_TRAP_UNKNOWN */ - { 0, 0xBBBB, 0xBBBB, 0xBBBB }, /* COL_TRAP_IDLE */ + { 0, 0x0000, 0x0000, 0x0000 }, /* COL_TRAP_IDLE */ { 0, 0xFF00, 0xFF00, 0x0100 }, /* COL_TRAP_BUSY */ }; diff --git a/ltt/branches/poly/lttv/modules/gui/resourceview/eventhooks.c b/ltt/branches/poly/lttv/modules/gui/resourceview/eventhooks.c index 6e42ed32..778ec18a 100644 --- a/ltt/branches/poly/lttv/modules/gui/resourceview/eventhooks.c +++ b/ltt/branches/poly/lttv/modules/gui/resourceview/eventhooks.c @@ -1167,8 +1167,8 @@ int before_execmode_hook_trap(void *hook_data, void *call_data) guint64 trap; guint cpu = tfs->cpu; - 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_SOFT_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_SOFT_IRQ_EXIT))); + guint16 ev_id_entry = marker_get_id_from_info(trace, marker_get_info_from_name(trace, lttv_merge_facility_event_name(LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_TRAP_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_ARCH, LTT_EVENT_TRAP_EXIT))); if(ev_id_entry == e->event_id) { trap = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0)); } -- 2.34.1