From 67c73bb33be29d518afa38dd4fd9a00b30eb429c Mon Sep 17 00:00:00 2001 From: pmf Date: Fri, 30 May 2008 15:15:29 +0000 Subject: [PATCH] resourceview: display softirq raise in softirq resource git-svn-id: http://ltt.polymtl.ca/svn@2932 04897980-b3bd-0310-b5e0-8ef037075253 --- .../poly/lttv/modules/gui/resourceview/drawing.c | 9 +++++++++ .../poly/lttv/modules/gui/resourceview/drawing.h | 1 + .../poly/lttv/modules/gui/resourceview/eventhooks.c | 11 +++++++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.c b/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.c index 294b8339..a4e2b684 100644 --- a/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.c +++ b/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.c @@ -104,6 +104,7 @@ GdkColor drawing_colors_soft_irq[NUM_COLORS_SOFT_IRQ] = { /* Pixel, R, G, B */ { 0, 0x0000, 0x0000, 0x0000 }, /* COL_SOFT_IRQ_UNKNOWN */ { 0, 0x0000, 0x0000, 0x0000 }, /* COL_SOFT_IRQ_IDLE */ + { 0, 0xFFFF, 0xD400, 0xD400 }, /* COL_SOFT_IRQ_PENDING */ { 0, 0xFFFF, 0x9400, 0x9600 }, /* COL_SOFT_IRQ_BUSY */ }; @@ -293,6 +294,14 @@ void drawing_data_request(Drawing_t *drawing, events_request, &hooks); + lttv_trace_find_hook(ts->parent.t, + LTT_FACILITY_KERNEL, + LTT_EVENT_SOFT_IRQ_RAISE, + FIELD_ARRAY(LTT_FIELD_SOFT_IRQ_ID), + before_execmode_hook, + events_request, + &hooks); + lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_KERNEL, LTT_EVENT_SOFT_IRQ_ENTRY, diff --git a/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.h b/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.h index 16278fd4..8b0070bd 100644 --- a/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.h +++ b/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.h @@ -70,6 +70,7 @@ typedef enum _draw_color_irq { typedef enum _draw_color_soft_irq { COL_SOFT_IRQ_UNKNOWN, COL_SOFT_IRQ_IDLE, + COL_SOFT_IRQ_PENDING, COL_SOFT_IRQ_BUSY, NUM_COLORS_SOFT_IRQ } draw_color_soft_irq; diff --git a/ltt/branches/poly/lttv/modules/gui/resourceview/eventhooks.c b/ltt/branches/poly/lttv/modules/gui/resourceview/eventhooks.c index 778ec18a..676dce93 100644 --- a/ltt/branches/poly/lttv/modules/gui/resourceview/eventhooks.c +++ b/ltt/branches/poly/lttv/modules/gui/resourceview/eventhooks.c @@ -313,10 +313,12 @@ static void irq_set_line_color(PropertiesLine *prop_line, LttvIRQState *s) static void soft_irq_set_line_color(PropertiesLine *prop_line, LttvSoftIRQState *s) { GQuark present_state; - if(s->running == 0) - prop_line->color = drawing_colors_soft_irq[COL_SOFT_IRQ_IDLE]; - else + if(s->running) prop_line->color = drawing_colors_soft_irq[COL_SOFT_IRQ_BUSY]; + else if(s->pending) + prop_line->color = drawing_colors_soft_irq[COL_SOFT_IRQ_PENDING]; + else + prop_line->color = drawing_colors_soft_irq[COL_SOFT_IRQ_IDLE]; } static void trap_set_line_color(PropertiesLine *prop_line, LttvTrapState *s) @@ -1002,9 +1004,10 @@ int before_execmode_hook_soft_irq(void *hook_data, void *call_data) guint64 softirq; guint cpu = tfs->cpu; + guint16 ev_id_raise = marker_get_id_from_info(trace, marker_get_info_from_name(trace, lttv_merge_facility_event_name(LTT_FACILITY_KERNEL, LTT_EVENT_SOFT_IRQ_RAISE))); 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))); - if(ev_id_entry == e->event_id) { + if(ev_id_entry == e->event_id || ev_id_raise == e->event_id) { softirq = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0)); } else if(ev_id_exit == e->event_id) { -- 2.34.1