From d34141ca6fc6dd872a922134b22095bd74ec013d Mon Sep 17 00:00:00 2001 From: pmf Date: Tue, 27 Nov 2007 16:42:59 +0000 Subject: [PATCH] resourceview: cpu: add softirq state git-svn-id: http://ltt.polymtl.ca/svn@2764 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/state.c | 8 ++++++++ ltt/branches/poly/lttv/lttv/state.h | 1 + ltt/branches/poly/lttv/modules/gui/resourceview/drawing.c | 1 + ltt/branches/poly/lttv/modules/gui/resourceview/drawing.h | 1 + .../poly/lttv/modules/gui/resourceview/eventhooks.c | 3 +++ 5 files changed, 14 insertions(+) diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index 5bdfcebf..61677fa8 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -142,6 +142,7 @@ LttvCPUMode LTTV_CPU_IDLE, LTTV_CPU_BUSY, LTTV_CPU_IRQ, + LTTV_CPU_SOFT_IRQ, LTTV_CPU_TRAP; LttvIRQMode @@ -2356,6 +2357,9 @@ static gboolean soft_irq_exit(void *hook_data, void *call_data) if(ts->soft_irq_states[softirq].running) ts->soft_irq_states[softirq].running--; + /* update cpu status */ + cpu_pop_mode(s->cpu_state); + return FALSE; } @@ -2401,6 +2405,9 @@ static gboolean soft_irq_entry(void *hook_data, void *call_data) /* Do something with the info about being in user or system mode when int? */ push_state(s, LTTV_STATE_SOFT_IRQ, submode); + /* update cpu status */ + cpu_push_mode(s->cpu_state, LTTV_CPU_SOFT_IRQ); + /* update softirq status */ s->cpu_state->last_soft_irq = softirq; ts->soft_irq_states[softirq].running++; @@ -3986,6 +3993,7 @@ static void module_init() LTTV_CPU_IDLE = g_quark_from_string("idle"); LTTV_CPU_BUSY = g_quark_from_string("busy"); LTTV_CPU_IRQ = g_quark_from_string("irq"); + LTTV_CPU_SOFT_IRQ = g_quark_from_string("softirq"); LTTV_CPU_TRAP = g_quark_from_string("trap"); LTTV_IRQ_UNKNOWN = g_quark_from_string("unknown"); diff --git a/ltt/branches/poly/lttv/lttv/state.h b/ltt/branches/poly/lttv/lttv/state.h index c71049a8..07867b10 100644 --- a/ltt/branches/poly/lttv/lttv/state.h +++ b/ltt/branches/poly/lttv/lttv/state.h @@ -212,6 +212,7 @@ extern LttvCPUMode LTTV_CPU_IDLE, LTTV_CPU_BUSY, LTTV_CPU_IRQ, + LTTV_CPU_SOFT_IRQ, LTTV_CPU_TRAP; typedef GQuark LttvIRQMode; diff --git a/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.c b/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.c index 48e0fcfb..3e9a647b 100644 --- a/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.c +++ b/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.c @@ -89,6 +89,7 @@ GdkColor drawing_colors_cpu[NUM_COLORS_CPU] = { 0, 0xBBBB, 0xBBBB, 0xBBBB }, /* COL_CPU_IDLE */ { 0, 0xFFFF, 0xFFFF, 0xFFFF }, /* COL_CPU_BUSY */ { 0, 0xFFFF, 0x5E00, 0x0000 }, /* COL_CPU_IRQ */ + { 0, 0xFFFF, 0x9400, 0x9600 }, /* COL_CPU_SOFT_IRQ */ { 0, 0xFF00, 0xFF00, 0x0100 }, /* COL_CPU_TRAP */ }; diff --git a/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.h b/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.h index 434a39b2..0cecd6e6 100644 --- a/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.h +++ b/ltt/branches/poly/lttv/modules/gui/resourceview/drawing.h @@ -55,6 +55,7 @@ typedef enum _draw_color_cpu { COL_CPU_IDLE, COL_CPU_BUSY, COL_CPU_IRQ, + COL_CPU_SOFT_IRQ, COL_CPU_TRAP, NUM_COLORS_CPU } draw_color_cpu; diff --git a/ltt/branches/poly/lttv/modules/gui/resourceview/eventhooks.c b/ltt/branches/poly/lttv/modules/gui/resourceview/eventhooks.c index 5da2a5c1..41fd3841 100644 --- a/ltt/branches/poly/lttv/modules/gui/resourceview/eventhooks.c +++ b/ltt/branches/poly/lttv/modules/gui/resourceview/eventhooks.c @@ -281,6 +281,9 @@ static void cpu_set_line_color(PropertiesLine *prop_line, LttvCPUState *s) else if(present_state == LTTV_CPU_IRQ) { prop_line->color = drawing_colors_cpu[COL_CPU_IRQ]; } + else if(present_state == LTTV_CPU_SOFT_IRQ) { + prop_line->color = drawing_colors_cpu[COL_CPU_SOFT_IRQ]; + } else if(present_state == LTTV_CPU_TRAP) { prop_line->color = drawing_colors_cpu[COL_CPU_TRAP]; } else { -- 2.34.1