Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121115
b: refs/heads/master
c: 12ef7d4
h: refs/heads/master
i:
  121113: 17d51ce
  121111: 6fe7992
v: v3
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Nov 13, 2008
1 parent c75f7a0 commit 8b84ee2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 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: ee6bce52276c0717ed3e63296e5d9465d339e923
refs/heads/master: 12ef7d448613ead2babd41c3ebfa1fe03c20edef
16 changes: 15 additions & 1 deletion trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ static DEFINE_MUTEX(trace_types_lock);
static DECLARE_WAIT_QUEUE_HEAD(trace_wait);

/* trace_flags holds trace_options default values */
unsigned long trace_flags = TRACE_ITER_PRINT_PARENT | TRACE_ITER_PRINTK;
unsigned long trace_flags = TRACE_ITER_PRINT_PARENT | TRACE_ITER_PRINTK |
TRACE_ITER_ANNOTATE;

/**
* trace_wake_up - wake up tasks waiting for trace input
Expand Down Expand Up @@ -261,6 +262,7 @@ static const char *trace_options[] = {
#ifdef CONFIG_BRANCH_TRACER
"branch",
#endif
"annotate",
NULL
};

Expand Down Expand Up @@ -1113,6 +1115,7 @@ void tracing_stop_function_trace(void)

enum trace_file_type {
TRACE_FILE_LAT_FMT = 1,
TRACE_FILE_ANNOTATE = 2,
};

static void trace_iterator_increment(struct trace_iterator *iter, int cpu)
Expand Down Expand Up @@ -1532,6 +1535,12 @@ static void test_cpu_buff_start(struct trace_iterator *iter)
{
struct trace_seq *s = &iter->seq;

if (!(trace_flags & TRACE_ITER_ANNOTATE))
return;

if (!(iter->iter_flags & TRACE_FILE_ANNOTATE))
return;

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

Expand Down Expand Up @@ -2132,6 +2141,11 @@ __tracing_open(struct inode *inode, struct file *file, int *ret)
iter->trace = current_trace;
iter->pos = -1;

/* Annotate start of buffers if we had overruns */
if (ring_buffer_overruns(iter->tr->buffer))
iter->iter_flags |= TRACE_FILE_ANNOTATE;


for_each_tracing_cpu(cpu) {

iter->buffer_iter[cpu] =
Expand Down
1 change: 1 addition & 0 deletions trunk/kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ enum trace_iterator_flags {
#ifdef CONFIG_BRANCH_TRACER
TRACE_ITER_BRANCH = 0x1000,
#endif
TRACE_ITER_ANNOTATE = 0x2000,
};

/*
Expand Down

0 comments on commit 8b84ee2

Please sign in to comment.