diff options
author | Pekka Paalanen <pq@iki.fi> | 2008-09-16 14:56:41 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-14 04:37:04 -0400 |
commit | 45dcd8b8a8ca855591e3ac882d3a7fc255d09d43 (patch) | |
tree | 55b1772dfc9a6381ab1ecad7f3f6fbd605427f20 | |
parent | bbe5c7830c6dbde58726d44ec0337bc8b2d95d37 (diff) |
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: Pekka Paalanen <pq@iki.fi>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | kernel/trace/trace.c | 46 | ||||
-rw-r--r-- | kernel/trace/trace.h | 15 | ||||
-rw-r--r-- | kernel/trace/trace_mmiotrace.c | 42 |
3 files changed, 50 insertions, 53 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 7e6cb4fe62f2..d372bc535963 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -785,7 +785,7 @@ trace_next_page(struct trace_array_cpu *data, void *addr) | |||
785 | return page_address(page); | 785 | return page_address(page); |
786 | } | 786 | } |
787 | 787 | ||
788 | static inline struct trace_entry * | 788 | struct trace_entry * |
789 | tracing_get_trace_entry(struct trace_array *tr, struct trace_array_cpu *data) | 789 | tracing_get_trace_entry(struct trace_array *tr, struct trace_array_cpu *data) |
790 | { | 790 | { |
791 | unsigned long idx, idx_next; | 791 | unsigned long idx, idx_next; |
@@ -821,7 +821,7 @@ tracing_get_trace_entry(struct trace_array *tr, struct trace_array_cpu *data) | |||
821 | return entry; | 821 | return entry; |
822 | } | 822 | } |
823 | 823 | ||
824 | static inline void | 824 | void |
825 | tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags) | 825 | tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags) |
826 | { | 826 | { |
827 | struct task_struct *tsk = current; | 827 | struct task_struct *tsk = current; |
@@ -865,48 +865,6 @@ ftrace(struct trace_array *tr, struct trace_array_cpu *data, | |||
865 | trace_function(tr, data, ip, parent_ip, flags); | 865 | trace_function(tr, data, ip, parent_ip, flags); |
866 | } | 866 | } |
867 | 867 | ||
868 | #ifdef CONFIG_MMIOTRACE | ||
869 | void __trace_mmiotrace_rw(struct trace_array *tr, struct trace_array_cpu *data, | ||
870 | struct mmiotrace_rw *rw) | ||
871 | { | ||
872 | struct trace_entry *entry; | ||
873 | unsigned long irq_flags; | ||
874 | |||
875 | raw_local_irq_save(irq_flags); | ||
876 | __raw_spin_lock(&data->lock); | ||
877 | |||
878 | entry = tracing_get_trace_entry(tr, data); | ||
879 | tracing_generic_entry_update(entry, 0); | ||
880 | entry->type = TRACE_MMIO_RW; | ||
881 | entry->field.mmiorw = *rw; | ||
882 | |||
883 | __raw_spin_unlock(&data->lock); | ||
884 | raw_local_irq_restore(irq_flags); | ||
885 | |||
886 | trace_wake_up(); | ||
887 | } | ||
888 | |||
889 | void __trace_mmiotrace_map(struct trace_array *tr, struct trace_array_cpu *data, | ||
890 | struct mmiotrace_map *map) | ||
891 | { | ||
892 | struct trace_entry *entry; | ||
893 | unsigned long irq_flags; | ||
894 | |||
895 | raw_local_irq_save(irq_flags); | ||
896 | __raw_spin_lock(&data->lock); | ||
897 | |||
898 | entry = tracing_get_trace_entry(tr, data); | ||
899 | tracing_generic_entry_update(entry, 0); | ||
900 | entry->type = TRACE_MMIO_MAP; | ||
901 | entry->field.mmiomap = *map; | ||
902 | |||
903 | __raw_spin_unlock(&data->lock); | ||
904 | raw_local_irq_restore(irq_flags); | ||
905 | |||
906 | trace_wake_up(); | ||
907 | } | ||
908 | #endif | ||
909 | |||
910 | void __trace_stack(struct trace_array *tr, | 868 | void __trace_stack(struct trace_array *tr, |
911 | struct trace_array_cpu *data, | 869 | struct trace_array_cpu *data, |
912 | unsigned long flags, | 870 | unsigned long flags, |
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 77c265f6a779..9d39aa00a9c6 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -213,11 +213,17 @@ struct trace_iterator { | |||
213 | long idx; | 213 | long idx; |
214 | }; | 214 | }; |
215 | 215 | ||
216 | void trace_wake_up(void); | ||
216 | void tracing_reset(struct trace_array_cpu *data); | 217 | void tracing_reset(struct trace_array_cpu *data); |
217 | int tracing_open_generic(struct inode *inode, struct file *filp); | 218 | int tracing_open_generic(struct inode *inode, struct file *filp); |
218 | struct dentry *tracing_init_dentry(void); | 219 | struct dentry *tracing_init_dentry(void); |
219 | void init_tracer_sysprof_debugfs(struct dentry *d_tracer); | 220 | void init_tracer_sysprof_debugfs(struct dentry *d_tracer); |
220 | 221 | ||
222 | struct trace_entry *tracing_get_trace_entry(struct trace_array *tr, | ||
223 | struct trace_array_cpu *data); | ||
224 | void tracing_generic_entry_update(struct trace_entry *entry, | ||
225 | unsigned long flags); | ||
226 | |||
221 | void ftrace(struct trace_array *tr, | 227 | void ftrace(struct trace_array *tr, |
222 | struct trace_array_cpu *data, | 228 | struct trace_array_cpu *data, |
223 | unsigned long ip, | 229 | unsigned long ip, |
@@ -291,15 +297,6 @@ extern unsigned long ftrace_update_tot_cnt; | |||
291 | extern int DYN_FTRACE_TEST_NAME(void); | 297 | extern int DYN_FTRACE_TEST_NAME(void); |
292 | #endif | 298 | #endif |
293 | 299 | ||
294 | #ifdef CONFIG_MMIOTRACE | ||
295 | extern void __trace_mmiotrace_rw(struct trace_array *tr, | ||
296 | struct trace_array_cpu *data, | ||
297 | struct mmiotrace_rw *rw); | ||
298 | extern void __trace_mmiotrace_map(struct trace_array *tr, | ||
299 | struct trace_array_cpu *data, | ||
300 | struct mmiotrace_map *map); | ||
301 | #endif | ||
302 | |||
303 | #ifdef CONFIG_FTRACE_STARTUP_TEST | 300 | #ifdef CONFIG_FTRACE_STARTUP_TEST |
304 | #ifdef CONFIG_FTRACE | 301 | #ifdef CONFIG_FTRACE |
305 | extern int trace_selftest_startup_function(struct tracer *trace, | 302 | extern int trace_selftest_startup_function(struct tracer *trace, |
diff --git a/kernel/trace/trace_mmiotrace.c b/kernel/trace/trace_mmiotrace.c index 9b7a936f4b1f..ef02747b26d9 100644 --- a/kernel/trace/trace_mmiotrace.c +++ b/kernel/trace/trace_mmiotrace.c | |||
@@ -276,6 +276,27 @@ __init static int init_mmio_trace(void) | |||
276 | } | 276 | } |
277 | device_initcall(init_mmio_trace); | 277 | device_initcall(init_mmio_trace); |
278 | 278 | ||
279 | static void __trace_mmiotrace_rw(struct trace_array *tr, | ||
280 | struct trace_array_cpu *data, | ||
281 | struct mmiotrace_rw *rw) | ||
282 | { | ||
283 | struct trace_entry *entry; | ||
284 | unsigned long irq_flags; | ||
285 | |||
286 | raw_local_irq_save(irq_flags); | ||
287 | __raw_spin_lock(&data->lock); | ||
288 | |||
289 | entry = tracing_get_trace_entry(tr, data); | ||
290 | tracing_generic_entry_update(entry, 0); | ||
291 | entry->type = TRACE_MMIO_RW; | ||
292 | entry->field.mmiorw = *rw; | ||
293 | |||
294 | __raw_spin_unlock(&data->lock); | ||
295 | raw_local_irq_restore(irq_flags); | ||
296 | |||
297 | trace_wake_up(); | ||
298 | } | ||
299 | |||
279 | void mmio_trace_rw(struct mmiotrace_rw *rw) | 300 | void mmio_trace_rw(struct mmiotrace_rw *rw) |
280 | { | 301 | { |
281 | struct trace_array *tr = mmio_trace_array; | 302 | struct trace_array *tr = mmio_trace_array; |
@@ -283,6 +304,27 @@ void mmio_trace_rw(struct mmiotrace_rw *rw) | |||
283 | __trace_mmiotrace_rw(tr, data, rw); | 304 | __trace_mmiotrace_rw(tr, data, rw); |
284 | } | 305 | } |
285 | 306 | ||
307 | static void __trace_mmiotrace_map(struct trace_array *tr, | ||
308 | struct trace_array_cpu *data, | ||
309 | struct mmiotrace_map *map) | ||
310 | { | ||
311 | struct trace_entry *entry; | ||
312 | unsigned long irq_flags; | ||
313 | |||
314 | raw_local_irq_save(irq_flags); | ||
315 | __raw_spin_lock(&data->lock); | ||
316 | |||
317 | entry = tracing_get_trace_entry(tr, data); | ||
318 | tracing_generic_entry_update(entry, 0); | ||
319 | entry->type = TRACE_MMIO_MAP; | ||
320 | entry->field.mmiomap = *map; | ||
321 | |||
322 | __raw_spin_unlock(&data->lock); | ||
323 | raw_local_irq_restore(irq_flags); | ||
324 | |||
325 | trace_wake_up(); | ||
326 | } | ||
327 | |||
286 | void mmio_trace_mapping(struct mmiotrace_map *map) | 328 | void mmio_trace_mapping(struct mmiotrace_map *map) |
287 | { | 329 | { |
288 | struct trace_array *tr = mmio_trace_array; | 330 | struct trace_array *tr = mmio_trace_array; |