Messages in this thread |  | | | Date | Mon, 22 Mar 2010 23:01:39 +0200 | | From | Avi Kivity <> | | Subject | Re: [PATCH 2/5] jump label: base patch |
| |
On 03/22/2010 06:07 PM, Jason Baron wrote: > base patch to implement 'jump labeling'. Based on a new 'asm goto' inline > assembly gcc mechanism, we can now branch to labels from an 'asm goto' > statment. This allows us to create a 'no-op' fastpath, which can subsequently > be patched with a jump to the slowpath code. This is useful for code which > might be rarely used, but which we'd like to be able to call, if needed. > Tracepoints are the current usecase that these are being implemented for. > > > + > +#define JUMP_LABEL(tag, label, cond) \ > + if (unlikely(cond)) \ > + goto label; >
Suggest wrapping with do { } while (0) to avoid problems with the dangling semicolon or a trailing 'else' from an outer if (). -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.
|  |