Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ed84eeb authored by Steven Rostedt's avatar Steven Rostedt Committed by Ingo Molnar
Browse files

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: default avatarSteven Rostedt <srostedt@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 68d119f0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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>
+1 −1
Original line number Diff line number Diff line
@@ -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>
+1 −1
Original line number Diff line number Diff line
@@ -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) = .;    \
+10 −9
Original line number Diff line number Diff line
@@ -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 = {				\
+5 −5
Original line number Diff line number Diff line
@@ -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
Loading