aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/trace/trace.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 61d2f0228866..c736dd2e068d 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -995,6 +995,7 @@ print_trace_fmt(struct seq_file *m, struct trace_iterator *iter)
995 seq_printf(m, " <-"); 995 seq_printf(m, " <-");
996 seq_print_ip_sym(m, entry->fn.parent_ip, sym_flags); 996 seq_print_ip_sym(m, entry->fn.parent_ip, sym_flags);
997 } 997 }
998 seq_printf(m, "\n");
998 break; 999 break;
999 case TRACE_CTX: 1000 case TRACE_CTX:
1000 S = entry->ctx.prev_state < sizeof(state_to_char) ? 1001 S = entry->ctx.prev_state < sizeof(state_to_char) ?
@@ -1007,7 +1008,6 @@ print_trace_fmt(struct seq_file *m, struct trace_iterator *iter)
1007 entry->ctx.next_prio); 1008 entry->ctx.next_prio);
1008 break; 1009 break;
1009 } 1010 }
1010 seq_printf(m, "\n");
1011} 1011}
1012 1012
1013static int trace_empty(struct trace_iterator *iter) 1013static int trace_empty(struct trace_iterator *iter)
@@ -1332,6 +1332,39 @@ static struct file_operations tracing_iter_fops = {
1332 .write = tracing_iter_ctrl_write, 1332 .write = tracing_iter_ctrl_write,
1333}; 1333};
1334 1334
1335static const char readme_msg[] =
1336 "tracing mini-HOWTO:\n\n"
1337 "# mkdir /debug\n"
1338 "# mount -t debugfs nodev /debug\n\n"
1339 "# cat /debug/tracing/available_tracers\n"
1340 "wakeup preemptirqsoff preemptoff irqsoff ftrace sched_switch none\n\n"
1341 "# cat /debug/tracing/current_tracer\n"
1342 "none\n"
1343 "# echo sched_switch > /debug/tracing/current_tracer\n"
1344 "# cat /debug/tracing/current_tracer\n"
1345 "sched_switch\n"
1346 "# cat /debug/tracing/iter_ctrl\n"
1347 "noprint-parent nosym-offset nosym-addr noverbose\n"
1348 "# echo print-parent > /debug/tracing/iter_ctrl\n"
1349 "# echo 1 > /debug/tracing/tracing_enabled\n"
1350 "# cat /debug/tracing/trace > /tmp/trace.txt\n"
1351 "echo 0 > /debug/tracing/tracing_enabled\n"
1352;
1353
1354static ssize_t
1355tracing_readme_read(struct file *filp, char __user *ubuf,
1356 size_t cnt, loff_t *ppos)
1357{
1358 return simple_read_from_buffer(ubuf, cnt, ppos,
1359 readme_msg, strlen(readme_msg));
1360}
1361
1362static struct file_operations tracing_readme_fops = {
1363 .open = tracing_open_generic,
1364 .read = tracing_readme_read,
1365};
1366
1367
1335static ssize_t 1368static ssize_t
1336tracing_ctrl_read(struct file *filp, char __user *ubuf, 1369tracing_ctrl_read(struct file *filp, char __user *ubuf,
1337 size_t cnt, loff_t *ppos) 1370 size_t cnt, loff_t *ppos)
@@ -1598,6 +1631,11 @@ static __init void tracer_init_debugfs(void)
1598 if (!entry) 1631 if (!entry)
1599 pr_warning("Could not create debugfs " 1632 pr_warning("Could not create debugfs "
1600 "'tracing_threash' entry\n"); 1633 "'tracing_threash' entry\n");
1634 entry = debugfs_create_file("README", 0644, d_tracer,
1635 NULL, &tracing_readme_fops);
1636 if (!entry)
1637 pr_warning("Could not create debugfs 'README' entry\n");
1638
1601 1639
1602#ifdef CONFIG_DYNAMIC_FTRACE 1640#ifdef CONFIG_DYNAMIC_FTRACE
1603 entry = debugfs_create_file("dyn_ftrace_total_info", 0444, d_tracer, 1641 entry = debugfs_create_file("dyn_ftrace_total_info", 0444, d_tracer,