提交 45dcd8b8 编写于 作者: P Pekka Paalanen 提交者: Ingo Molnar

ftrace: move mmiotrace functions out of trace.c

Moves the mmiotrace specific functions from trace.c to
trace_mmiotrace.c. Functions trace_wake_up(), tracing_get_trace_entry(),
and tracing_generic_entry_update() are therefore made available outside
trace.c.
Signed-off-by: NPekka Paalanen <pq@iki.fi>
Acked-by: NSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 bbe5c783
...@@ -785,7 +785,7 @@ trace_next_page(struct trace_array_cpu *data, void *addr) ...@@ -785,7 +785,7 @@ trace_next_page(struct trace_array_cpu *data, void *addr)
return page_address(page); return page_address(page);
} }
static inline struct trace_entry * struct trace_entry *
tracing_get_trace_entry(struct trace_array *tr, struct trace_array_cpu *data) tracing_get_trace_entry(struct trace_array *tr, struct trace_array_cpu *data)
{ {
unsigned long idx, idx_next; unsigned long idx, idx_next;
...@@ -821,7 +821,7 @@ tracing_get_trace_entry(struct trace_array *tr, struct trace_array_cpu *data) ...@@ -821,7 +821,7 @@ tracing_get_trace_entry(struct trace_array *tr, struct trace_array_cpu *data)
return entry; return entry;
} }
static inline void void
tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags) tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags)
{ {
struct task_struct *tsk = current; struct task_struct *tsk = current;
...@@ -865,48 +865,6 @@ ftrace(struct trace_array *tr, struct trace_array_cpu *data, ...@@ -865,48 +865,6 @@ ftrace(struct trace_array *tr, struct trace_array_cpu *data,
trace_function(tr, data, ip, parent_ip, flags); trace_function(tr, data, ip, parent_ip, flags);
} }
#ifdef CONFIG_MMIOTRACE
void __trace_mmiotrace_rw(struct trace_array *tr, struct trace_array_cpu *data,
struct mmiotrace_rw *rw)
{
struct trace_entry *entry;
unsigned long irq_flags;
raw_local_irq_save(irq_flags);
__raw_spin_lock(&data->lock);
entry = tracing_get_trace_entry(tr, data);
tracing_generic_entry_update(entry, 0);
entry->type = TRACE_MMIO_RW;
entry->field.mmiorw = *rw;
__raw_spin_unlock(&data->lock);
raw_local_irq_restore(irq_flags);
trace_wake_up();
}
void __trace_mmiotrace_map(struct trace_array *tr, struct trace_array_cpu *data,
struct mmiotrace_map *map)
{
struct trace_entry *entry;
unsigned long irq_flags;
raw_local_irq_save(irq_flags);
__raw_spin_lock(&data->lock);
entry = tracing_get_trace_entry(tr, data);
tracing_generic_entry_update(entry, 0);
entry->type = TRACE_MMIO_MAP;
entry->field.mmiomap = *map;
__raw_spin_unlock(&data->lock);
raw_local_irq_restore(irq_flags);
trace_wake_up();
}
#endif
void __trace_stack(struct trace_array *tr, void __trace_stack(struct trace_array *tr,
struct trace_array_cpu *data, struct trace_array_cpu *data,
unsigned long flags, unsigned long flags,
......
...@@ -213,11 +213,17 @@ struct trace_iterator { ...@@ -213,11 +213,17 @@ struct trace_iterator {
long idx; long idx;
}; };
void trace_wake_up(void);
void tracing_reset(struct trace_array_cpu *data); void tracing_reset(struct trace_array_cpu *data);
int tracing_open_generic(struct inode *inode, struct file *filp); int tracing_open_generic(struct inode *inode, struct file *filp);
struct dentry *tracing_init_dentry(void); struct dentry *tracing_init_dentry(void);
void init_tracer_sysprof_debugfs(struct dentry *d_tracer); void init_tracer_sysprof_debugfs(struct dentry *d_tracer);
struct trace_entry *tracing_get_trace_entry(struct trace_array *tr,
struct trace_array_cpu *data);
void tracing_generic_entry_update(struct trace_entry *entry,
unsigned long flags);
void ftrace(struct trace_array *tr, void ftrace(struct trace_array *tr,
struct trace_array_cpu *data, struct trace_array_cpu *data,
unsigned long ip, unsigned long ip,
...@@ -291,15 +297,6 @@ extern unsigned long ftrace_update_tot_cnt; ...@@ -291,15 +297,6 @@ extern unsigned long ftrace_update_tot_cnt;
extern int DYN_FTRACE_TEST_NAME(void); extern int DYN_FTRACE_TEST_NAME(void);
#endif #endif
#ifdef CONFIG_MMIOTRACE
extern void __trace_mmiotrace_rw(struct trace_array *tr,
struct trace_array_cpu *data,
struct mmiotrace_rw *rw);
extern void __trace_mmiotrace_map(struct trace_array *tr,
struct trace_array_cpu *data,
struct mmiotrace_map *map);
#endif
#ifdef CONFIG_FTRACE_STARTUP_TEST #ifdef CONFIG_FTRACE_STARTUP_TEST
#ifdef CONFIG_FTRACE #ifdef CONFIG_FTRACE
extern int trace_selftest_startup_function(struct tracer *trace, extern int trace_selftest_startup_function(struct tracer *trace,
......
...@@ -276,6 +276,27 @@ __init static int init_mmio_trace(void) ...@@ -276,6 +276,27 @@ __init static int init_mmio_trace(void)
} }
device_initcall(init_mmio_trace); device_initcall(init_mmio_trace);
static void __trace_mmiotrace_rw(struct trace_array *tr,
struct trace_array_cpu *data,
struct mmiotrace_rw *rw)
{
struct trace_entry *entry;
unsigned long irq_flags;
raw_local_irq_save(irq_flags);
__raw_spin_lock(&data->lock);
entry = tracing_get_trace_entry(tr, data);
tracing_generic_entry_update(entry, 0);
entry->type = TRACE_MMIO_RW;
entry->field.mmiorw = *rw;
__raw_spin_unlock(&data->lock);
raw_local_irq_restore(irq_flags);
trace_wake_up();
}
void mmio_trace_rw(struct mmiotrace_rw *rw) void mmio_trace_rw(struct mmiotrace_rw *rw)
{ {
struct trace_array *tr = mmio_trace_array; struct trace_array *tr = mmio_trace_array;
...@@ -283,6 +304,27 @@ void mmio_trace_rw(struct mmiotrace_rw *rw) ...@@ -283,6 +304,27 @@ void mmio_trace_rw(struct mmiotrace_rw *rw)
__trace_mmiotrace_rw(tr, data, rw); __trace_mmiotrace_rw(tr, data, rw);
} }
static void __trace_mmiotrace_map(struct trace_array *tr,
struct trace_array_cpu *data,
struct mmiotrace_map *map)
{
struct trace_entry *entry;
unsigned long irq_flags;
raw_local_irq_save(irq_flags);
__raw_spin_lock(&data->lock);
entry = tracing_get_trace_entry(tr, data);
tracing_generic_entry_update(entry, 0);
entry->type = TRACE_MMIO_MAP;
entry->field.mmiomap = *map;
__raw_spin_unlock(&data->lock);
raw_local_irq_restore(irq_flags);
trace_wake_up();
}
void mmio_trace_mapping(struct mmiotrace_map *map) void mmio_trace_mapping(struct mmiotrace_map *map)
{ {
struct trace_array *tr = mmio_trace_array; struct trace_array *tr = mmio_trace_array;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册