Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121080
b: refs/heads/master
c: a309720
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Nov 8, 2008
1 parent 4901806 commit 557e434
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 769c48eb2530c5c1a393e2c82063f4f050571d24
refs/heads/master: a309720c876d7ad2e224bfd1982c92ae4364c82e
19 changes: 19 additions & 0 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,17 @@ void trace_seq_print_cont(struct trace_seq *s, struct trace_iterator *iter)
trace_seq_putc(s, '\n');
}

static void test_cpu_buff_start(struct trace_iterator *iter)
{
struct trace_seq *s = &iter->seq;

if (cpu_isset(iter->cpu, iter->started))
return;

cpu_set(iter->cpu, iter->started);
trace_seq_printf(s, "##### CPU %u buffer started ####\n", iter->cpu);
}

static enum print_line_t
print_lat_fmt(struct trace_iterator *iter, unsigned int trace_idx, int cpu)
{
Expand All @@ -1497,6 +1508,8 @@ print_lat_fmt(struct trace_iterator *iter, unsigned int trace_idx, int cpu)
if (entry->type == TRACE_CONT)
return TRACE_TYPE_HANDLED;

test_cpu_buff_start(iter);

next_entry = find_next_entry(iter, NULL, &next_ts);
if (!next_entry)
next_ts = iter->ts;
Expand Down Expand Up @@ -1612,6 +1625,8 @@ static enum print_line_t print_trace_fmt(struct trace_iterator *iter)
if (entry->type == TRACE_CONT)
return TRACE_TYPE_HANDLED;

test_cpu_buff_start(iter);

comm = trace_find_cmdline(iter->ent->pid);

t = ns2usecs(iter->ts);
Expand Down Expand Up @@ -2631,6 +2646,10 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp)
return -ENOMEM;

mutex_lock(&trace_types_lock);

/* trace pipe does not show start of buffer */
cpus_setall(iter->started);

iter->tr = &global_trace;
iter->trace = current_trace;
filp->private_data = iter;
Expand Down
2 changes: 2 additions & 0 deletions trunk/kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ struct trace_iterator {
unsigned long iter_flags;
loff_t pos;
long idx;

cpumask_t started;
};

int tracing_is_enabled(void);
Expand Down

0 comments on commit 557e434

Please sign in to comment.