trace_selftest.c (05bd68c514579e007b46e4fa0461b78416a3f4c2) | trace_selftest.c (4e491d14f2506b218d678935c25a7027b79178b1) |
---|---|
1/* Include in trace.c */ 2 3#include <linux/kthread.h> 4#include <linux/delay.h> 5 6static inline int trace_valid_entry(struct trace_entry *entry) 7{ 8 switch (entry->type) { --- 109 unchanged lines hidden (view full) --- 118int trace_selftest_startup_dynamic_tracing(struct tracer *trace, 119 struct trace_array *tr, 120 int (*func)(void)) 121{ 122 unsigned long count; 123 int ret; 124 int save_ftrace_enabled = ftrace_enabled; 125 int save_tracer_enabled = tracer_enabled; | 1/* Include in trace.c */ 2 3#include <linux/kthread.h> 4#include <linux/delay.h> 5 6static inline int trace_valid_entry(struct trace_entry *entry) 7{ 8 switch (entry->type) { --- 109 unchanged lines hidden (view full) --- 118int trace_selftest_startup_dynamic_tracing(struct tracer *trace, 119 struct trace_array *tr, 120 int (*func)(void)) 121{ 122 unsigned long count; 123 int ret; 124 int save_ftrace_enabled = ftrace_enabled; 125 int save_tracer_enabled = tracer_enabled; |
126 char *func_name; |
|
126 127 /* The ftrace test PASSED */ 128 printk(KERN_CONT "PASSED\n"); 129 pr_info("Testing dynamic ftrace: "); 130 131 /* enable tracing, and record the filter function */ 132 ftrace_enabled = 1; 133 tracer_enabled = 1; 134 135 /* passed in by parameter to fool gcc from optimizing */ 136 func(); 137 138 /* update the records */ 139 ret = ftrace_force_update(); 140 if (ret) { 141 printk(KERN_CONT ".. ftraced failed .. "); 142 return ret; 143 } 144 | 127 128 /* The ftrace test PASSED */ 129 printk(KERN_CONT "PASSED\n"); 130 pr_info("Testing dynamic ftrace: "); 131 132 /* enable tracing, and record the filter function */ 133 ftrace_enabled = 1; 134 tracer_enabled = 1; 135 136 /* passed in by parameter to fool gcc from optimizing */ 137 func(); 138 139 /* update the records */ 140 ret = ftrace_force_update(); 141 if (ret) { 142 printk(KERN_CONT ".. ftraced failed .. "); 143 return ret; 144 } 145 |
146 /* 147 * Some archs *cough*PowerPC*cough* add charachters to the 148 * start of the function names. We simply put a '*' to 149 * accomodate them. 150 */ 151 func_name = "*" STR(DYN_FTRACE_TEST_NAME); 152 |
|
145 /* filter only on our function */ | 153 /* filter only on our function */ |
146 ftrace_set_filter(STR(DYN_FTRACE_TEST_NAME), 147 sizeof(STR(DYN_FTRACE_TEST_NAME)), 1); | 154 ftrace_set_filter(func_name, strlen(func_name), 1); |
148 149 /* enable tracing */ 150 tr->ctrl = 1; 151 trace->init(tr); 152 /* Sleep for a 1/10 of a second */ 153 msleep(100); 154 155 /* we should have nothing in the buffer */ --- 377 unchanged lines hidden --- | 155 156 /* enable tracing */ 157 tr->ctrl = 1; 158 trace->init(tr); 159 /* Sleep for a 1/10 of a second */ 160 msleep(100); 161 162 /* we should have nothing in the buffer */ --- 377 unchanged lines hidden --- |