Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116617
b: refs/heads/master
c: 45dcd8b
h: refs/heads/master
i:
  116615: 25ef4b4
v: v3
  • Loading branch information
Pekka Paalanen authored and Ingo Molnar committed Oct 14, 2008
1 parent dd8f61b commit aac01dd
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 54 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bbe5c7830c6dbde58726d44ec0337bc8b2d95d37
refs/heads/master: 45dcd8b8a8ca855591e3ac882d3a7fc255d09d43
46 changes: 2 additions & 44 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ trace_next_page(struct trace_array_cpu *data, void *addr)
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)
{
unsigned long idx, idx_next;
Expand Down Expand Up @@ -821,7 +821,7 @@ tracing_get_trace_entry(struct trace_array *tr, struct trace_array_cpu *data)
return entry;
}

static inline void
void
tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags)
{
struct task_struct *tsk = current;
Expand Down Expand Up @@ -865,48 +865,6 @@ ftrace(struct trace_array *tr, struct trace_array_cpu *data,
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,
struct trace_array_cpu *data,
unsigned long flags,
Expand Down
15 changes: 6 additions & 9 deletions trunk/kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,17 @@ struct trace_iterator {
long idx;
};

void trace_wake_up(void);
void tracing_reset(struct trace_array_cpu *data);
int tracing_open_generic(struct inode *inode, struct file *filp);
struct dentry *tracing_init_dentry(void);
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,
struct trace_array_cpu *data,
unsigned long ip,
Expand Down Expand Up @@ -291,15 +297,6 @@ extern unsigned long ftrace_update_tot_cnt;
extern int DYN_FTRACE_TEST_NAME(void);
#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
extern int trace_selftest_startup_function(struct tracer *trace,
Expand Down
42 changes: 42 additions & 0 deletions trunk/kernel/trace/trace_mmiotrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,55 @@ __init static int init_mmio_trace(void)
}
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)
{
struct trace_array *tr = mmio_trace_array;
struct trace_array_cpu *data = tr->data[smp_processor_id()];
__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)
{
struct trace_array *tr = mmio_trace_array;
Expand Down

0 comments on commit aac01dd

Please sign in to comment.