提交 2ed84eeb 编写于 作者: S Steven Rostedt 提交者: Ingo Molnar

trace: rename unlikely profiler to branch profiler

Impact: name change of unlikely tracer and profiler

Ingo Molnar suggested changing the config from UNLIKELY_PROFILE
to BRANCH_PROFILING. I never did like the "unlikely" name so I
went one step farther, and renamed all the unlikely configurations
to a "BRANCH" variant.
Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 68d119f0
master alk-4.19.24 alk-4.19.30 alk-4.19.34 alk-4.19.36 alk-4.19.43 alk-4.19.48 alk-4.19.57 ck-4.19.67 ck-4.19.81 ck-4.19.91 github/fork/deepanshu1422/fix-typo-in-comment github/fork/haosdent/fix-typo linux-next v4.19.91 v4.19.90 v4.19.89 v4.19.88 v4.19.87 v4.19.86 v4.19.85 v4.19.84 v4.19.83 v4.19.82 v4.19.81 v4.19.80 v4.19.79 v4.19.78 v4.19.77 v4.19.76 v4.19.75 v4.19.74 v4.19.73 v4.19.72 v4.19.71 v4.19.70 v4.19.69 v4.19.68 v4.19.67 v4.19.66 v4.19.65 v4.19.64 v4.19.63 v4.19.62 v4.19.61 v4.19.60 v4.19.59 v4.19.58 v4.19.57 v4.19.56 v4.19.55 v4.19.54 v4.19.53 v4.19.52 v4.19.51 v4.19.50 v4.19.49 v4.19.48 v4.19.47 v4.19.46 v4.19.45 v4.19.44 v4.19.43 v4.19.42 v4.19.41 v4.19.40 v4.19.39 v4.19.38 v4.19.37 v4.19.36 v4.19.35 v4.19.34 v4.19.33 v4.19.32 v4.19.31 v4.19.30 v4.19.29 v4.19.28 v4.19.27 v4.19.26 v4.19.25 v4.19.24 v4.19.23 v4.19.22 v4.19.21 v4.19.20 v4.19.19 v4.19.18 v4.19.17 v4.19.16 v4.19.15 v4.19.14 v4.19.13 v4.19.12 v4.19.11 v4.19.10 v4.19.9 v4.19.8 v4.19.7 v4.19.6 v4.19.5 v4.19.4 v4.19.3 v4.19.2 v4.19.1 v4.19 v4.19-rc8 v4.19-rc7 v4.19-rc6 v4.19-rc5 v4.19-rc4 v4.19-rc3 v4.19-rc2 v4.19-rc1 ck-release-21 ck-release-20 ck-release-19.2 ck-release-19.1 ck-release-19 ck-release-18 ck-release-17.2 ck-release-17.1 ck-release-17 ck-release-16 ck-release-15.1 ck-release-15 ck-release-14 ck-release-13.2 ck-release-13 ck-release-12 ck-release-11 ck-release-10 ck-release-9 ck-release-7 alk-release-15 alk-release-14 alk-release-13.2 alk-release-13 alk-release-12 alk-release-11 alk-release-10 alk-release-9 alk-release-7
无相关合并请求
......@@ -18,7 +18,7 @@
*/
/* Disable profiling for userspace code: */
#define DISABLE_UNLIKELY_PROFILE
#define DISABLE_BRANCH_PROFILING
#include <linux/time.h>
#include <linux/init.h>
......
......@@ -10,7 +10,7 @@
*/
/* Disable profiling for userspace code: */
#define DISABLE_UNLIKELY_PROFILE
#define DISABLE_BRANCH_PROFILING
#include <linux/kernel.h>
#include <linux/posix-timers.h>
......
......@@ -45,7 +45,7 @@
#define MCOUNT_REC()
#endif
#ifdef CONFIG_TRACE_UNLIKELY_PROFILE
#ifdef CONFIG_TRACE_BRANCH_PROFILING
#define LIKELY_PROFILE() VMLINUX_SYMBOL(__start_likely_profile) = .; \
*(_ftrace_likely) \
VMLINUX_SYMBOL(__stop_likely_profile) = .; \
......
......@@ -59,26 +59,27 @@ extern void __chk_io_ptr(const volatile void __iomem *);
* specific implementations come from the above header files
*/
/*
* Note: DISABLE_UNLIKELY_PROFILE can be used by special lowlevel code
* to disable branch tracing on a per file basis.
*/
#if defined(CONFIG_TRACE_UNLIKELY_PROFILE) && !defined(DISABLE_UNLIKELY_PROFILE)
struct ftrace_likely_data {
struct ftrace_branch_data {
const char *func;
const char *file;
unsigned line;
unsigned long correct;
unsigned long incorrect;
};
void ftrace_likely_update(struct ftrace_likely_data *f, int val, int expect);
/*
* Note: DISABLE_BRANCH_PROFILING can be used by special lowlevel code
* to disable branch tracing on a per file basis.
*/
#if defined(CONFIG_TRACE_BRANCH_PROFILING) && !defined(DISABLE_BRANCH_PROFILING)
void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
#define likely_notrace(x) __builtin_expect(!!(x), 1)
#define unlikely_notrace(x) __builtin_expect(!!(x), 0)
#define likely_check(x) ({ \
int ______r; \
static struct ftrace_likely_data \
static struct ftrace_branch_data \
__attribute__((__aligned__(4))) \
__attribute__((section("_ftrace_likely"))) \
______f = { \
......@@ -93,7 +94,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, int expect);
})
#define unlikely_check(x) ({ \
int ______r; \
static struct ftrace_likely_data \
static struct ftrace_branch_data \
__attribute__((__aligned__(4))) \
__attribute__((section("_ftrace_unlikely"))) \
______f = { \
......
......@@ -159,7 +159,7 @@ config BOOT_TRACER
selected, because the self-tests are an initcall as well and that
would invalidate the boot trace. )
config TRACE_UNLIKELY_PROFILE
config TRACE_BRANCH_PROFILING
bool "Trace likely/unlikely profiler"
depends on DEBUG_KERNEL
select TRACING
......@@ -175,7 +175,7 @@ config TRACE_UNLIKELY_PROFILE
Say N if unsure.
config TRACING_UNLIKELY
config TRACING_BRANCHES
bool
help
Selected by tracers that will trace the likely and unlikely
......@@ -183,10 +183,10 @@ config TRACING_UNLIKELY
profiled. Profiling the tracing infrastructure can only happen
when the likelys and unlikelys are not being traced.
config UNLIKELY_TRACER
config BRANCH_TRACER
bool "Trace likely/unlikely instances"
depends on TRACE_UNLIKELY_PROFILE
select TRACING_UNLIKELY
depends on TRACE_BRANCH_PROFILING
select TRACING_BRANCHES
help
This traces the events of likely and unlikely condition
calls in the kernel. The difference between this and the
......
......@@ -11,9 +11,8 @@ obj-y += trace_selftest_dynamic.o
endif
# If unlikely tracing is enabled, do not trace these files
ifdef CONFIG_TRACING_UNLIKELY
KBUILD_CFLAGS += '-Dlikely(x)=likely_notrace(x)'
KBUILD_CFLAGS += '-Dunlikely(x)=unlikely_notrace(x)'
ifdef CONFIG_TRACING_BRANCHES
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
endif
obj-$(CONFIG_FUNCTION_TRACER) += libftrace.o
......@@ -31,6 +30,6 @@ obj-$(CONFIG_STACK_TRACER) += trace_stack.o
obj-$(CONFIG_MMIOTRACE) += trace_mmiotrace.o
obj-$(CONFIG_BOOT_TRACER) += trace_boot.o
obj-$(CONFIG_FUNCTION_RET_TRACER) += trace_functions_return.o
obj-$(CONFIG_TRACE_UNLIKELY_PROFILE) += trace_unlikely.o
obj-$(CONFIG_TRACE_BRANCH_PROFILING) += trace_unlikely.o
libftrace-y := ftrace.o
......@@ -258,7 +258,7 @@ static const char *trace_options[] = {
"sched-tree",
"ftrace_printk",
"ftrace_preempt",
#ifdef CONFIG_UNLIKELY_TRACER
#ifdef CONFIG_BRANCH_TRACER
"unlikely",
#endif
NULL
......
......@@ -468,7 +468,7 @@ enum trace_iterator_flags {
TRACE_ITER_SCHED_TREE = 0x200,
TRACE_ITER_PRINTK = 0x400,
TRACE_ITER_PREEMPTONLY = 0x800,
#ifdef CONFIG_UNLIKELY_TRACER
#ifdef CONFIG_BRANCH_TRACER
TRACE_ITER_UNLIKELY = 0x1000,
#endif
};
......@@ -530,7 +530,7 @@ static inline void ftrace_preempt_enable(int resched)
preempt_enable_notrace();
}
#ifdef CONFIG_UNLIKELY_TRACER
#ifdef CONFIG_BRANCH_TRACER
extern int enable_unlikely_tracing(struct trace_array *tr);
extern void disable_unlikely_tracing(void);
static inline int trace_unlikely_enable(struct trace_array *tr)
......@@ -552,6 +552,6 @@ static inline int trace_unlikely_enable(struct trace_array *tr)
static inline void trace_unlikely_disable(void)
{
}
#endif /* CONFIG_UNLIKELY_TRACER */
#endif /* CONFIG_BRANCH_TRACER */
#endif /* _LINUX_KERNEL_TRACE_H */
......@@ -15,7 +15,7 @@
#include <asm/local.h>
#include "trace.h"
#ifdef CONFIG_UNLIKELY_TRACER
#ifdef CONFIG_BRANCH_TRACER
static int unlikely_tracing_enabled __read_mostly;
static DEFINE_MUTEX(unlikely_tracing_mutex);
......@@ -119,7 +119,7 @@ static inline
void trace_likely_condition(struct ftrace_likely_data *f, int val, int expect)
{
}
#endif /* CONFIG_UNLIKELY_TRACER */
#endif /* CONFIG_BRANCH_TRACER */
void ftrace_likely_update(struct ftrace_likely_data *f, int val, int expect)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册