Neat little, not so simple project...
Marcel Moolenaar
marcel at xcllnt.net
Sun Feb 15 14:10:16 PST 2004
On Sun, Feb 15, 2004 at 10:32:30PM +0100, Poul-Henning Kamp wrote:
>
> Modify the code GCC inserts, so that it records if giant was held
> in one bit, and if not held in another, ie:
>
> if (giant)
> *counter_loc |= 1;
> else
> *counter_loc |= 2;
Alternatively, modify the profiling code to "or" a global, like:
*counter_loc |= global_state;
And have each binary condition be represented by two bits. For giant
this can be:
NO_GIANT 1
GIANT 2
To see if code is executed with interrupts enabled or disabled, one
can add:
INT_ENABLE 4
INT_DISABLE 8
and so forth.
When we grab or release giant, we change the global state as follows:
grab: global_state = (global_state & ~NO_GIANT) | GIANT;
rel: global_state = (global_state & ~GIAN) | NO_GIANT;
Likewise for other binary conditions.
> black - not executed.
> red - executed with giant always
> yellow - executed with mixed giant holding
> green - never executed with giant.
The two bit per binary condition then gives the above:
0 = black
1 = green
2 = red
3 = yellow
Just a thought,
--
Marcel Moolenaar USPA: A-39004 marcel at xcllnt.net
More information about the freebsd-hackers
mailing list