Re: [PATCH] markers-doc-update-flags-example

Randy Dunlap
2007-04-11T02:36:12Z

On Tue, 10 Apr 2007 19:26:20 -0400 Mathieu Desnoyers wrote:

> ------------------------------ CUT -------------------------------------
> /* probe-example.c
> *
> - * Loads a function at a marker call site.
> + * Connects a two functions to marker call sites.

s/a //

> *
> * (C) Copyright 2007 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
> *
> @@ -109,67 +113,83 @@ Flag compatibility is checked before connecting the probe to the marker.
>
> #include <linux/sched.h>
> #include <linux/kernel.h>
> +#include <linux/module.h>
> #include <linux/marker.h>
> +#include <asm/atomic.h>
> +
> +#define NUM_PROBES (sizeof(probe_array) / sizeof(struct probe_data))

#define NUM_PROBES ARRAY_SIZE(probe_array)

> -#define SUBSYSTEM_EVENT_FORMAT "%d %s %p[struct task_struct]"
> -void probe_subsystem_event(const char *format, ...)
> +struct probe_data {
> + const char *name;
> + const char *format;
> + marker_probe_func *probe_func;
> +};
> +
>
> +static struct probe_data probe_array[] =
> +{
> + { .name = "subsystem_event",
> + .format = "%d %s",
> + .probe_func = probe_subsystem_event },
> + { .name = "subsystem_eventb",
> + .format = MARK_NOARGS,
> + .probe_func = probe_subsystem_eventb },
> +};
> +

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***