Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146184
b: refs/heads/master
c: 0f4fc29
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt authored and Frederic Weisbecker committed May 26, 2009
1 parent 46a0106 commit ac7a3f8
Show file tree
Hide file tree
Showing 4 changed files with 37 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: 62ba180e80f4194a498585ac0e4c07daa8ca08d1
refs/heads/master: 0f4fc29dd68dfab9c6ddd5d087d34a5b6818cb00
3 changes: 3 additions & 0 deletions trunk/include/linux/ftrace_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const char *ftrace_print_flags_seq(struct trace_seq *p, const char *delim,
unsigned long flags,
const struct trace_print_flags *flag_array);

const char *ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val,
const struct trace_print_flags *symbol_array);

/*
* The trace entry - the most basic unit of tracing. This is what
* is printed in the end as a single line in the trace output, such as:
Expand Down
8 changes: 8 additions & 0 deletions trunk/include/trace/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@
ftrace_print_flags_seq(p, delim, flag, flags); \
})

#undef __print_symbolic
#define __print_symbolic(value, symbol_array...) \
({ \
static const struct trace_print_flags symbols[] = \
{ symbol_array, { -1, NULL }}; \
ftrace_print_symbols_seq(p, value, symbols); \
})

#undef TRACE_EVENT
#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \
enum print_line_t \
Expand Down
25 changes: 25 additions & 0 deletions trunk/kernel/trace/trace_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,31 @@ ftrace_print_flags_seq(struct trace_seq *p, const char *delim,
return p->buffer;
}

const char *
ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val,
const struct trace_print_flags *symbol_array)
{
int i;

trace_seq_init(p);

for (i = 0; symbol_array[i].name; i++) {

if (val != symbol_array[i].mask)
continue;

trace_seq_puts(p, symbol_array[i].name);
break;
}

if (!p->len)
trace_seq_printf(p, "0x%lx", val);

trace_seq_putc(p, 0);

return p->buffer;
}

#ifdef CONFIG_KRETPROBES
static inline const char *kretprobed(const char *name)
{
Expand Down

0 comments on commit ac7a3f8

Please sign in to comment.