diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-generic/vmlinux.lds.h | 2 | ||||
| -rw-r--r-- | include/linux/compiler.h | 19 |
2 files changed, 11 insertions, 10 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index e10beb5335c9..a5e4ed9baec8 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
| @@ -45,7 +45,7 @@ | |||
| 45 | #define MCOUNT_REC() | 45 | #define MCOUNT_REC() |
| 46 | #endif | 46 | #endif |
| 47 | 47 | ||
| 48 | #ifdef CONFIG_TRACE_UNLIKELY_PROFILE | 48 | #ifdef CONFIG_TRACE_BRANCH_PROFILING |
| 49 | #define LIKELY_PROFILE() VMLINUX_SYMBOL(__start_likely_profile) = .; \ | 49 | #define LIKELY_PROFILE() VMLINUX_SYMBOL(__start_likely_profile) = .; \ |
| 50 | *(_ftrace_likely) \ | 50 | *(_ftrace_likely) \ |
| 51 | VMLINUX_SYMBOL(__stop_likely_profile) = .; \ | 51 | VMLINUX_SYMBOL(__stop_likely_profile) = .; \ |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 63b7d9089d6e..c7d804a7a4d6 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
| @@ -59,26 +59,27 @@ extern void __chk_io_ptr(const volatile void __iomem *); | |||
| 59 | * specific implementations come from the above header files | 59 | * specific implementations come from the above header files |
| 60 | */ | 60 | */ |
| 61 | 61 | ||
| 62 | /* | 62 | struct ftrace_branch_data { |
| 63 | * Note: DISABLE_UNLIKELY_PROFILE can be used by special lowlevel code | ||
| 64 | * to disable branch tracing on a per file basis. | ||
| 65 | */ | ||
| 66 | #if defined(CONFIG_TRACE_UNLIKELY_PROFILE) && !defined(DISABLE_UNLIKELY_PROFILE) | ||
| 67 | struct ftrace_likely_data { | ||
| 68 | const char *func; | 63 | const char *func; |
| 69 | const char *file; | 64 | const char *file; |
| 70 | unsigned line; | 65 | unsigned line; |
| 71 | unsigned long correct; | 66 | unsigned long correct; |
| 72 | unsigned long incorrect; | 67 | unsigned long incorrect; |
| 73 | }; | 68 | }; |
| 74 | void ftrace_likely_update(struct ftrace_likely_data *f, int val, int expect); | 69 | |
| 70 | /* | ||
| 71 | * Note: DISABLE_BRANCH_PROFILING can be used by special lowlevel code | ||
| 72 | * to disable branch tracing on a per file basis. | ||
| 73 | */ | ||
| 74 | #if defined(CONFIG_TRACE_BRANCH_PROFILING) && !defined(DISABLE_BRANCH_PROFILING) | ||
| 75 | void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | ||
| 75 | 76 | ||
| 76 | #define likely_notrace(x) __builtin_expect(!!(x), 1) | 77 | #define likely_notrace(x) __builtin_expect(!!(x), 1) |
| 77 | #define unlikely_notrace(x) __builtin_expect(!!(x), 0) | 78 | #define unlikely_notrace(x) __builtin_expect(!!(x), 0) |
| 78 | 79 | ||
| 79 | #define likely_check(x) ({ \ | 80 | #define likely_check(x) ({ \ |
| 80 | int ______r; \ | 81 | int ______r; \ |
| 81 | static struct ftrace_likely_data \ | 82 | static struct ftrace_branch_data \ |
| 82 | __attribute__((__aligned__(4))) \ | 83 | __attribute__((__aligned__(4))) \ |
| 83 | __attribute__((section("_ftrace_likely"))) \ | 84 | __attribute__((section("_ftrace_likely"))) \ |
| 84 | ______f = { \ | 85 | ______f = { \ |
| @@ -93,7 +94,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, int expect); | |||
| 93 | }) | 94 | }) |
| 94 | #define unlikely_check(x) ({ \ | 95 | #define unlikely_check(x) ({ \ |
| 95 | int ______r; \ | 96 | int ______r; \ |
| 96 | static struct ftrace_likely_data \ | 97 | static struct ftrace_branch_data \ |
| 97 | __attribute__((__aligned__(4))) \ | 98 | __attribute__((__aligned__(4))) \ |
| 98 | __attribute__((section("_ftrace_unlikely"))) \ | 99 | __attribute__((section("_ftrace_unlikely"))) \ |
| 99 | ______f = { \ | 100 | ______f = { \ |
