Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121112
b: refs/heads/master
c: a94c80e
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Nov 13, 2008
1 parent 6fe7992 commit a076fab
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 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: d1aaf8cf8afe70a8c2235a565885291fe290c57c
refs/heads/master: a94c80e78bc9f4493ffc25a02d5d7bcd93c399d0
18 changes: 9 additions & 9 deletions trunk/Documentation/ftrace.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ of ftrace. Here is a list of some of the key files:
only be recorded if the latency is greater than
the value in this file. (in microseconds)

trace_entries: This sets or displays the number of bytes each CPU
buffer_size_kb: This sets or displays the number of bytes each CPU
buffer can hold. The tracer buffers are the same size
for each CPU. The displayed number is the size of the
CPU buffer and not total size of all buffers. The
Expand Down Expand Up @@ -1299,22 +1299,22 @@ trace entries
-------------

Having too much or not enough data can be troublesome in diagnosing
an issue in the kernel. The file trace_entries is used to modify
an issue in the kernel. The file buffer_size_kb is used to modify
the size of the internal trace buffers. The number listed
is the number of entries that can be recorded per CPU. To know
the full size, multiply the number of possible CPUS with the
number of entries.

# cat /debug/tracing/trace_entries
# cat /debug/tracing/buffer_size_kb
65620

Note, to modify this, you must have tracing completely disabled. To do that,
echo "nop" into the current_tracer. If the current_tracer is not set
to "nop", an EINVAL error will be returned.

# echo nop > /debug/tracing/current_tracer
# echo 100000 > /debug/tracing/trace_entries
# cat /debug/tracing/trace_entries
# echo 100000 > /debug/tracing/buffer_size_kb
# cat /debug/tracing/buffer_size_kb
100045


Expand All @@ -1323,17 +1323,17 @@ are held in individual pages. It allocates the number of pages it takes
to fulfill the request. If more entries may fit on the last page
then they will be added.

# echo 1 > /debug/tracing/trace_entries
# cat /debug/tracing/trace_entries
# echo 1 > /debug/tracing/buffer_size_kb
# cat /debug/tracing/buffer_size_kb
85

This shows us that 85 entries can fit in a single page.

The number of pages which will be allocated is limited to a percentage
of available memory. Allocating too much will produce an error.

# echo 1000000000000 > /debug/tracing/trace_entries
# echo 1000000000000 > /debug/tracing/buffer_size_kb
-bash: echo: write error: Cannot allocate memory
# cat /debug/tracing/trace_entries
# cat /debug/tracing/buffer_size_kb
85

4 changes: 2 additions & 2 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -3198,11 +3198,11 @@ static __init int tracer_init_debugfs(void)
pr_warning("Could not create debugfs "
"'trace_pipe' entry\n");

entry = debugfs_create_file("trace_entries", 0644, d_tracer,
entry = debugfs_create_file("buffer_size_kb", 0644, d_tracer,
&global_trace, &tracing_entries_fops);
if (!entry)
pr_warning("Could not create debugfs "
"'trace_entries' entry\n");
"'buffer_size_kb' entry\n");

entry = debugfs_create_file("trace_marker", 0220, d_tracer,
NULL, &tracing_mark_fops);
Expand Down
12 changes: 5 additions & 7 deletions trunk/scripts/bootgraph.pl
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,11 @@
}

if ($count == 0) {
print STDERR <<END;
No data found in the dmesg. Make sure that 'printk.time=1' and
'initcall_debug' are passed on the kernel command line.
Usage:
dmesg | perl scripts/bootgraph.pl > output.svg
END
exit 1;
print "No data found in the dmesg. Make sure that 'printk.time=1' and\n";
print "'initcall_debug' are passed on the kernel command line.\n\n";
print "Usage: \n";
print " dmesg | perl scripts/bootgraph.pl > output.svg\n\n";
exit;
}

print "<?xml version=\"1.0\" standalone=\"no\"?> \n";
Expand Down

0 comments on commit a076fab

Please sign in to comment.