Re: [PATCH] Linux Kernel Markers 0.6 for 2.6.17

From: Randy.Dunlap
Date: Thu Sep 21 2006 - 18:19:23 EST


On Thu, 21 Sep 2006 17:56:44 -0400 Mathieu Desnoyers wrote:

> Hi Mathieu,

In your next version, please use a space between "if" and "(".

> --- /dev/null
> +++ b/kernel/marker.c
> @@ -0,0 +1,178 @@
> +/* Pointers can be used around preemption disabled */
> +static int marker_get_pointers(const char *name,
> + struct marker_pointers *ptrs)
> +{
> + if(!(ptrs->call && ptrs->jmpselect && ptrs->jmpcall
> + && ptrs->jmpinline && ptrs->jmpover)) {
> + return ENOENT;
> + }
> +}
> +
> +int marker_set_probe(const char *name, marker_probe_func *probe,
> + enum marker_type type)
> +{
> + if(result) {
> + printk(KERN_NOTICE
> + "Unable to find kallsyms for markers in %s\n",
> + name);
> + goto unlock;
> + }
> +
> + case MARKER_CALL:
> + if(*ptrs.call != __mark_empty_function) {
> + result = EBUSY;
> + printk(KERN_NOTICE
> + "Probe already installed on "
> + "marker in %s\n",
> + name);
> + goto unlock;
> + }
> + case MARKER_INLINE:
> + if(*ptrs.jmpover == *ptrs.jmpinline) {
> + result = ENODEV;
> + printk(KERN_NOTICE
> + "No inline probe exists "
> + "for marker in %s\n",
> + name);
> + goto unlock;
> + }
> +}
> +
> +void marker_disable_probe(const char *name, marker_probe_func *probe,
> + enum marker_type type)
> +{
> + if(result)
> + goto unlock;
> +
> + case MARKER_CALL:
> + if(*ptrs.call == probe) {
> + *ptrs.jmpselect = *ptrs.jmpover;
> + *ptrs.call = __mark_empty_function;
> + }
> + case MARKER_INLINE:
> + if(*ptrs.jmpselect == *ptrs.jmpinline)
> + *ptrs.jmpselect = *ptrs.jmpover;
> + break;
> + if(!result && type == MARKER_CALL)
> + synchronize_sched();
> +}
>

Thanks.
---
~Randy
-
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/