Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364918
b: refs/heads/master
c: f71130d
h: refs/heads/master
v: v3
  • Loading branch information
Li Zefan authored and Steven Rostedt committed Mar 15, 2013
1 parent af94793 commit 9d4fb47
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 20 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: 15693458c4bc0693fd63a50d60f35b628fcf4e29
refs/heads/master: f71130de5c7fba92faf3901784714e37a234c08f
8 changes: 6 additions & 2 deletions trunk/include/linux/ftrace_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ const char *ftrace_print_symbols_seq_u64(struct trace_seq *p,
const char *ftrace_print_hex_seq(struct trace_seq *p,
const unsigned char *buf, int len);

struct trace_iterator;
struct trace_event;

int ftrace_raw_output_prep(struct trace_iterator *iter,
struct trace_event *event);

/*
* 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 Expand Up @@ -95,8 +101,6 @@ enum trace_iter_flags {
};


struct trace_event;

typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter,
int flags, struct trace_event *event);

Expand Down
23 changes: 6 additions & 17 deletions trunk/include/trace/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,29 +227,18 @@ static notrace enum print_line_t \
ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \
struct trace_event *trace_event) \
{ \
struct ftrace_event_call *event; \
struct trace_seq *s = &iter->seq; \
struct trace_seq __maybe_unused *p = &iter->tmp_seq; \
struct ftrace_raw_##call *field; \
struct trace_entry *entry; \
struct trace_seq *p = &iter->tmp_seq; \
int ret; \
\
event = container_of(trace_event, struct ftrace_event_call, \
event); \
\
entry = iter->ent; \
field = (typeof(field))iter->ent; \
\
if (entry->type != event->event.type) { \
WARN_ON_ONCE(1); \
return TRACE_TYPE_UNHANDLED; \
} \
\
field = (typeof(field))entry; \
\
trace_seq_init(p); \
ret = trace_seq_printf(s, "%s: ", event->name); \
ret = ftrace_raw_output_prep(iter, trace_event); \
if (ret) \
ret = trace_seq_printf(s, print); \
return ret; \
\
ret = trace_seq_printf(s, print); \
if (!ret) \
return TRACE_TYPE_PARTIAL_LINE; \
\
Expand Down
26 changes: 26 additions & 0 deletions trunk/kernel/trace/trace_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,32 @@ ftrace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len)
}
EXPORT_SYMBOL(ftrace_print_hex_seq);

int ftrace_raw_output_prep(struct trace_iterator *iter,
struct trace_event *trace_event)
{
struct ftrace_event_call *event;
struct trace_seq *s = &iter->seq;
struct trace_seq *p = &iter->tmp_seq;
struct trace_entry *entry;
int ret;

event = container_of(trace_event, struct ftrace_event_call, event);
entry = iter->ent;

if (entry->type != event->event.type) {
WARN_ON_ONCE(1);
return TRACE_TYPE_UNHANDLED;
}

trace_seq_init(p);
ret = trace_seq_printf(s, "%s: ", event->name);
if (!ret)
return TRACE_TYPE_PARTIAL_LINE;

return 0;
}
EXPORT_SYMBOL(ftrace_raw_output_prep);

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

0 comments on commit 9d4fb47

Please sign in to comment.