"ftrace_printk",
"ftrace_preempt",
#ifdef CONFIG_BRANCH_TRACER
- "unlikely",
+ "branch",
#endif
NULL
};
trace_seq_print_cont(s, iter);
break;
}
- case TRACE_UNLIKELY: {
- struct trace_unlikely *field;
+ case TRACE_BRANCH: {
+ struct trace_branch *field;
trace_assign_type(field, entry);
return print_return_function(iter);
break;
}
- case TRACE_UNLIKELY: {
- struct trace_unlikely *field;
+ case TRACE_BRANCH: {
+ struct trace_branch *field;
trace_assign_type(field, entry);
if (t == current_trace)
goto out;
- trace_unlikely_disable();
+ trace_branch_disable();
if (current_trace && current_trace->reset)
current_trace->reset(tr);
if (t->init)
t->init(tr);
- trace_unlikely_enable(tr);
+ trace_branch_enable(tr);
out:
mutex_unlock(&trace_types_lock);
TRACE_SPECIAL,
TRACE_MMIO_RW,
TRACE_MMIO_MAP,
- TRACE_UNLIKELY,
+ TRACE_BRANCH,
TRACE_BOOT_CALL,
TRACE_BOOT_RET,
TRACE_FN_RET,
#define TRACE_FUNC_SIZE 30
#define TRACE_FILE_SIZE 20
-struct trace_unlikely {
+struct trace_branch {
struct trace_entry ent;
unsigned line;
char func[TRACE_FUNC_SIZE+1];
TRACE_MMIO_MAP); \
IF_ASSIGN(var, ent, struct trace_boot_call, TRACE_BOOT_CALL);\
IF_ASSIGN(var, ent, struct trace_boot_ret, TRACE_BOOT_RET);\
- IF_ASSIGN(var, ent, struct trace_unlikely, TRACE_UNLIKELY); \
+ IF_ASSIGN(var, ent, struct trace_branch, TRACE_BRANCH); \
IF_ASSIGN(var, ent, struct ftrace_ret_entry, TRACE_FN_RET);\
__ftrace_bad_type(); \
} while (0)
TRACE_ITER_PRINTK = 0x400,
TRACE_ITER_PREEMPTONLY = 0x800,
#ifdef CONFIG_BRANCH_TRACER
- TRACE_ITER_UNLIKELY = 0x1000,
+ TRACE_ITER_BRANCH = 0x1000,
#endif
};
}
#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)
+extern int enable_branch_tracing(struct trace_array *tr);
+extern void disable_branch_tracing(void);
+static inline int trace_branch_enable(struct trace_array *tr)
{
- if (trace_flags & TRACE_ITER_UNLIKELY)
- return enable_unlikely_tracing(tr);
+ if (trace_flags & TRACE_ITER_BRANCH)
+ return enable_branch_tracing(tr);
return 0;
}
-static inline void trace_unlikely_disable(void)
+static inline void trace_branch_disable(void)
{
/* due to races, always disable */
- disable_unlikely_tracing();
+ disable_branch_tracing();
}
#else
-static inline int trace_unlikely_enable(struct trace_array *tr)
+static inline int trace_branch_enable(struct trace_array *tr)
{
return 0;
}
-static inline void trace_unlikely_disable(void)
+static inline void trace_branch_disable(void)
{
}
#endif /* CONFIG_BRANCH_TRACER */
#ifdef CONFIG_BRANCH_TRACER
-static int unlikely_tracing_enabled __read_mostly;
-static DEFINE_MUTEX(unlikely_tracing_mutex);
-static struct trace_array *unlikely_tracer;
+static int branch_tracing_enabled __read_mostly;
+static DEFINE_MUTEX(branch_tracing_mutex);
+static struct trace_array *branch_tracer;
static void
-probe_likely_condition(struct ftrace_likely_data *f, int val, int expect)
+probe_likely_condition(struct ftrace_branch_data *f, int val, int expect)
{
- struct trace_array *tr = unlikely_tracer;
+ struct trace_array *tr = branch_tracer;
struct ring_buffer_event *event;
- struct trace_unlikely *entry;
+ struct trace_branch *entry;
unsigned long flags, irq_flags;
int cpu, pc;
const char *p;
pc = preempt_count();
entry = ring_buffer_event_data(event);
tracing_generic_entry_update(&entry->ent, flags, pc);
- entry->ent.type = TRACE_UNLIKELY;
+ entry->ent.type = TRACE_BRANCH;
/* Strip off the path, only save the file */
p = f->file + strlen(f->file);
}
static inline
-void trace_likely_condition(struct ftrace_likely_data *f, int val, int expect)
+void trace_likely_condition(struct ftrace_branch_data *f, int val, int expect)
{
- if (!unlikely_tracing_enabled)
+ if (!branch_tracing_enabled)
return;
probe_likely_condition(f, val, expect);
}
-int enable_unlikely_tracing(struct trace_array *tr)
+int enable_branch_tracing(struct trace_array *tr)
{
int ret = 0;
- mutex_lock(&unlikely_tracing_mutex);
- unlikely_tracer = tr;
+ mutex_lock(&branch_tracing_mutex);
+ branch_tracer = tr;
/*
* Must be seen before enabling. The reader is a condition
* where we do not need a matching rmb()
*/
smp_wmb();
- unlikely_tracing_enabled++;
- mutex_unlock(&unlikely_tracing_mutex);
+ branch_tracing_enabled++;
+ mutex_unlock(&branch_tracing_mutex);
return ret;
}
-void disable_unlikely_tracing(void)
+void disable_branch_tracing(void)
{
- mutex_lock(&unlikely_tracing_mutex);
+ mutex_lock(&branch_tracing_mutex);
- if (!unlikely_tracing_enabled)
+ if (!branch_tracing_enabled)
goto out_unlock;
- unlikely_tracing_enabled--;
+ branch_tracing_enabled--;
out_unlock:
- mutex_unlock(&unlikely_tracing_mutex);
+ mutex_unlock(&branch_tracing_mutex);
}
#else
static inline
-void trace_likely_condition(struct ftrace_likely_data *f, int val, int expect)
+void trace_likely_condition(struct ftrace_branch_data *f, int val, int expect)
{
}
#endif /* CONFIG_BRANCH_TRACER */
-void ftrace_likely_update(struct ftrace_likely_data *f, int val, int expect)
+void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect)
{
/*
* I would love to have a trace point here instead, but the
t_next(struct seq_file *m, void *v, loff_t *pos)
{
struct ftrace_pointer *f = m->private;
- struct ftrace_likely_data *p = v;
+ struct ftrace_branch_data *p = v;
(*pos)++;
static int t_show(struct seq_file *m, void *v)
{
- struct ftrace_likely_data *p = v;
+ struct ftrace_branch_data *p = v;
const char *f;
unsigned long percent;
.stop = __stop_unlikely_profile,
};
-static __init int ftrace_unlikely_init(void)
+static __init int ftrace_branch_init(void)
{
struct dentry *d_tracer;
struct dentry *entry;
return 0;
}
-device_initcall(ftrace_unlikely_init);
+device_initcall(ftrace_branch_init);