diff options
Diffstat (limited to 'include/linux/ftrace.h')
| -rw-r--r-- | include/linux/ftrace.h | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index ae9504b4b67d..404a686a3644 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
| @@ -62,9 +62,6 @@ typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip, | |||
| 62 | * set in the flags member. | 62 | * set in the flags member. |
| 63 | * | 63 | * |
| 64 | * ENABLED - set/unset when ftrace_ops is registered/unregistered | 64 | * ENABLED - set/unset when ftrace_ops is registered/unregistered |
| 65 | * GLOBAL - set manualy by ftrace_ops user to denote the ftrace_ops | ||
| 66 | * is part of the global tracers sharing the same filter | ||
| 67 | * via set_ftrace_* debugfs files. | ||
| 68 | * DYNAMIC - set when ftrace_ops is registered to denote dynamically | 65 | * DYNAMIC - set when ftrace_ops is registered to denote dynamically |
| 69 | * allocated ftrace_ops which need special care | 66 | * allocated ftrace_ops which need special care |
| 70 | * CONTROL - set manualy by ftrace_ops user to denote the ftrace_ops | 67 | * CONTROL - set manualy by ftrace_ops user to denote the ftrace_ops |
| @@ -96,15 +93,14 @@ typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip, | |||
| 96 | */ | 93 | */ |
| 97 | enum { | 94 | enum { |
| 98 | FTRACE_OPS_FL_ENABLED = 1 << 0, | 95 | FTRACE_OPS_FL_ENABLED = 1 << 0, |
| 99 | FTRACE_OPS_FL_GLOBAL = 1 << 1, | 96 | FTRACE_OPS_FL_DYNAMIC = 1 << 1, |
| 100 | FTRACE_OPS_FL_DYNAMIC = 1 << 2, | 97 | FTRACE_OPS_FL_CONTROL = 1 << 2, |
| 101 | FTRACE_OPS_FL_CONTROL = 1 << 3, | 98 | FTRACE_OPS_FL_SAVE_REGS = 1 << 3, |
| 102 | FTRACE_OPS_FL_SAVE_REGS = 1 << 4, | 99 | FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED = 1 << 4, |
| 103 | FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED = 1 << 5, | 100 | FTRACE_OPS_FL_RECURSION_SAFE = 1 << 5, |
| 104 | FTRACE_OPS_FL_RECURSION_SAFE = 1 << 6, | 101 | FTRACE_OPS_FL_STUB = 1 << 6, |
| 105 | FTRACE_OPS_FL_STUB = 1 << 7, | 102 | FTRACE_OPS_FL_INITIALIZED = 1 << 7, |
| 106 | FTRACE_OPS_FL_INITIALIZED = 1 << 8, | 103 | FTRACE_OPS_FL_DELETED = 1 << 8, |
| 107 | FTRACE_OPS_FL_DELETED = 1 << 9, | ||
| 108 | }; | 104 | }; |
| 109 | 105 | ||
| 110 | /* | 106 | /* |
| @@ -366,14 +362,12 @@ enum { | |||
| 366 | * IGNORE - The function is already what we want it to be | 362 | * IGNORE - The function is already what we want it to be |
| 367 | * MAKE_CALL - Start tracing the function | 363 | * MAKE_CALL - Start tracing the function |
| 368 | * MODIFY_CALL - Stop saving regs for the function | 364 | * MODIFY_CALL - Stop saving regs for the function |
| 369 | * MODIFY_CALL_REGS - Start saving regs for the function | ||
| 370 | * MAKE_NOP - Stop tracing the function | 365 | * MAKE_NOP - Stop tracing the function |
| 371 | */ | 366 | */ |
| 372 | enum { | 367 | enum { |
| 373 | FTRACE_UPDATE_IGNORE, | 368 | FTRACE_UPDATE_IGNORE, |
| 374 | FTRACE_UPDATE_MAKE_CALL, | 369 | FTRACE_UPDATE_MAKE_CALL, |
| 375 | FTRACE_UPDATE_MODIFY_CALL, | 370 | FTRACE_UPDATE_MODIFY_CALL, |
| 376 | FTRACE_UPDATE_MODIFY_CALL_REGS, | ||
| 377 | FTRACE_UPDATE_MAKE_NOP, | 371 | FTRACE_UPDATE_MAKE_NOP, |
| 378 | }; | 372 | }; |
| 379 | 373 | ||
| @@ -404,6 +398,8 @@ int ftrace_update_record(struct dyn_ftrace *rec, int enable); | |||
| 404 | int ftrace_test_record(struct dyn_ftrace *rec, int enable); | 398 | int ftrace_test_record(struct dyn_ftrace *rec, int enable); |
| 405 | void ftrace_run_stop_machine(int command); | 399 | void ftrace_run_stop_machine(int command); |
| 406 | unsigned long ftrace_location(unsigned long ip); | 400 | unsigned long ftrace_location(unsigned long ip); |
| 401 | unsigned long ftrace_get_addr_new(struct dyn_ftrace *rec); | ||
| 402 | unsigned long ftrace_get_addr_curr(struct dyn_ftrace *rec); | ||
| 407 | 403 | ||
| 408 | extern ftrace_func_t ftrace_trace_function; | 404 | extern ftrace_func_t ftrace_trace_function; |
| 409 | 405 | ||
| @@ -616,25 +612,27 @@ static inline void __ftrace_enabled_restore(int enabled) | |||
| 616 | #endif | 612 | #endif |
| 617 | } | 613 | } |
| 618 | 614 | ||
| 619 | #ifndef HAVE_ARCH_CALLER_ADDR | 615 | /* All archs should have this, but we define it for consistency */ |
| 616 | #ifndef ftrace_return_address0 | ||
| 617 | # define ftrace_return_address0 __builtin_return_address(0) | ||
| 618 | #endif | ||
| 619 | |||
| 620 | /* Archs may use other ways for ADDR1 and beyond */ | ||
| 621 | #ifndef ftrace_return_address | ||
| 620 | # ifdef CONFIG_FRAME_POINTER | 622 | # ifdef CONFIG_FRAME_POINTER |
| 621 | # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0)) | 623 | # define ftrace_return_address(n) __builtin_return_address(n) |
| 622 | # define CALLER_ADDR1 ((unsigned long)__builtin_return_address(1)) | ||
| 623 | # define CALLER_ADDR2 ((unsigned long)__builtin_return_address(2)) | ||
| 624 | # define CALLER_ADDR3 ((unsigned long)__builtin_return_address(3)) | ||
| 625 | # define CALLER_ADDR4 ((unsigned long)__builtin_return_address(4)) | ||
| 626 | # define CALLER_ADDR5 ((unsigned long)__builtin_return_address(5)) | ||
| 627 | # define CALLER_ADDR6 ((unsigned long)__builtin_return_address(6)) | ||
| 628 | # else | 624 | # else |
| 629 | # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0)) | 625 | # define ftrace_return_address(n) 0UL |
| 630 | # define CALLER_ADDR1 0UL | ||
| 631 | # define CALLER_ADDR2 0UL | ||
| 632 | # define CALLER_ADDR3 0UL | ||
| 633 | # define CALLER_ADDR4 0UL | ||
| 634 | # define CALLER_ADDR5 0UL | ||
| 635 | # define CALLER_ADDR6 0UL | ||
| 636 | # endif | 626 | # endif |
| 637 | #endif /* ifndef HAVE_ARCH_CALLER_ADDR */ | 627 | #endif |
| 628 | |||
| 629 | #define CALLER_ADDR0 ((unsigned long)ftrace_return_address0) | ||
| 630 | #define CALLER_ADDR1 ((unsigned long)ftrace_return_address(1)) | ||
| 631 | #define CALLER_ADDR2 ((unsigned long)ftrace_return_address(2)) | ||
| 632 | #define CALLER_ADDR3 ((unsigned long)ftrace_return_address(3)) | ||
| 633 | #define CALLER_ADDR4 ((unsigned long)ftrace_return_address(4)) | ||
| 634 | #define CALLER_ADDR5 ((unsigned long)ftrace_return_address(5)) | ||
| 635 | #define CALLER_ADDR6 ((unsigned long)ftrace_return_address(6)) | ||
| 638 | 636 | ||
| 639 | #ifdef CONFIG_IRQSOFF_TRACER | 637 | #ifdef CONFIG_IRQSOFF_TRACER |
| 640 | extern void time_hardirqs_on(unsigned long a0, unsigned long a1); | 638 | extern void time_hardirqs_on(unsigned long a0, unsigned long a1); |
