]> err.no Git - linux-2.6/blobdiff - kernel/trace/trace_selftest.c
ftrace: avoid modifying kprobe'd records
[linux-2.6] / kernel / trace / trace_selftest.c
index 395274e783b34b0fa5c6e26f0eaa9595adf9b4a8..18c5423bc9777390c9442a5b461b5b67ba1d71f1 100644 (file)
@@ -28,6 +28,7 @@ trace_test_buffer_cpu(struct trace_array *tr, struct trace_array_cpu *data)
        page = list_entry(data->trace_pages.next, struct page, lru);
        entries = page_address(page);
 
+       check_pages(data);
        if (head_page(data) != entries)
                goto failed;
 
@@ -123,6 +124,7 @@ int trace_selftest_startup_dynamic_tracing(struct tracer *trace,
        int ret;
        int save_ftrace_enabled = ftrace_enabled;
        int save_tracer_enabled = tracer_enabled;
+       char *func_name;
 
        /* The ftrace test PASSED */
        printk(KERN_CONT "PASSED\n");
@@ -142,9 +144,15 @@ int trace_selftest_startup_dynamic_tracing(struct tracer *trace,
                return ret;
        }
 
+       /*
+        * Some archs *cough*PowerPC*cough* add charachters to the
+        * start of the function names. We simply put a '*' to
+        * accomodate them.
+        */
+       func_name = "*" STR(DYN_FTRACE_TEST_NAME);
+
        /* filter only on our function */
-       ftrace_set_filter(STR(DYN_FTRACE_TEST_NAME),
-                         sizeof(STR(DYN_FTRACE_TEST_NAME)), 1);
+       ftrace_set_filter(func_name, strlen(func_name), 1);
 
        /* enable tracing */
        tr->ctrl = 1;
@@ -410,11 +418,11 @@ trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *
 #ifdef CONFIG_SCHED_TRACER
 static int trace_wakeup_test_thread(void *data)
 {
-       struct completion *x = data;
-
        /* Make this a RT thread, doesn't need to be too high */
+       struct sched_param param = { .sched_priority = 5 };
+       struct completion *x = data;
 
-       rt_mutex_setprio(current, MAX_RT_PRIO - 5);
+       sched_setscheduler(current, SCHED_FIFO, &param);
 
        /* Make it know we have a new prio */
        complete(x);