diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-02-17 19:09:07 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-17 19:09:07 -0500 |
commit | ac07bcaa8259841905ead3f8cd60b1923ca6c0e5 (patch) | |
tree | 162def1cd53ef477adca17fe06c33a484f6b2e87 /kernel/trace/trace_functions.c | |
parent | 37bd824a35a60abc73e5fa8816bd5f50c913d69b (diff) | |
parent | 35ebf1caa4854ad5ba25f3a72967acc064147994 (diff) |
Merge branch 'tip/tracing/ftrace' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into tracing/ftrace
Diffstat (limited to 'kernel/trace/trace_functions.c')
-rw-r--r-- | kernel/trace/trace_functions.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c index f520aa419df..4c113a8c466 100644 --- a/kernel/trace/trace_functions.c +++ b/kernel/trace/trace_functions.c | |||
@@ -269,21 +269,21 @@ ftrace_traceoff(unsigned long ip, unsigned long parent_ip, void **data) | |||
269 | 269 | ||
270 | static int | 270 | static int |
271 | ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, | 271 | ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, |
272 | struct ftrace_hook_ops *ops, void *data); | 272 | struct ftrace_probe_ops *ops, void *data); |
273 | 273 | ||
274 | static struct ftrace_hook_ops traceon_hook_ops = { | 274 | static struct ftrace_probe_ops traceon_probe_ops = { |
275 | .func = ftrace_traceon, | 275 | .func = ftrace_traceon, |
276 | .print = ftrace_trace_onoff_print, | 276 | .print = ftrace_trace_onoff_print, |
277 | }; | 277 | }; |
278 | 278 | ||
279 | static struct ftrace_hook_ops traceoff_hook_ops = { | 279 | static struct ftrace_probe_ops traceoff_probe_ops = { |
280 | .func = ftrace_traceoff, | 280 | .func = ftrace_traceoff, |
281 | .print = ftrace_trace_onoff_print, | 281 | .print = ftrace_trace_onoff_print, |
282 | }; | 282 | }; |
283 | 283 | ||
284 | static int | 284 | static int |
285 | ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, | 285 | ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, |
286 | struct ftrace_hook_ops *ops, void *data) | 286 | struct ftrace_probe_ops *ops, void *data) |
287 | { | 287 | { |
288 | char str[KSYM_SYMBOL_LEN]; | 288 | char str[KSYM_SYMBOL_LEN]; |
289 | long count = (long)data; | 289 | long count = (long)data; |
@@ -291,12 +291,14 @@ ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, | |||
291 | kallsyms_lookup(ip, NULL, NULL, NULL, str); | 291 | kallsyms_lookup(ip, NULL, NULL, NULL, str); |
292 | seq_printf(m, "%s:", str); | 292 | seq_printf(m, "%s:", str); |
293 | 293 | ||
294 | if (ops == &traceon_hook_ops) | 294 | if (ops == &traceon_probe_ops) |
295 | seq_printf(m, "traceon"); | 295 | seq_printf(m, "traceon"); |
296 | else | 296 | else |
297 | seq_printf(m, "traceoff"); | 297 | seq_printf(m, "traceoff"); |
298 | 298 | ||
299 | if (count != -1) | 299 | if (count == -1) |
300 | seq_printf(m, ":unlimited\n"); | ||
301 | else | ||
300 | seq_printf(m, ":count=%ld", count); | 302 | seq_printf(m, ":count=%ld", count); |
301 | seq_putc(m, '\n'); | 303 | seq_putc(m, '\n'); |
302 | 304 | ||
@@ -306,15 +308,15 @@ ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, | |||
306 | static int | 308 | static int |
307 | ftrace_trace_onoff_unreg(char *glob, char *cmd, char *param) | 309 | ftrace_trace_onoff_unreg(char *glob, char *cmd, char *param) |
308 | { | 310 | { |
309 | struct ftrace_hook_ops *ops; | 311 | struct ftrace_probe_ops *ops; |
310 | 312 | ||
311 | /* we register both traceon and traceoff to this callback */ | 313 | /* we register both traceon and traceoff to this callback */ |
312 | if (strcmp(cmd, "traceon") == 0) | 314 | if (strcmp(cmd, "traceon") == 0) |
313 | ops = &traceon_hook_ops; | 315 | ops = &traceon_probe_ops; |
314 | else | 316 | else |
315 | ops = &traceoff_hook_ops; | 317 | ops = &traceoff_probe_ops; |
316 | 318 | ||
317 | unregister_ftrace_function_hook_func(glob, ops); | 319 | unregister_ftrace_function_probe_func(glob, ops); |
318 | 320 | ||
319 | return 0; | 321 | return 0; |
320 | } | 322 | } |
@@ -322,7 +324,7 @@ ftrace_trace_onoff_unreg(char *glob, char *cmd, char *param) | |||
322 | static int | 324 | static int |
323 | ftrace_trace_onoff_callback(char *glob, char *cmd, char *param, int enable) | 325 | ftrace_trace_onoff_callback(char *glob, char *cmd, char *param, int enable) |
324 | { | 326 | { |
325 | struct ftrace_hook_ops *ops; | 327 | struct ftrace_probe_ops *ops; |
326 | void *count = (void *)-1; | 328 | void *count = (void *)-1; |
327 | char *number; | 329 | char *number; |
328 | int ret; | 330 | int ret; |
@@ -336,9 +338,9 @@ ftrace_trace_onoff_callback(char *glob, char *cmd, char *param, int enable) | |||
336 | 338 | ||
337 | /* we register both traceon and traceoff to this callback */ | 339 | /* we register both traceon and traceoff to this callback */ |
338 | if (strcmp(cmd, "traceon") == 0) | 340 | if (strcmp(cmd, "traceon") == 0) |
339 | ops = &traceon_hook_ops; | 341 | ops = &traceon_probe_ops; |
340 | else | 342 | else |
341 | ops = &traceoff_hook_ops; | 343 | ops = &traceoff_probe_ops; |
342 | 344 | ||
343 | if (!param) | 345 | if (!param) |
344 | goto out_reg; | 346 | goto out_reg; |
@@ -357,7 +359,7 @@ ftrace_trace_onoff_callback(char *glob, char *cmd, char *param, int enable) | |||
357 | return ret; | 359 | return ret; |
358 | 360 | ||
359 | out_reg: | 361 | out_reg: |
360 | ret = register_ftrace_function_hook(glob, ops, count); | 362 | ret = register_ftrace_function_probe(glob, ops, count); |
361 | 363 | ||
362 | return ret; | 364 | return ret; |
363 | } | 365 | } |
@@ -397,6 +399,5 @@ static __init int init_function_trace(void) | |||
397 | init_func_cmd_traceon(); | 399 | init_func_cmd_traceon(); |
398 | return register_tracer(&function_trace); | 400 | return register_tracer(&function_trace); |
399 | } | 401 | } |
400 | |||
401 | device_initcall(init_function_trace); | 402 | device_initcall(init_function_trace); |
402 | 403 | ||