Commit 2e2ca155 authored by Steven Rostedt's avatar Steven Rostedt Committed by Ingo Molnar

ftrace: new continue entry - separate out from trace_entry

Some tracers will need to work with more than one entry. In order to do this
the trace_entry structure was split into two fields. One for the start of
all entries, and one to continue an existing entry.

The trace_entry structure now has a "field" entry that consists of the previous
content of the trace_entry, and a "cont" entry that is just a string buffer
the size of the "field" entry.

Thanks to Andrew Morton for suggesting this idea.
Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent fed1939c
This diff is collapsed.
...@@ -61,13 +61,12 @@ struct stack_entry { ...@@ -61,13 +61,12 @@ struct stack_entry {
}; };
/* /*
* The trace entry - the most basic unit of tracing. This is what * The trace field - the most basic unit of tracing. This is what
* is printed in the end as a single line in the trace output, such as: * is printed in the end as a single line in the trace output, such as:
* *
* bash-15816 [01] 235.197585: idle_cpu <- irq_enter * bash-15816 [01] 235.197585: idle_cpu <- irq_enter
*/ */
struct trace_entry { struct trace_field {
char type;
char cpu; char cpu;
char flags; char flags;
char preempt_count; char preempt_count;
...@@ -83,6 +82,18 @@ struct trace_entry { ...@@ -83,6 +82,18 @@ struct trace_entry {
}; };
}; };
struct trace_field_cont {
char buf[sizeof(struct trace_field)];
};
struct trace_entry {
char type;
union {
struct trace_field field;
struct trace_field_cont cont;
};
};
#define TRACE_ENTRY_SIZE sizeof(struct trace_entry) #define TRACE_ENTRY_SIZE sizeof(struct trace_entry)
/* /*
......
...@@ -174,14 +174,14 @@ static ssize_t mmio_read(struct trace_iterator *iter, struct file *filp, ...@@ -174,14 +174,14 @@ static ssize_t mmio_read(struct trace_iterator *iter, struct file *filp,
static int mmio_print_rw(struct trace_iterator *iter) static int mmio_print_rw(struct trace_iterator *iter)
{ {
struct trace_entry *entry = iter->ent; struct trace_entry *entry = iter->ent;
struct mmiotrace_rw *rw = &entry->mmiorw; struct mmiotrace_rw *rw = &entry->field.mmiorw;
struct trace_seq *s = &iter->seq; struct trace_seq *s = &iter->seq;
unsigned long long t = ns2usecs(entry->t); unsigned long long t = ns2usecs(entry->field.t);
unsigned long usec_rem = do_div(t, 1000000ULL); unsigned long usec_rem = do_div(t, 1000000ULL);
unsigned secs = (unsigned long)t; unsigned secs = (unsigned long)t;
int ret = 1; int ret = 1;
switch (entry->mmiorw.opcode) { switch (entry->field.mmiorw.opcode) {
case MMIO_READ: case MMIO_READ:
ret = trace_seq_printf(s, ret = trace_seq_printf(s,
"R %d %lu.%06lu %d 0x%llx 0x%lx 0x%lx %d\n", "R %d %lu.%06lu %d 0x%llx 0x%lx 0x%lx %d\n",
...@@ -216,14 +216,14 @@ static int mmio_print_rw(struct trace_iterator *iter) ...@@ -216,14 +216,14 @@ static int mmio_print_rw(struct trace_iterator *iter)
static int mmio_print_map(struct trace_iterator *iter) static int mmio_print_map(struct trace_iterator *iter)
{ {
struct trace_entry *entry = iter->ent; struct trace_entry *entry = iter->ent;
struct mmiotrace_map *m = &entry->mmiomap; struct mmiotrace_map *m = &entry->field.mmiomap;
struct trace_seq *s = &iter->seq; struct trace_seq *s = &iter->seq;
unsigned long long t = ns2usecs(entry->t); unsigned long long t = ns2usecs(entry->field.t);
unsigned long usec_rem = do_div(t, 1000000ULL); unsigned long usec_rem = do_div(t, 1000000ULL);
unsigned secs = (unsigned long)t; unsigned secs = (unsigned long)t;
int ret = 1; int ret = 1;
switch (entry->mmiorw.opcode) { switch (entry->field.mmiorw.opcode) {
case MMIO_PROBE: case MMIO_PROBE:
ret = trace_seq_printf(s, ret = trace_seq_printf(s,
"MAP %lu.%06lu %d 0x%llx 0x%lx 0x%lx 0x%lx %d\n", "MAP %lu.%06lu %d 0x%llx 0x%lx 0x%lx 0x%lx %d\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment