Re: [PATCH] tracing: Cleanup the convoluted softirq tracepoints
From: Peter Zijlstra
Date: Tue Oct 19 2010 - 18:26:16 EST
On Wed, October 20, 2010 12:23 am, Steven Rostedt wrote:
>> static __always_inline __pure bool __switch_point(...)
>> {
>> asm goto("1: " JUMP_LABEL_INITIAL_NOP
>> /* ... patching stuff */
>> : : : : t_jump);
>> return false;
>> t_jump:
>> return true;
>> }
>>
>> #define SWITCH_POINT(x) unlikely(__switch_point(x))
>>
>> I *suspect* this will resolve the need for hot/cold labels just fine.
>
> Interesting, we could try this.
Due to not actually having a sane key type the above is not easy to
implement, but I tried:
#define _SWITCH_POINT(x)\
({ \
__label__ jl_enabled; \
bool ret = true; \
JUMP_LABEL(x, jl_enabled); \
ret = false; \
jl_enabled: \
ret; })
#define SWITCH_POINT(x) unlikely(_SWITCH_POINT(x))
#define COND_STMT(key, stmt) \
do { \
if (SWITCH_POINT(key)) { \
stmt; \
} \
} while (0)
and that's still generating these double jumps.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/