From cc6310cf5fa70526c9e7bc5a74b7dacae9fa3134 Mon Sep 17 00:00:00 2001 From: Jon Medhurst Date: Thu, 23 May 2013 18:46:16 +0100 Subject: Revert Android trace changes This is a quick fix for the Linaro 13.05 release done to stop the manifestation of bug http://cards.linaro.org/browse/ARM-28 This patch reverts the Android patches titled: trace/events: add gpu trace events trace: Add an option to show tgids in trace output trace: add non-hierarchical function_graph option A proper fix will be done over the next release cycle after we've had time to investigate further. Signed-off-by: Jon Medhurst --- Documentation/trace/ftrace.txt | 29 ------ include/trace/events/gpu.h | 143 --------------------------- kernel/trace/Kconfig | 3 - kernel/trace/Makefile | 1 - kernel/trace/gpu-traces.c | 23 ----- kernel/trace/trace.c | 110 +-------------------- kernel/trace/trace.h | 2 - kernel/trace/trace_functions_graph.c | 43 ++++++--- kernel/trace/trace_output.c | 182 +---------------------------------- 9 files changed, 38 insertions(+), 498 deletions(-) delete mode 100644 include/trace/events/gpu.h delete mode 100644 kernel/trace/gpu-traces.c diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt index 29064c3bfcd1..bfe8c29b1f1d 100644 --- a/Documentation/trace/ftrace.txt +++ b/Documentation/trace/ftrace.txt @@ -2013,35 +2013,6 @@ will produce: 1) 1.449 us | } -You can disable the hierarchical function call formatting and instead print a -flat list of function entry and return events. This uses the format described -in the Output Formatting section and respects all the trace options that -control that formatting. Hierarchical formatting is the default. - - hierachical: echo nofuncgraph-flat > trace_options - flat: echo funcgraph-flat > trace_options - - ie: - - # tracer: function_graph - # - # entries-in-buffer/entries-written: 68355/68355 #P:2 - # - # _-----=> irqs-off - # / _----=> need-resched - # | / _---=> hardirq/softirq - # || / _--=> preempt-depth - # ||| / delay - # TASK-PID CPU# |||| TIMESTAMP FUNCTION - # | | | |||| | | - sh-1806 [001] d... 198.843443: graph_ent: func=_raw_spin_lock - sh-1806 [001] d... 198.843445: graph_ent: func=__raw_spin_lock - sh-1806 [001] d..1 198.843447: graph_ret: func=__raw_spin_lock - sh-1806 [001] d..1 198.843449: graph_ret: func=_raw_spin_lock - sh-1806 [001] d..1 198.843451: graph_ent: func=_raw_spin_unlock_irqrestore - sh-1806 [001] d... 198.843453: graph_ret: func=_raw_spin_unlock_irqrestore - - You might find other useful features for this tracer in the following "dynamic ftrace" section such as tracing only specific functions or tasks. diff --git a/include/trace/events/gpu.h b/include/trace/events/gpu.h deleted file mode 100644 index 7e15cdfafe5a..000000000000 --- a/include/trace/events/gpu.h +++ /dev/null @@ -1,143 +0,0 @@ -#undef TRACE_SYSTEM -#define TRACE_SYSTEM gpu - -#if !defined(_TRACE_GPU_H) || defined(TRACE_HEADER_MULTI_READ) -#define _TRACE_GPU_H - -#include -#include - -#define show_secs_from_ns(ns) \ - ({ \ - u64 t = ns + (NSEC_PER_USEC / 2); \ - do_div(t, NSEC_PER_SEC); \ - t; \ - }) - -#define show_usecs_from_ns(ns) \ - ({ \ - u64 t = ns + (NSEC_PER_USEC / 2) ; \ - u32 rem; \ - do_div(t, NSEC_PER_USEC); \ - rem = do_div(t, USEC_PER_SEC); \ - }) - -/* - * The gpu_sched_switch event indicates that a switch from one GPU context to - * another occurred on one of the GPU hardware blocks. - * - * The gpu_name argument identifies the GPU hardware block. Each independently - * scheduled GPU hardware block should have a different name. This may be used - * in different ways for different GPUs. For example, if a GPU includes - * multiple processing cores it may use names "GPU 0", "GPU 1", etc. If a GPU - * includes a separately scheduled 2D and 3D hardware block, it might use the - * names "2D" and "3D". - * - * The timestamp argument is the timestamp at which the switch occurred on the - * GPU. These timestamps are in units of nanoseconds and must use - * approximately the same time as sched_clock, though they need not come from - * any CPU clock. The timestamps for a single hardware block must be - * monotonically nondecreasing. This means that if a variable compensation - * offset is used to translate from some other clock to the sched_clock, then - * care must be taken when increasing that offset, and doing so may result in - * multiple events with the same timestamp. - * - * The next_ctx_id argument identifies the next context that was running on - * the GPU hardware block. A value of 0 indicates that the hardware block - * will be idle. - * - * The next_prio argument indicates the priority of the next context at the - * time of the event. The exact numeric values may mean different things for - * different GPUs, but they should follow the rule that lower values indicate a - * higher priority. - * - * The next_job_id argument identifies the batch of work that the GPU will be - * working on. This should correspond to a job_id that was previously traced - * as a gpu_job_enqueue event when the batch of work was created. - */ -TRACE_EVENT(gpu_sched_switch, - - TP_PROTO(const char *gpu_name, u64 timestamp, - u32 next_ctx_id, s32 next_prio, u32 next_job_id), - - TP_ARGS(gpu_name, timestamp, next_ctx_id, next_prio, next_job_id), - - TP_STRUCT__entry( - __string( gpu_name, gpu_name ) - __field( u64, timestamp ) - __field( u32, next_ctx_id ) - __field( s32, next_prio ) - __field( u32, next_job_id ) - ), - - TP_fast_assign( - __assign_str(gpu_name, gpu_name); - __entry->timestamp = timestamp; - __entry->next_ctx_id = next_ctx_id; - __entry->next_prio = next_prio; - __entry->next_job_id = next_job_id; - ), - - TP_printk("gpu_name=%s ts=%llu.%06lu next_ctx_id=%lu next_prio=%ld " - "next_job_id=%lu", - __get_str(gpu_name), - (unsigned long long)show_secs_from_ns(__entry->timestamp), - (unsigned long)show_usecs_from_ns(__entry->timestamp), - (unsigned long)__entry->next_ctx_id, - (long)__entry->next_prio, - (unsigned long)__entry->next_job_id) -); - -/* - * The gpu_job_enqueue event indicates that a batch of work has been queued up - * to be processed by the GPU. This event is not intended to indicate that - * the batch of work has been submitted to the GPU hardware, but rather that - * it has been submitted to the GPU kernel driver. - * - * This event should be traced on the thread that initiated the work being - * queued. For example, if a batch of work is submitted to the kernel by a - * userland thread, the event should be traced on that thread. - * - * The ctx_id field identifies the GPU context in which the batch of work - * being queued is to be run. - * - * The job_id field identifies the batch of work being queued within the given - * GPU context. The first batch of work submitted for a given GPU context - * should have a job_id of 0, and each subsequent batch of work should - * increment the job_id by 1. - * - * The type field identifies the type of the job being enqueued. The job - * types may be different for different GPU hardware. For example, a GPU may - * differentiate between "2D", "3D", and "compute" jobs. - */ -TRACE_EVENT(gpu_job_enqueue, - - TP_PROTO(u32 ctx_id, u32 job_id, const char *type), - - TP_ARGS(ctx_id, job_id, type), - - TP_STRUCT__entry( - __field( u32, ctx_id ) - __field( u32, job_id ) - __string( type, type ) - ), - - TP_fast_assign( - __entry->ctx_id = ctx_id; - __entry->job_id = job_id; - __assign_str(type, type); - ), - - TP_printk("ctx_id=%lu job_id=%lu type=%s", - (unsigned long)__entry->ctx_id, - (unsigned long)__entry->job_id, - __get_str(type)) -); - -#undef show_secs_from_ns -#undef show_usecs_from_ns - -#endif /* _TRACE_GPU_H */ - -/* This part must be outside protection */ -#include diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index e24c188cbbcc..015f85aaca08 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -82,9 +82,6 @@ config EVENT_TRACING select CONTEXT_SWITCH_TRACER bool -config GPU_TRACEPOINTS - bool - config CONTEXT_SWITCH_TRACER bool diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile index 45012122fbb6..d7e2068e4b71 100644 --- a/kernel/trace/Makefile +++ b/kernel/trace/Makefile @@ -60,6 +60,5 @@ obj-$(CONFIG_KGDB_KDB) += trace_kdb.o endif obj-$(CONFIG_PROBE_EVENTS) += trace_probe.o obj-$(CONFIG_UPROBE_EVENT) += trace_uprobe.o -obj-$(CONFIG_GPU_TRACEPOINTS) += gpu-traces.o libftrace-y := ftrace.o diff --git a/kernel/trace/gpu-traces.c b/kernel/trace/gpu-traces.c deleted file mode 100644 index a4b3f00faee3..000000000000 --- a/kernel/trace/gpu-traces.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * GPU tracepoints - * - * Copyright (C) 2013 Google, Inc. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#include - -#define CREATE_TRACE_POINTS -#include - -EXPORT_TRACEPOINT_SYMBOL(gpu_sched_switch); -EXPORT_TRACEPOINT_SYMBOL(gpu_job_enqueue); diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index e4cc806586a4..ae6fa2d1cdf7 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -635,7 +635,6 @@ static const char *trace_options[] = { "disable_on_free", "irq-info", "markers", - "print-tgid", "function-trace", NULL }; @@ -1146,7 +1145,6 @@ void tracing_reset_all_online_cpus(void) static unsigned map_pid_to_cmdline[PID_MAX_DEFAULT+1]; static unsigned map_cmdline_to_pid[SAVED_CMDLINES]; static char saved_cmdlines[SAVED_CMDLINES][TASK_COMM_LEN]; -static unsigned saved_tgids[SAVED_CMDLINES]; static int cmdline_idx; static arch_spinlock_t trace_cmdline_lock = __ARCH_SPIN_LOCK_UNLOCKED; @@ -1350,7 +1348,6 @@ static void trace_save_cmdline(struct task_struct *tsk) } memcpy(&saved_cmdlines[idx], tsk->comm, TASK_COMM_LEN); - saved_tgids[idx] = tsk->tgid; arch_spin_unlock(&trace_cmdline_lock); } @@ -1386,25 +1383,6 @@ void trace_find_cmdline(int pid, char comm[]) preempt_enable(); } -int trace_find_tgid(int pid) -{ - unsigned map; - int tgid; - - preempt_disable(); - arch_spin_lock(&trace_cmdline_lock); - map = map_pid_to_cmdline[pid]; - if (map != NO_CMDLINE_MAP) - tgid = saved_tgids[map]; - else - tgid = -1; - - arch_spin_unlock(&trace_cmdline_lock); - preempt_enable(); - - return tgid; -} - void tracing_record_cmdline(struct task_struct *tsk) { if (atomic_read(&trace_record_cmdline_disabled) || !tracing_is_on()) @@ -2361,13 +2339,6 @@ static void print_func_help_header(struct trace_buffer *buf, struct seq_file *m) seq_puts(m, "# | | | | |\n"); } -static void print_func_help_header_tgid(struct trace_array *tr, struct seq_file *m) -{ - print_event_info(tr, m); - seq_puts(m, "# TASK-PID TGID CPU# TIMESTAMP FUNCTION\n"); - seq_puts(m, "# | | | | | |\n"); -} - static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file *m) { print_event_info(buf, m); @@ -2380,18 +2351,6 @@ static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file seq_puts(m, "# | | | |||| | |\n"); } -static void print_func_help_header_irq_tgid(struct trace_array *tr, struct seq_file *m) -{ - print_event_info(tr, m); - seq_puts(m, "# _-----=> irqs-off\n"); - seq_puts(m, "# / _----=> need-resched\n"); - seq_puts(m, "# | / _---=> hardirq/softirq\n"); - seq_puts(m, "# || / _--=> preempt-depth\n"); - seq_puts(m, "# ||| / delay\n"); - seq_puts(m, "# TASK-PID TGID CPU# |||| TIMESTAMP FUNCTION\n"); - seq_puts(m, "# | | | | |||| | |\n"); -} - void print_trace_header(struct seq_file *m, struct trace_iterator *iter) { @@ -2692,15 +2651,9 @@ void trace_default_header(struct seq_file *m) } else { if (!(trace_flags & TRACE_ITER_VERBOSE)) { if (trace_flags & TRACE_ITER_IRQ_INFO) - if (trace_flags & TRACE_ITER_TGID) - print_func_help_header_irq_tgid(iter->tr, m); - else - print_func_help_header_irq(iter->tr, m); + print_func_help_header_irq(iter->trace_buffer, m); else - if (trace_flags & TRACE_ITER_TGID) - print_func_help_header_tgid(iter->tr, m); - else - print_func_help_header(iter->tr, m); + print_func_help_header(iter->trace_buffer, m); } } } @@ -3490,53 +3443,9 @@ tracing_saved_cmdlines_read(struct file *file, char __user *ubuf, } static const struct file_operations tracing_saved_cmdlines_fops = { - .open = tracing_open_generic, - .read = tracing_saved_cmdlines_read, - .llseek = generic_file_llseek, -}; - -static ssize_t -tracing_saved_tgids_read(struct file *file, char __user *ubuf, - size_t cnt, loff_t *ppos) -{ - char *file_buf; - char *buf; - int len = 0; - int pid; - int i; - - file_buf = kmalloc(SAVED_CMDLINES*(16+1+16), GFP_KERNEL); - if (!file_buf) - return -ENOMEM; - - buf = file_buf; - - for (i = 0; i < SAVED_CMDLINES; i++) { - int tgid; - int r; - - pid = map_cmdline_to_pid[i]; - if (pid == -1 || pid == NO_CMDLINE_MAP) - continue; - - tgid = trace_find_tgid(pid); - r = sprintf(buf, "%d %d\n", pid, tgid); - buf += r; - len += r; - } - - len = simple_read_from_buffer(ubuf, cnt, ppos, - file_buf, len); - - kfree(file_buf); - - return len; -} - -static const struct file_operations tracing_saved_tgids_fops = { - .open = tracing_open_generic, - .read = tracing_saved_tgids_read, - .llseek = generic_file_llseek, + .open = tracing_open_generic, + .read = tracing_saved_cmdlines_read, + .llseek = generic_file_llseek, }; static ssize_t @@ -6075,15 +5984,6 @@ static __init int tracer_init_debugfs(void) trace_create_file("saved_cmdlines", 0444, d_tracer, NULL, &tracing_saved_cmdlines_fops); - trace_create_file("saved_tgids", 0444, d_tracer, - NULL, &tracing_saved_tgids_fops); - - trace_create_file("trace_clock", 0644, d_tracer, NULL, - &trace_clock_fops); - - trace_create_file("tracing_on", 0644, d_tracer, - &global_trace, &rb_simple_fops); - #ifdef CONFIG_DYNAMIC_FTRACE trace_create_file("dyn_ftrace_total_info", 0444, d_tracer, &ftrace_update_tot_cnt, &tracing_dyn_info_fops); diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 45ac712d7b50..711ca7d3e7f1 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -648,7 +648,6 @@ static inline void __trace_stack(struct trace_array *tr, unsigned long flags, extern cycle_t ftrace_now(int cpu); extern void trace_find_cmdline(int pid, char comm[]); -extern int trace_find_tgid(int pid); #ifdef CONFIG_DYNAMIC_FTRACE extern unsigned long ftrace_update_tot_cnt; @@ -863,7 +862,6 @@ enum trace_iterator_flags { TRACE_ITER_STOP_ON_FREE = 0x400000, TRACE_ITER_IRQ_INFO = 0x800000, TRACE_ITER_MARKERS = 0x1000000, - TRACE_ITER_TGID = 0x2000000, TRACE_ITER_FUNCTION = 0x2000000, }; diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index 28dd40c2c423..8388bc99f2ee 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c @@ -46,8 +46,6 @@ struct fgraph_data { #define TRACE_GRAPH_PRINT_DURATION 0x10 #define TRACE_GRAPH_PRINT_ABS_TIME 0x20 #define TRACE_GRAPH_PRINT_IRQS 0x40 -#define TRACE_GRAPH_PRINT_FLAT 0x80 - static unsigned int max_depth; @@ -66,8 +64,6 @@ static struct tracer_opt trace_opts[] = { { TRACER_OPT(funcgraph-abstime, TRACE_GRAPH_PRINT_ABS_TIME) }, /* Display interrupts */ { TRACER_OPT(funcgraph-irqs, TRACE_GRAPH_PRINT_IRQS) }, - /* Use standard trace formatting rather than hierarchical */ - { TRACER_OPT(funcgraph-flat, TRACE_GRAPH_PRINT_FLAT) }, { } /* Empty entry */ }; @@ -1238,9 +1234,6 @@ print_graph_function_flags(struct trace_iterator *iter, u32 flags) int cpu = iter->cpu; int ret; - if (flags & TRACE_GRAPH_PRINT_FLAT) - return TRACE_TYPE_UNHANDLED; - if (data && per_cpu_ptr(data->cpu_data, cpu)->ignore) { per_cpu_ptr(data->cpu_data, cpu)->ignore = 0; return TRACE_TYPE_HANDLED; @@ -1298,6 +1291,13 @@ print_graph_function(struct trace_iterator *iter) return print_graph_function_flags(iter, tracer_flags.val); } +static enum print_line_t +print_graph_function_event(struct trace_iterator *iter, int flags, + struct trace_event *event) +{ + return print_graph_function(iter); +} + static void print_lat_header(struct seq_file *s, u32 flags) { static const char spaces[] = " " /* 16 spaces */ @@ -1364,11 +1364,6 @@ void print_graph_headers_flags(struct seq_file *s, u32 flags) { struct trace_iterator *iter = s->private; - if (flags & TRACE_GRAPH_PRINT_FLAT) { - trace_default_header(s); - return; - } - if (!(trace_flags & TRACE_ITER_CONTEXT_INFO)) return; @@ -1439,6 +1434,20 @@ static int func_graph_set_flag(u32 old_flags, u32 bit, int set) return 0; } +static struct trace_event_functions graph_functions = { + .trace = print_graph_function_event, +}; + +static struct trace_event graph_trace_entry_event = { + .type = TRACE_GRAPH_ENT, + .funcs = &graph_functions, +}; + +static struct trace_event graph_trace_ret_event = { + .type = TRACE_GRAPH_RET, + .funcs = &graph_functions +}; + static struct tracer graph_trace __read_mostly = { .name = "function_graph", .open = graph_trace_open, @@ -1514,6 +1523,16 @@ static __init int init_graph_trace(void) { max_bytes_for_cpu = snprintf(NULL, 0, "%d", nr_cpu_ids - 1); + if (!register_ftrace_event(&graph_trace_entry_event)) { + pr_warning("Warning: could not register graph trace events\n"); + return 1; + } + + if (!register_ftrace_event(&graph_trace_ret_event)) { + pr_warning("Warning: could not register graph trace events\n"); + return 1; + } + return register_tracer(&graph_trace); } diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index a68e5e34c00b..bb922d9ee51b 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c @@ -702,25 +702,11 @@ int trace_print_context(struct trace_iterator *iter) unsigned long secs, usec_rem; char comm[TASK_COMM_LEN]; int ret; - int tgid; trace_find_cmdline(entry->pid, comm); - ret = trace_seq_printf(s, "%16s-%-5d ", comm, entry->pid); - if (!ret) - return 0; - - if (trace_flags & TRACE_ITER_TGID) { - tgid = trace_find_tgid(entry->pid); - if (tgid < 0) - ret = trace_seq_puts(s, "(-----) "); - else - ret = trace_seq_printf(s, "(%5d) ", tgid); - if (!ret) - return 0; - } - - ret = trace_seq_printf(s, "[%03d] ", iter->cpu); + ret = trace_seq_printf(s, "%16s-%-5d [%03d] ", + comm, entry->pid, iter->cpu); if (!ret) return 0; @@ -1049,168 +1035,6 @@ static struct trace_event trace_fn_event = { .funcs = &trace_fn_funcs, }; -/* TRACE_GRAPH_ENT */ -static enum print_line_t trace_graph_ent_trace(struct trace_iterator *iter, int flags, - struct trace_event *event) -{ - struct trace_seq *s = &iter->seq; - struct ftrace_graph_ent_entry *field; - - trace_assign_type(field, iter->ent); - - if (!trace_seq_puts(s, "graph_ent: func=")) - return TRACE_TYPE_PARTIAL_LINE; - - if (!seq_print_ip_sym(s, field->graph_ent.func, flags)) - return TRACE_TYPE_PARTIAL_LINE; - - if (!trace_seq_puts(s, "\n")) - return TRACE_TYPE_PARTIAL_LINE; - - return TRACE_TYPE_HANDLED; -} - -static enum print_line_t trace_graph_ent_raw(struct trace_iterator *iter, int flags, - struct trace_event *event) -{ - struct ftrace_graph_ent_entry *field; - - trace_assign_type(field, iter->ent); - - if (!trace_seq_printf(&iter->seq, "%lx %d\n", - field->graph_ent.func, - field->graph_ent.depth)) - return TRACE_TYPE_PARTIAL_LINE; - - return TRACE_TYPE_HANDLED; -} - -static enum print_line_t trace_graph_ent_hex(struct trace_iterator *iter, int flags, - struct trace_event *event) -{ - struct ftrace_graph_ent_entry *field; - struct trace_seq *s = &iter->seq; - - trace_assign_type(field, iter->ent); - - SEQ_PUT_HEX_FIELD_RET(s, field->graph_ent.func); - SEQ_PUT_HEX_FIELD_RET(s, field->graph_ent.depth); - - return TRACE_TYPE_HANDLED; -} - -static enum print_line_t trace_graph_ent_bin(struct trace_iterator *iter, int flags, - struct trace_event *event) -{ - struct ftrace_graph_ent_entry *field; - struct trace_seq *s = &iter->seq; - - trace_assign_type(field, iter->ent); - - SEQ_PUT_FIELD_RET(s, field->graph_ent.func); - SEQ_PUT_FIELD_RET(s, field->graph_ent.depth); - - return TRACE_TYPE_HANDLED; -} - -static struct trace_event_functions trace_graph_ent_funcs = { - .trace = trace_graph_ent_trace, - .raw = trace_graph_ent_raw, - .hex = trace_graph_ent_hex, - .binary = trace_graph_ent_bin, -}; - -static struct trace_event trace_graph_ent_event = { - .type = TRACE_GRAPH_ENT, - .funcs = &trace_graph_ent_funcs, -}; - -/* TRACE_GRAPH_RET */ -static enum print_line_t trace_graph_ret_trace(struct trace_iterator *iter, int flags, - struct trace_event *event) -{ - struct trace_seq *s = &iter->seq; - struct trace_entry *entry = iter->ent; - struct ftrace_graph_ret_entry *field; - - trace_assign_type(field, entry); - - if (!trace_seq_puts(s, "graph_ret: func=")) - return TRACE_TYPE_PARTIAL_LINE; - - if (!seq_print_ip_sym(s, field->ret.func, flags)) - return TRACE_TYPE_PARTIAL_LINE; - - if (!trace_seq_puts(s, "\n")) - return TRACE_TYPE_PARTIAL_LINE; - - return TRACE_TYPE_HANDLED; -} - -static enum print_line_t trace_graph_ret_raw(struct trace_iterator *iter, int flags, - struct trace_event *event) -{ - struct ftrace_graph_ret_entry *field; - - trace_assign_type(field, iter->ent); - - if (!trace_seq_printf(&iter->seq, "%lx %lld %lld %ld %d\n", - field->ret.func, - field->ret.calltime, - field->ret.rettime, - field->ret.overrun, - field->ret.depth)); - return TRACE_TYPE_PARTIAL_LINE; - - return TRACE_TYPE_HANDLED; -} - -static enum print_line_t trace_graph_ret_hex(struct trace_iterator *iter, int flags, - struct trace_event *event) -{ - struct ftrace_graph_ret_entry *field; - struct trace_seq *s = &iter->seq; - - trace_assign_type(field, iter->ent); - - SEQ_PUT_HEX_FIELD_RET(s, field->ret.func); - SEQ_PUT_HEX_FIELD_RET(s, field->ret.calltime); - SEQ_PUT_HEX_FIELD_RET(s, field->ret.rettime); - SEQ_PUT_HEX_FIELD_RET(s, field->ret.overrun); - SEQ_PUT_HEX_FIELD_RET(s, field->ret.depth); - - return TRACE_TYPE_HANDLED; -} - -static enum print_line_t trace_graph_ret_bin(struct trace_iterator *iter, int flags, - struct trace_event *event) -{ - struct ftrace_graph_ret_entry *field; - struct trace_seq *s = &iter->seq; - - trace_assign_type(field, iter->ent); - - SEQ_PUT_FIELD_RET(s, field->ret.func); - SEQ_PUT_FIELD_RET(s, field->ret.calltime); - SEQ_PUT_FIELD_RET(s, field->ret.rettime); - SEQ_PUT_FIELD_RET(s, field->ret.overrun); - SEQ_PUT_FIELD_RET(s, field->ret.depth); - - return TRACE_TYPE_HANDLED; -} - -static struct trace_event_functions trace_graph_ret_funcs = { - .trace = trace_graph_ret_trace, - .raw = trace_graph_ret_raw, - .hex = trace_graph_ret_hex, - .binary = trace_graph_ret_bin, -}; - -static struct trace_event trace_graph_ret_event = { - .type = TRACE_GRAPH_RET, - .funcs = &trace_graph_ret_funcs, -}; - /* TRACE_CTX an TRACE_WAKE */ static enum print_line_t trace_ctxwake_print(struct trace_iterator *iter, char *delim) @@ -1601,8 +1425,6 @@ static struct trace_event trace_print_event = { static struct trace_event *events[] __initdata = { &trace_fn_event, - &trace_graph_ent_event, - &trace_graph_ret_event, &trace_ctx_event, &trace_wake_event, &trace_stack_event, -- cgit v1.2.3