[RFC patch 38/41] Markers examples API update

From: Mathieu Desnoyers
Date: Thu Mar 05 2009 - 18:25:43 EST


Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxx>
---
samples/markers/marker-example.c | 4 ++--
samples/markers/probe-example.c | 10 ++++++----
samples/markers/test-multi.c | 4 ++--
3 files changed, 10 insertions(+), 8 deletions(-)

Index: linux-2.6-lttng/samples/markers/marker-example.c
===================================================================
--- linux-2.6-lttng.orig/samples/markers/marker-example.c 2009-02-06 14:45:12.000000000 -0500
+++ linux-2.6-lttng/samples/markers/marker-example.c 2009-02-06 15:40:05.000000000 -0500
@@ -19,10 +19,10 @@ static int my_open(struct inode *inode,
{
int i;

- trace_mark(subsystem_event, "integer %d string %s", 123,
+ trace_mark(samples, subsystem_event, "integer %d string %s", 123,
"example string");
for (i = 0; i < 10; i++)
- trace_mark(subsystem_eventb, MARK_NOARGS);
+ trace_mark(samples, subsystem_eventb, MARK_NOARGS);
return -EPERM;
}

Index: linux-2.6-lttng/samples/markers/probe-example.c
===================================================================
--- linux-2.6-lttng.orig/samples/markers/probe-example.c 2009-02-06 14:45:12.000000000 -0500
+++ linux-2.6-lttng/samples/markers/probe-example.c 2009-02-06 15:40:05.000000000 -0500
@@ -20,7 +20,8 @@ struct probe_data {
marker_probe_func *probe_func;
};

-void probe_subsystem_event(void *probe_data, void *call_data,
+void probe_subsystem_event(const struct marker *mdata,
+ void *probe_data, void *call_data,
const char *format, va_list *args)
{
/* Declare args */
@@ -39,7 +40,8 @@ void probe_subsystem_event(void *probe_d

atomic_t eventb_count = ATOMIC_INIT(0);

-void probe_subsystem_eventb(void *probe_data, void *call_data,
+void probe_subsystem_eventb(const struct marker *mdata,
+ void *probe_data, void *call_data,
const char *format, va_list *args)
{
/* Increment counter */
@@ -62,7 +64,7 @@ static int __init probe_init(void)
int i;

for (i = 0; i < ARRAY_SIZE(probe_array); i++) {
- result = marker_probe_register(probe_array[i].name,
+ result = marker_probe_register("samples", probe_array[i].name,
probe_array[i].format,
probe_array[i].probe_func, &probe_array[i]);
if (result)
@@ -77,7 +79,7 @@ static void __exit probe_fini(void)
int i;

for (i = 0; i < ARRAY_SIZE(probe_array); i++)
- marker_probe_unregister(probe_array[i].name,
+ marker_probe_unregister("samples", probe_array[i].name,
probe_array[i].probe_func, &probe_array[i]);
printk(KERN_INFO "Number of event b : %u\n",
atomic_read(&eventb_count));
Index: linux-2.6-lttng/samples/markers/test-multi.c
===================================================================
--- linux-2.6-lttng.orig/samples/markers/test-multi.c 2009-02-06 15:39:59.000000000 -0500
+++ linux-2.6-lttng/samples/markers/test-multi.c 2009-02-06 15:40:05.000000000 -0500
@@ -81,7 +81,7 @@ static int __init probe_init(void)
int i;

for (i = 0; i < ARRAY_SIZE(probe_array); i++) {
- result = marker_probe_register(probe_array[i].name,
+ result = marker_probe_register("samples", probe_array[i].name,
probe_array[i].format,
probe_array[i].probe_func, (void*)(long)i);
if (result)
@@ -97,7 +97,7 @@ static void __exit probe_fini(void)
int i;

for (i = 0; i < ARRAY_SIZE(probe_array); i++) {
- result = marker_probe_unregister(probe_array[i].name,
+ result = marker_probe_unregister("samples", probe_array[i].name,
probe_array[i].probe_func, (void*)(long)i);
if (result)
printk(KERN_INFO "Unable to unregister probe %s\n",

--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
--
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/