update probe
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 25 Sep 2006 23:17:57 +0000 (23:17 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 25 Sep 2006 23:17:57 +0000 (23:17 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2137 04897980-b3bd-0310-b5e0-8ef037075253

tests/kernel/probe.c
tests/kernel/test-mark.c

index f8916a1a77d05cc23c101bd57566d40ef8e30afc..5f2c484b0a0b40802a63d7525c254357a15f7c8e 100644 (file)
 
 /* function to install */
 #define DO_MARK1_FORMAT "%d"
-asmlinkage void do_mark1(const char *format, int value)
+void do_mark1(const char *format, ...)
 {
-       __mark_check_format(DO_MARK1_FORMAT, value);
+       va_list ap;
+       int value;
+
+       va_start(ap, format);
+       value = va_arg(ap, int);
        printk("value is %d\n", value);
+       
+       va_end(ap);
 }
 
-#define DO_MARK2_FORMAT "%d %s"
-asmlinkage void do_mark2(const char *format, int value, const char *string)
+void do_mark2(const char *format, ...)
 {
-       __mark_check_format(DO_MARK2_FORMAT, value, string);
-       printk("value is %d %s\n", value, string);
+       va_list ap;
+
+       va_start(ap, format);
+       vprintk(format, ap);
+       va_end(ap);
+       printk("\n");
 }
 
 #define DO_MARK3_FORMAT "%d %s %s"
-asmlinkage void do_mark3(const char *format, int value, const char *s1,
-                               const char *s2)
+void do_mark3(const char *format, ...)
 {
-       __mark_check_format(DO_MARK3_FORMAT, value, s1, s2);
-       printk("value is %d %s %s\n", value, s1, s2);
+       va_list ap;
+       int value;
+       const char *s1, *s2;
+       
+       va_start(ap, format);
+       value = va_arg(ap, int);
+       s1 = va_arg(ap, const char*);
+       s2 = va_arg(ap, const char *);
+
+       printk("value is %d %s %s\n",
+               value, s1, s2);
+       va_end(ap);
 }
 
 int init_module(void)
@@ -41,7 +59,7 @@ int init_module(void)
        result = marker_set_probe("subsys_mark1", DO_MARK1_FORMAT,
                        (marker_probe_func*)do_mark1);
        if(!result) goto end;
-       result = marker_set_probe("subsys_mark2", DO_MARK2_FORMAT,
+       result = marker_set_probe("subsys_mark2", NULL,
                        (marker_probe_func*)do_mark2);
        if(!result) goto cleanup1;
        result = marker_set_probe("subsys_mark3", DO_MARK3_FORMAT,
@@ -68,4 +86,3 @@ void cleanup_module(void)
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Mathieu Desnoyers");
 MODULE_DESCRIPTION("Probe");
-
index 080e5a5f85ab2e4c9a80b0e7a335321d3a98e376..223b2490dbfd589905f8a640152e8764762690bc 100644 (file)
@@ -8,7 +8,7 @@
 #include <linux/sched.h>
 #include <asm/ptrace.h>
 
-volatile int x=7;
+volatile int x = 7;
 
 struct proc_dir_entry *pentry = NULL;
 
@@ -23,10 +23,8 @@ static int my_open(struct inode *inode, struct file *file)
 
        for(i=0; i<2; i++) {
                MARK(subsys_mark1, "%d", 1);
-               x=i;
-               barrier();
        }
-       MARK(subsys_mark2, "%d %s", 2, "blah2");
+       MARK(subsys_mark2, "%d %s %s", 2, "blah2", "blahx");
        MARK(subsys_mark3, "%d %s %s", x, "blah3", "blah5");
        test(NULL);
        test(NULL);
@@ -41,8 +39,6 @@ static struct file_operations my_operations = {
 
 int init_module(void)
 {
-       unsigned int i;
-
        pentry = create_proc_entry("testmark", 0444, NULL);
        if (pentry)
                pentry->proc_fops = &my_operations;
This page took 0.02586 seconds and 4 git commands to generate.