Skip to content

Commit

Permalink
tracing: remove extra latency_trace method from trace structure
Browse files Browse the repository at this point in the history
Impact: clean up

The trace and latency_trace function pointers are identical for
every tracer but the function tracer. The differences in the function
tracer are trivial (latency output puts paranthesis around parent).

This patch removes the latency_trace pointer and all prints will
now just use the trace output function pointer.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
  • Loading branch information
Steven Rostedt committed Mar 5, 2009
1 parent c032ef6 commit 5fd73f8
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 36 deletions.
1 change: 0 additions & 1 deletion kernel/trace/blktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,6 @@ static struct tracer blk_tracer __read_mostly = {
static struct trace_event trace_blk_event = {
.type = TRACE_BLK,
.trace = blk_trace_event_print,
.latency_trace = blk_trace_event_print,
.binary = blk_trace_event_print_binary,
};

Expand Down
2 changes: 1 addition & 1 deletion kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,7 @@ static enum print_line_t print_lat_fmt(struct trace_iterator *iter)
}

if (event)
return event->latency_trace(iter, sym_flags);
return event->trace(iter, sym_flags);

if (!trace_seq_printf(s, "Unknown type %d\n", entry->type))
goto partial;
Expand Down
1 change: 0 additions & 1 deletion kernel/trace/trace_branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ static enum print_line_t trace_branch_print(struct trace_iterator *iter,
static struct trace_event trace_branch_event = {
.type = TRACE_BRANCH,
.trace = trace_branch_print,
.latency_trace = trace_branch_print,
};

static struct tracer branch_trace __read_mostly =
Expand Down
32 changes: 0 additions & 32 deletions kernel/trace/trace_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,6 @@ int register_ftrace_event(struct trace_event *event)

if (event->trace == NULL)
event->trace = trace_nop_print;
if (event->latency_trace == NULL)
event->latency_trace = trace_nop_print;
if (event->raw == NULL)
event->raw = trace_nop_print;
if (event->hex == NULL)
Expand Down Expand Up @@ -480,29 +478,6 @@ enum print_line_t trace_nop_print(struct trace_iterator *iter, int flags)
}

/* TRACE_FN */
static enum print_line_t trace_fn_latency(struct trace_iterator *iter,
int flags)
{
struct ftrace_entry *field;
struct trace_seq *s = &iter->seq;

trace_assign_type(field, iter->ent);

if (!seq_print_ip_sym(s, field->ip, flags))
goto partial;
if (!trace_seq_puts(s, " ("))
goto partial;
if (!seq_print_ip_sym(s, field->parent_ip, flags))
goto partial;
if (!trace_seq_puts(s, ")\n"))
goto partial;

return TRACE_TYPE_HANDLED;

partial:
return TRACE_TYPE_PARTIAL_LINE;
}

static enum print_line_t trace_fn_trace(struct trace_iterator *iter, int flags)
{
struct ftrace_entry *field;
Expand Down Expand Up @@ -573,7 +548,6 @@ static enum print_line_t trace_fn_bin(struct trace_iterator *iter, int flags)
static struct trace_event trace_fn_event = {
.type = TRACE_FN,
.trace = trace_fn_trace,
.latency_trace = trace_fn_latency,
.raw = trace_fn_raw,
.hex = trace_fn_hex,
.binary = trace_fn_bin,
Expand Down Expand Up @@ -705,7 +679,6 @@ static enum print_line_t trace_ctxwake_bin(struct trace_iterator *iter,
static struct trace_event trace_ctx_event = {
.type = TRACE_CTX,
.trace = trace_ctx_print,
.latency_trace = trace_ctx_print,
.raw = trace_ctx_raw,
.hex = trace_ctx_hex,
.binary = trace_ctxwake_bin,
Expand All @@ -714,7 +687,6 @@ static struct trace_event trace_ctx_event = {
static struct trace_event trace_wake_event = {
.type = TRACE_WAKE,
.trace = trace_wake_print,
.latency_trace = trace_wake_print,
.raw = trace_wake_raw,
.hex = trace_wake_hex,
.binary = trace_ctxwake_bin,
Expand Down Expand Up @@ -770,7 +742,6 @@ static enum print_line_t trace_special_bin(struct trace_iterator *iter,
static struct trace_event trace_special_event = {
.type = TRACE_SPECIAL,
.trace = trace_special_print,
.latency_trace = trace_special_print,
.raw = trace_special_print,
.hex = trace_special_hex,
.binary = trace_special_bin,
Expand Down Expand Up @@ -808,7 +779,6 @@ static enum print_line_t trace_stack_print(struct trace_iterator *iter,
static struct trace_event trace_stack_event = {
.type = TRACE_STACK,
.trace = trace_stack_print,
.latency_trace = trace_stack_print,
.raw = trace_special_print,
.hex = trace_special_hex,
.binary = trace_special_bin,
Expand Down Expand Up @@ -838,7 +808,6 @@ static enum print_line_t trace_user_stack_print(struct trace_iterator *iter,
static struct trace_event trace_user_stack_event = {
.type = TRACE_USER_STACK,
.trace = trace_user_stack_print,
.latency_trace = trace_user_stack_print,
.raw = trace_special_print,
.hex = trace_special_hex,
.binary = trace_special_bin,
Expand Down Expand Up @@ -883,7 +852,6 @@ static enum print_line_t trace_print_raw(struct trace_iterator *iter, int flags)
static struct trace_event trace_print_event = {
.type = TRACE_PRINT,
.trace = trace_print_print,
.latency_trace = trace_print_print,
.raw = trace_print_raw,
};

Expand Down
1 change: 0 additions & 1 deletion kernel/trace/trace_output.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ struct trace_event {
struct hlist_node node;
int type;
trace_print_func trace;
trace_print_func latency_trace;
trace_print_func raw;
trace_print_func hex;
trace_print_func binary;
Expand Down

0 comments on commit 5fd73f8

Please sign in to comment.