diff options
author | GeunSik Lim <leemgs1@gmail.com> | 2009-06-02 02:01:37 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:30:28 -0400 |
commit | 156f5a7801195fa2ce44aeeb62d6cf8468f3332a (patch) | |
tree | dd506816ca6f14bb650189aa364eb0a2f51ad5cc | |
parent | 1b713e00500c6f03317742981674e89a21629399 (diff) |
debugfs: Fix terminology inconsistency of dir name to mount debugfs filesystem.
Many developers use "/debug/" or "/debugfs/" or "/sys/kernel/debug/"
directory name to mount debugfs filesystem for ftrace according to
./Documentation/tracers/ftrace.txt file.
And, three directory names(ex:/debug/, /debugfs/, /sys/kernel/debug/) is
existed in kernel source like ftrace, DRM, Wireless, Documentation,
Network[sky2]files to mount debugfs filesystem.
debugfs means debug filesystem for debugging easy to use by greg kroah
hartman. "/sys/kernel/debug/" name is suitable as directory name
of debugfs filesystem.
- debugfs related reference: http://lwn.net/Articles/334546/
Fix inconsistency of directory name to mount debugfs filesystem.
* From Steven Rostedt
- find_debugfs() and tracing_files() in this patch.
Signed-off-by: GeunSik Lim <geunsik.lim@samsung.com>
Acked-by : Inaky Perez-Gonzalez <inaky@linux.intel.com>
Reviewed-by : Steven Rostedt <rostedt@goodmis.org>
Reviewed-by : James Smart <james.smart@emulex.com>
CC: Jiri Kosina <trivial@kernel.org>
CC: David Airlie <airlied@linux.ie>
CC: Peter Osterlund <petero2@telia.com>
CC: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
CC: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
CC: Masami Hiramatsu <mhiramat@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | Documentation/DocBook/debugobjects.tmpl | 2 | ||||
-rw-r--r-- | Documentation/cdrom/packet-writing.txt | 2 | ||||
-rw-r--r-- | Documentation/fault-injection/fault-injection.txt | 70 | ||||
-rw-r--r-- | Documentation/kprobes.txt | 6 | ||||
-rw-r--r-- | Documentation/trace/ftrace.txt | 233 | ||||
-rw-r--r-- | Documentation/trace/mmiotrace.txt | 26 | ||||
-rw-r--r-- | drivers/block/pktcdvd.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_debugfs.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_drv.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_stub.c | 2 | ||||
-rw-r--r-- | drivers/net/Kconfig | 4 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/i2400m.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/Kconfig | 5 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/README | 12 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_debugfs.c | 3 | ||||
-rw-r--r-- | include/linux/kernel.h | 2 | ||||
-rw-r--r-- | include/linux/tracepoint.h | 4 | ||||
-rw-r--r-- | kernel/trace/Kconfig | 10 | ||||
-rw-r--r-- | kernel/trace/trace.c | 23 | ||||
-rw-r--r-- | scripts/tracing/draw_functrace.py | 7 |
20 files changed, 238 insertions, 191 deletions
diff --git a/Documentation/DocBook/debugobjects.tmpl b/Documentation/DocBook/debugobjects.tmpl index 7f5f218015fe..08ff908aa7a2 100644 --- a/Documentation/DocBook/debugobjects.tmpl +++ b/Documentation/DocBook/debugobjects.tmpl | |||
@@ -106,7 +106,7 @@ | |||
106 | number of errors are printk'ed including a full stack trace. | 106 | number of errors are printk'ed including a full stack trace. |
107 | </para> | 107 | </para> |
108 | <para> | 108 | <para> |
109 | The statistics are available via debugfs/debug_objects/stats. | 109 | The statistics are available via /sys/kernel/debug/debug_objects/stats. |
110 | They provide information about the number of warnings and the | 110 | They provide information about the number of warnings and the |
111 | number of successful fixups along with information about the | 111 | number of successful fixups along with information about the |
112 | usage of the internal tracking objects and the state of the | 112 | usage of the internal tracking objects and the state of the |
diff --git a/Documentation/cdrom/packet-writing.txt b/Documentation/cdrom/packet-writing.txt index cf1f8126991c..1c407778c8b2 100644 --- a/Documentation/cdrom/packet-writing.txt +++ b/Documentation/cdrom/packet-writing.txt | |||
@@ -117,7 +117,7 @@ Using the pktcdvd debugfs interface | |||
117 | 117 | ||
118 | To read pktcdvd device infos in human readable form, do: | 118 | To read pktcdvd device infos in human readable form, do: |
119 | 119 | ||
120 | # cat /debug/pktcdvd/pktcdvd[0-7]/info | 120 | # cat /sys/kernel/debug/pktcdvd/pktcdvd[0-7]/info |
121 | 121 | ||
122 | For a description of the debugfs interface look into the file: | 122 | For a description of the debugfs interface look into the file: |
123 | 123 | ||
diff --git a/Documentation/fault-injection/fault-injection.txt b/Documentation/fault-injection/fault-injection.txt index 4bc374a14345..079305640790 100644 --- a/Documentation/fault-injection/fault-injection.txt +++ b/Documentation/fault-injection/fault-injection.txt | |||
@@ -29,16 +29,16 @@ o debugfs entries | |||
29 | fault-inject-debugfs kernel module provides some debugfs entries for runtime | 29 | fault-inject-debugfs kernel module provides some debugfs entries for runtime |
30 | configuration of fault-injection capabilities. | 30 | configuration of fault-injection capabilities. |
31 | 31 | ||
32 | - /debug/fail*/probability: | 32 | - /sys/kernel/debug/fail*/probability: |
33 | 33 | ||
34 | likelihood of failure injection, in percent. | 34 | likelihood of failure injection, in percent. |
35 | Format: <percent> | 35 | Format: <percent> |
36 | 36 | ||
37 | Note that one-failure-per-hundred is a very high error rate | 37 | Note that one-failure-per-hundred is a very high error rate |
38 | for some testcases. Consider setting probability=100 and configure | 38 | for some testcases. Consider setting probability=100 and configure |
39 | /debug/fail*/interval for such testcases. | 39 | /sys/kernel/debug/fail*/interval for such testcases. |
40 | 40 | ||
41 | - /debug/fail*/interval: | 41 | - /sys/kernel/debug/fail*/interval: |
42 | 42 | ||
43 | specifies the interval between failures, for calls to | 43 | specifies the interval between failures, for calls to |
44 | should_fail() that pass all the other tests. | 44 | should_fail() that pass all the other tests. |
@@ -46,18 +46,18 @@ configuration of fault-injection capabilities. | |||
46 | Note that if you enable this, by setting interval>1, you will | 46 | Note that if you enable this, by setting interval>1, you will |
47 | probably want to set probability=100. | 47 | probably want to set probability=100. |
48 | 48 | ||
49 | - /debug/fail*/times: | 49 | - /sys/kernel/debug/fail*/times: |
50 | 50 | ||
51 | specifies how many times failures may happen at most. | 51 | specifies how many times failures may happen at most. |
52 | A value of -1 means "no limit". | 52 | A value of -1 means "no limit". |
53 | 53 | ||
54 | - /debug/fail*/space: | 54 | - /sys/kernel/debug/fail*/space: |
55 | 55 | ||
56 | specifies an initial resource "budget", decremented by "size" | 56 | specifies an initial resource "budget", decremented by "size" |
57 | on each call to should_fail(,size). Failure injection is | 57 | on each call to should_fail(,size). Failure injection is |
58 | suppressed until "space" reaches zero. | 58 | suppressed until "space" reaches zero. |
59 | 59 | ||
60 | - /debug/fail*/verbose | 60 | - /sys/kernel/debug/fail*/verbose |
61 | 61 | ||
62 | Format: { 0 | 1 | 2 } | 62 | Format: { 0 | 1 | 2 } |
63 | specifies the verbosity of the messages when failure is | 63 | specifies the verbosity of the messages when failure is |
@@ -65,17 +65,17 @@ configuration of fault-injection capabilities. | |||
65 | log line per failure; '2' will print a call trace too -- useful | 65 | log line per failure; '2' will print a call trace too -- useful |
66 | to debug the problems revealed by fault injection. | 66 | to debug the problems revealed by fault injection. |
67 | 67 | ||
68 | - /debug/fail*/task-filter: | 68 | - /sys/kernel/debug/fail*/task-filter: |
69 | 69 | ||
70 | Format: { 'Y' | 'N' } | 70 | Format: { 'Y' | 'N' } |
71 | A value of 'N' disables filtering by process (default). | 71 | A value of 'N' disables filtering by process (default). |
72 | Any positive value limits failures to only processes indicated by | 72 | Any positive value limits failures to only processes indicated by |
73 | /proc/<pid>/make-it-fail==1. | 73 | /proc/<pid>/make-it-fail==1. |
74 | 74 | ||
75 | - /debug/fail*/require-start: | 75 | - /sys/kernel/debug/fail*/require-start: |
76 | - /debug/fail*/require-end: | 76 | - /sys/kernel/debug/fail*/require-end: |
77 | - /debug/fail*/reject-start: | 77 | - /sys/kernel/debug/fail*/reject-start: |
78 | - /debug/fail*/reject-end: | 78 | - /sys/kernel/debug/fail*/reject-end: |
79 | 79 | ||
80 | specifies the range of virtual addresses tested during | 80 | specifies the range of virtual addresses tested during |
81 | stacktrace walking. Failure is injected only if some caller | 81 | stacktrace walking. Failure is injected only if some caller |
@@ -84,26 +84,26 @@ configuration of fault-injection capabilities. | |||
84 | Default required range is [0,ULONG_MAX) (whole of virtual address space). | 84 | Default required range is [0,ULONG_MAX) (whole of virtual address space). |
85 | Default rejected range is [0,0). | 85 | Default rejected range is [0,0). |
86 | 86 | ||
87 | - /debug/fail*/stacktrace-depth: | 87 | - /sys/kernel/debug/fail*/stacktrace-depth: |
88 | 88 | ||
89 | specifies the maximum stacktrace depth walked during search | 89 | specifies the maximum stacktrace depth walked during search |
90 | for a caller within [require-start,require-end) OR | 90 | for a caller within [require-start,require-end) OR |
91 | [reject-start,reject-end). | 91 | [reject-start,reject-end). |
92 | 92 | ||
93 | - /debug/fail_page_alloc/ignore-gfp-highmem: | 93 | - /sys/kernel/debug/fail_page_alloc/ignore-gfp-highmem: |
94 | 94 | ||
95 | Format: { 'Y' | 'N' } | 95 | Format: { 'Y' | 'N' } |
96 | default is 'N', setting it to 'Y' won't inject failures into | 96 | default is 'N', setting it to 'Y' won't inject failures into |
97 | highmem/user allocations. | 97 | highmem/user allocations. |
98 | 98 | ||
99 | - /debug/failslab/ignore-gfp-wait: | 99 | - /sys/kernel/debug/failslab/ignore-gfp-wait: |
100 | - /debug/fail_page_alloc/ignore-gfp-wait: | 100 | - /sys/kernel/debug/fail_page_alloc/ignore-gfp-wait: |
101 | 101 | ||
102 | Format: { 'Y' | 'N' } | 102 | Format: { 'Y' | 'N' } |
103 | default is 'N', setting it to 'Y' will inject failures | 103 | default is 'N', setting it to 'Y' will inject failures |
104 | only into non-sleep allocations (GFP_ATOMIC allocations). | 104 | only into non-sleep allocations (GFP_ATOMIC allocations). |
105 | 105 | ||
106 | - /debug/fail_page_alloc/min-order: | 106 | - /sys/kernel/debug/fail_page_alloc/min-order: |
107 | 107 | ||
108 | specifies the minimum page allocation order to be injected | 108 | specifies the minimum page allocation order to be injected |
109 | failures. | 109 | failures. |
@@ -166,13 +166,13 @@ o Inject slab allocation failures into module init/exit code | |||
166 | #!/bin/bash | 166 | #!/bin/bash |
167 | 167 | ||
168 | FAILTYPE=failslab | 168 | FAILTYPE=failslab |
169 | echo Y > /debug/$FAILTYPE/task-filter | 169 | echo Y > /sys/kernel/debug/$FAILTYPE/task-filter |
170 | echo 10 > /debug/$FAILTYPE/probability | 170 | echo 10 > /sys/kernel/debug/$FAILTYPE/probability |
171 | echo 100 > /debug/$FAILTYPE/interval | 171 | echo 100 > /sys/kernel/debug/$FAILTYPE/interval |
172 | echo -1 > /debug/$FAILTYPE/times | 172 | echo -1 > /sys/kernel/debug/$FAILTYPE/times |
173 | echo 0 > /debug/$FAILTYPE/space | 173 | echo 0 > /sys/kernel/debug/$FAILTYPE/space |
174 | echo 2 > /debug/$FAILTYPE/verbose | 174 | echo 2 > /sys/kernel/debug/$FAILTYPE/verbose |
175 | echo 1 > /debug/$FAILTYPE/ignore-gfp-wait | 175 | echo 1 > /sys/kernel/debug/$FAILTYPE/ignore-gfp-wait |
176 | 176 | ||
177 | faulty_system() | 177 | faulty_system() |
178 | { | 178 | { |
@@ -217,20 +217,20 @@ then | |||
217 | exit 1 | 217 | exit 1 |
218 | fi | 218 | fi |
219 | 219 | ||
220 | cat /sys/module/$module/sections/.text > /debug/$FAILTYPE/require-start | 220 | cat /sys/module/$module/sections/.text > /sys/kernel/debug/$FAILTYPE/require-start |
221 | cat /sys/module/$module/sections/.data > /debug/$FAILTYPE/require-end | 221 | cat /sys/module/$module/sections/.data > /sys/kernel/debug/$FAILTYPE/require-end |
222 | 222 | ||
223 | echo N > /debug/$FAILTYPE/task-filter | 223 | echo N > /sys/kernel/debug/$FAILTYPE/task-filter |
224 | echo 10 > /debug/$FAILTYPE/probability | 224 | echo 10 > /sys/kernel/debug/$FAILTYPE/probability |
225 | echo 100 > /debug/$FAILTYPE/interval | 225 | echo 100 > /sys/kernel/debug/$FAILTYPE/interval |
226 | echo -1 > /debug/$FAILTYPE/times | 226 | echo -1 > /sys/kernel/debug/$FAILTYPE/times |
227 | echo 0 > /debug/$FAILTYPE/space | 227 | echo 0 > /sys/kernel/debug/$FAILTYPE/space |
228 | echo 2 > /debug/$FAILTYPE/verbose | 228 | echo 2 > /sys/kernel/debug/$FAILTYPE/verbose |
229 | echo 1 > /debug/$FAILTYPE/ignore-gfp-wait | 229 | echo 1 > /sys/kernel/debug/$FAILTYPE/ignore-gfp-wait |
230 | echo 1 > /debug/$FAILTYPE/ignore-gfp-highmem | 230 | echo 1 > /sys/kernel/debug/$FAILTYPE/ignore-gfp-highmem |
231 | echo 10 > /debug/$FAILTYPE/stacktrace-depth | 231 | echo 10 > /sys/kernel/debug/$FAILTYPE/stacktrace-depth |
232 | 232 | ||
233 | trap "echo 0 > /debug/$FAILTYPE/probability" SIGINT SIGTERM EXIT | 233 | trap "echo 0 > /sys/kernel/debug/$FAILTYPE/probability" SIGINT SIGTERM EXIT |
234 | 234 | ||
235 | echo "Injecting errors into the module $module... (interrupt to stop)" | 235 | echo "Injecting errors into the module $module... (interrupt to stop)" |
236 | sleep 1000000 | 236 | sleep 1000000 |
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt index 1e7a769a10f9..053037a1fe6d 100644 --- a/Documentation/kprobes.txt +++ b/Documentation/kprobes.txt | |||
@@ -507,9 +507,9 @@ http://www.linuxsymposium.org/2006/linuxsymposium_procv2.pdf (pages 101-115) | |||
507 | Appendix A: The kprobes debugfs interface | 507 | Appendix A: The kprobes debugfs interface |
508 | 508 | ||
509 | With recent kernels (> 2.6.20) the list of registered kprobes is visible | 509 | With recent kernels (> 2.6.20) the list of registered kprobes is visible |
510 | under the /debug/kprobes/ directory (assuming debugfs is mounted at /debug). | 510 | under the /sys/kernel/debug/kprobes/ directory (assuming debugfs is mounted at //sys/kernel/debug). |
511 | 511 | ||
512 | /debug/kprobes/list: Lists all registered probes on the system | 512 | /sys/kernel/debug/kprobes/list: Lists all registered probes on the system |
513 | 513 | ||
514 | c015d71a k vfs_read+0x0 | 514 | c015d71a k vfs_read+0x0 |
515 | c011a316 j do_fork+0x0 | 515 | c011a316 j do_fork+0x0 |
@@ -525,7 +525,7 @@ virtual addresses that correspond to modules that've been unloaded), | |||
525 | such probes are marked with [GONE]. If the probe is temporarily disabled, | 525 | such probes are marked with [GONE]. If the probe is temporarily disabled, |
526 | such probes are marked with [DISABLED]. | 526 | such probes are marked with [DISABLED]. |
527 | 527 | ||
528 | /debug/kprobes/enabled: Turn kprobes ON/OFF forcibly. | 528 | /sys/kernel/debug/kprobes/enabled: Turn kprobes ON/OFF forcibly. |
529 | 529 | ||
530 | Provides a knob to globally and forcibly turn registered kprobes ON or OFF. | 530 | Provides a knob to globally and forcibly turn registered kprobes ON or OFF. |
531 | By default, all kprobes are enabled. By echoing "0" to this file, all | 531 | By default, all kprobes are enabled. By echoing "0" to this file, all |
diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt index 7bd27f0e2880..a39b3c749de5 100644 --- a/Documentation/trace/ftrace.txt +++ b/Documentation/trace/ftrace.txt | |||
@@ -7,7 +7,6 @@ Copyright 2008 Red Hat Inc. | |||
7 | (dual licensed under the GPL v2) | 7 | (dual licensed under the GPL v2) |
8 | Reviewers: Elias Oltmanns, Randy Dunlap, Andrew Morton, | 8 | Reviewers: Elias Oltmanns, Randy Dunlap, Andrew Morton, |
9 | John Kacur, and David Teigland. | 9 | John Kacur, and David Teigland. |
10 | |||
11 | Written for: 2.6.28-rc2 | 10 | Written for: 2.6.28-rc2 |
12 | 11 | ||
13 | Introduction | 12 | Introduction |
@@ -33,13 +32,26 @@ The File System | |||
33 | Ftrace uses the debugfs file system to hold the control files as | 32 | Ftrace uses the debugfs file system to hold the control files as |
34 | well as the files to display output. | 33 | well as the files to display output. |
35 | 34 | ||
36 | To mount the debugfs system: | 35 | When debugfs is configured into the kernel (which selecting any ftrace |
36 | option will do) the directory /sys/kernel/debug will be created. To mount | ||
37 | this directory, you can add to your /etc/fstab file: | ||
38 | |||
39 | debugfs /sys/kernel/debug debugfs defaults 0 0 | ||
40 | |||
41 | Or you can mount it at run time with: | ||
42 | |||
43 | mount -t debugfs nodev /sys/kernel/debug | ||
37 | 44 | ||
38 | # mkdir /debug | 45 | For quicker access to that directory you may want to make a soft link to |
39 | # mount -t debugfs nodev /debug | 46 | it: |
40 | 47 | ||
41 | ( Note: it is more common to mount at /sys/kernel/debug, but for | 48 | ln -s /sys/kernel/debug /debug |
42 | simplicity this document will use /debug) | 49 | |
50 | Any selected ftrace option will also create a directory called tracing | ||
51 | within the debugfs. The rest of the document will assume that you are in | ||
52 | the ftrace directory (cd /sys/kernel/debug/tracing) and will only concentrate | ||
53 | on the files within that directory and not distract from the content with | ||
54 | the extended "/sys/kernel/debug/tracing" path name. | ||
43 | 55 | ||
44 | That's it! (assuming that you have ftrace configured into your kernel) | 56 | That's it! (assuming that you have ftrace configured into your kernel) |
45 | 57 | ||
@@ -389,18 +401,18 @@ trace_options | |||
389 | The trace_options file is used to control what gets printed in | 401 | The trace_options file is used to control what gets printed in |
390 | the trace output. To see what is available, simply cat the file: | 402 | the trace output. To see what is available, simply cat the file: |
391 | 403 | ||
392 | cat /debug/tracing/trace_options | 404 | cat trace_options |
393 | print-parent nosym-offset nosym-addr noverbose noraw nohex nobin \ | 405 | print-parent nosym-offset nosym-addr noverbose noraw nohex nobin \ |
394 | noblock nostacktrace nosched-tree nouserstacktrace nosym-userobj | 406 | noblock nostacktrace nosched-tree nouserstacktrace nosym-userobj |
395 | 407 | ||
396 | To disable one of the options, echo in the option prepended with | 408 | To disable one of the options, echo in the option prepended with |
397 | "no". | 409 | "no". |
398 | 410 | ||
399 | echo noprint-parent > /debug/tracing/trace_options | 411 | echo noprint-parent > trace_options |
400 | 412 | ||
401 | To enable an option, leave off the "no". | 413 | To enable an option, leave off the "no". |
402 | 414 | ||
403 | echo sym-offset > /debug/tracing/trace_options | 415 | echo sym-offset > trace_options |
404 | 416 | ||
405 | Here are the available options: | 417 | Here are the available options: |
406 | 418 | ||
@@ -476,11 +488,11 @@ sched_switch | |||
476 | This tracer simply records schedule switches. Here is an example | 488 | This tracer simply records schedule switches. Here is an example |
477 | of how to use it. | 489 | of how to use it. |
478 | 490 | ||
479 | # echo sched_switch > /debug/tracing/current_tracer | 491 | # echo sched_switch > current_tracer |
480 | # echo 1 > /debug/tracing/tracing_enabled | 492 | # echo 1 > tracing_enabled |
481 | # sleep 1 | 493 | # sleep 1 |
482 | # echo 0 > /debug/tracing/tracing_enabled | 494 | # echo 0 > tracing_enabled |
483 | # cat /debug/tracing/trace | 495 | # cat trace |
484 | 496 | ||
485 | # tracer: sched_switch | 497 | # tracer: sched_switch |
486 | # | 498 | # |
@@ -583,13 +595,13 @@ new trace is saved. | |||
583 | To reset the maximum, echo 0 into tracing_max_latency. Here is | 595 | To reset the maximum, echo 0 into tracing_max_latency. Here is |
584 | an example: | 596 | an example: |
585 | 597 | ||
586 | # echo irqsoff > /debug/tracing/current_tracer | 598 | # echo irqsoff > current_tracer |
587 | # echo 0 > /debug/tracing/tracing_max_latency | 599 | # echo 0 > tracing_max_latency |
588 | # echo 1 > /debug/tracing/tracing_enabled | 600 | # echo 1 > tracing_enabled |
589 | # ls -ltr | 601 | # ls -ltr |
590 | [...] | 602 | [...] |
591 | # echo 0 > /debug/tracing/tracing_enabled | 603 | # echo 0 > tracing_enabled |
592 | # cat /debug/tracing/latency_trace | 604 | # cat latency_trace |
593 | # tracer: irqsoff | 605 | # tracer: irqsoff |
594 | # | 606 | # |
595 | irqsoff latency trace v1.1.5 on 2.6.26 | 607 | irqsoff latency trace v1.1.5 on 2.6.26 |
@@ -690,13 +702,13 @@ Like the irqsoff tracer, it records the maximum latency for | |||
690 | which preemption was disabled. The control of preemptoff tracer | 702 | which preemption was disabled. The control of preemptoff tracer |
691 | is much like the irqsoff tracer. | 703 | is much like the irqsoff tracer. |
692 | 704 | ||
693 | # echo preemptoff > /debug/tracing/current_tracer | 705 | # echo preemptoff > current_tracer |
694 | # echo 0 > /debug/tracing/tracing_max_latency | 706 | # echo 0 > tracing_max_latency |
695 | # echo 1 > /debug/tracing/tracing_enabled | 707 | # echo 1 > tracing_enabled |
696 | # ls -ltr | 708 | # ls -ltr |
697 | [...] | 709 | [...] |
698 | # echo 0 > /debug/tracing/tracing_enabled | 710 | # echo 0 > tracing_enabled |
699 | # cat /debug/tracing/latency_trace | 711 | # cat latency_trace |
700 | # tracer: preemptoff | 712 | # tracer: preemptoff |
701 | # | 713 | # |
702 | preemptoff latency trace v1.1.5 on 2.6.26-rc8 | 714 | preemptoff latency trace v1.1.5 on 2.6.26-rc8 |
@@ -837,13 +849,13 @@ tracer. | |||
837 | Again, using this trace is much like the irqsoff and preemptoff | 849 | Again, using this trace is much like the irqsoff and preemptoff |
838 | tracers. | 850 | tracers. |
839 | 851 | ||
840 | # echo preemptirqsoff > /debug/tracing/current_tracer | 852 | # echo preemptirqsoff > current_tracer |
841 | # echo 0 > /debug/tracing/tracing_max_latency | 853 | # echo 0 > tracing_max_latency |
842 | # echo 1 > /debug/tracing/tracing_enabled | 854 | # echo 1 > tracing_enabled |
843 | # ls -ltr | 855 | # ls -ltr |
844 | [...] | 856 | [...] |
845 | # echo 0 > /debug/tracing/tracing_enabled | 857 | # echo 0 > tracing_enabled |
846 | # cat /debug/tracing/latency_trace | 858 | # cat latency_trace |
847 | # tracer: preemptirqsoff | 859 | # tracer: preemptirqsoff |
848 | # | 860 | # |
849 | preemptirqsoff latency trace v1.1.5 on 2.6.26-rc8 | 861 | preemptirqsoff latency trace v1.1.5 on 2.6.26-rc8 |
@@ -999,12 +1011,12 @@ slightly differently than we did with the previous tracers. | |||
999 | Instead of performing an 'ls', we will run 'sleep 1' under | 1011 | Instead of performing an 'ls', we will run 'sleep 1' under |
1000 | 'chrt' which changes the priority of the task. | 1012 | 'chrt' which changes the priority of the task. |
1001 | 1013 | ||
1002 | # echo wakeup > /debug/tracing/current_tracer | 1014 | # echo wakeup > current_tracer |
1003 | # echo 0 > /debug/tracing/tracing_max_latency | 1015 | # echo 0 > tracing_max_latency |
1004 | # echo 1 > /debug/tracing/tracing_enabled | 1016 | # echo 1 > tracing_enabled |
1005 | # chrt -f 5 sleep 1 | 1017 | # chrt -f 5 sleep 1 |
1006 | # echo 0 > /debug/tracing/tracing_enabled | 1018 | # echo 0 > tracing_enabled |
1007 | # cat /debug/tracing/latency_trace | 1019 | # cat latency_trace |
1008 | # tracer: wakeup | 1020 | # tracer: wakeup |
1009 | # | 1021 | # |
1010 | wakeup latency trace v1.1.5 on 2.6.26-rc8 | 1022 | wakeup latency trace v1.1.5 on 2.6.26-rc8 |
@@ -1114,11 +1126,11 @@ can be done from the debug file system. Make sure the | |||
1114 | ftrace_enabled is set; otherwise this tracer is a nop. | 1126 | ftrace_enabled is set; otherwise this tracer is a nop. |
1115 | 1127 | ||
1116 | # sysctl kernel.ftrace_enabled=1 | 1128 | # sysctl kernel.ftrace_enabled=1 |
1117 | # echo function > /debug/tracing/current_tracer | 1129 | # echo function > current_tracer |
1118 | # echo 1 > /debug/tracing/tracing_enabled | 1130 | # echo 1 > tracing_enabled |
1119 | # usleep 1 | 1131 | # usleep 1 |
1120 | # echo 0 > /debug/tracing/tracing_enabled | 1132 | # echo 0 > tracing_enabled |
1121 | # cat /debug/tracing/trace | 1133 | # cat trace |
1122 | # tracer: function | 1134 | # tracer: function |
1123 | # | 1135 | # |
1124 | # TASK-PID CPU# TIMESTAMP FUNCTION | 1136 | # TASK-PID CPU# TIMESTAMP FUNCTION |
@@ -1155,7 +1167,7 @@ int trace_fd; | |||
1155 | [...] | 1167 | [...] |
1156 | int main(int argc, char *argv[]) { | 1168 | int main(int argc, char *argv[]) { |
1157 | [...] | 1169 | [...] |
1158 | trace_fd = open("/debug/tracing/tracing_enabled", O_WRONLY); | 1170 | trace_fd = open(tracing_file("tracing_enabled"), O_WRONLY); |
1159 | [...] | 1171 | [...] |
1160 | if (condition_hit()) { | 1172 | if (condition_hit()) { |
1161 | write(trace_fd, "0", 1); | 1173 | write(trace_fd, "0", 1); |
@@ -1163,26 +1175,20 @@ int main(int argc, char *argv[]) { | |||
1163 | [...] | 1175 | [...] |
1164 | } | 1176 | } |
1165 | 1177 | ||
1166 | Note: Here we hard coded the path name. The debugfs mount is not | ||
1167 | guaranteed to be at /debug (and is more commonly at | ||
1168 | /sys/kernel/debug). For simple one time traces, the above is | ||
1169 | sufficent. For anything else, a search through /proc/mounts may | ||
1170 | be needed to find where the debugfs file-system is mounted. | ||
1171 | |||
1172 | 1178 | ||
1173 | Single thread tracing | 1179 | Single thread tracing |
1174 | --------------------- | 1180 | --------------------- |
1175 | 1181 | ||
1176 | By writing into /debug/tracing/set_ftrace_pid you can trace a | 1182 | By writing into set_ftrace_pid you can trace a |
1177 | single thread. For example: | 1183 | single thread. For example: |
1178 | 1184 | ||
1179 | # cat /debug/tracing/set_ftrace_pid | 1185 | # cat set_ftrace_pid |
1180 | no pid | 1186 | no pid |
1181 | # echo 3111 > /debug/tracing/set_ftrace_pid | 1187 | # echo 3111 > set_ftrace_pid |
1182 | # cat /debug/tracing/set_ftrace_pid | 1188 | # cat set_ftrace_pid |
1183 | 3111 | 1189 | 3111 |
1184 | # echo function > /debug/tracing/current_tracer | 1190 | # echo function > current_tracer |
1185 | # cat /debug/tracing/trace | head | 1191 | # cat trace | head |
1186 | # tracer: function | 1192 | # tracer: function |
1187 | # | 1193 | # |
1188 | # TASK-PID CPU# TIMESTAMP FUNCTION | 1194 | # TASK-PID CPU# TIMESTAMP FUNCTION |
@@ -1193,8 +1199,8 @@ no pid | |||
1193 | yum-updatesd-3111 [003] 1637.254683: lock_hrtimer_base <-hrtimer_try_to_cancel | 1199 | yum-updatesd-3111 [003] 1637.254683: lock_hrtimer_base <-hrtimer_try_to_cancel |
1194 | yum-updatesd-3111 [003] 1637.254685: fget_light <-do_sys_poll | 1200 | yum-updatesd-3111 [003] 1637.254685: fget_light <-do_sys_poll |
1195 | yum-updatesd-3111 [003] 1637.254686: pipe_poll <-do_sys_poll | 1201 | yum-updatesd-3111 [003] 1637.254686: pipe_poll <-do_sys_poll |
1196 | # echo -1 > /debug/tracing/set_ftrace_pid | 1202 | # echo -1 > set_ftrace_pid |
1197 | # cat /debug/tracing/trace |head | 1203 | # cat trace |head |
1198 | # tracer: function | 1204 | # tracer: function |
1199 | # | 1205 | # |
1200 | # TASK-PID CPU# TIMESTAMP FUNCTION | 1206 | # TASK-PID CPU# TIMESTAMP FUNCTION |
@@ -1216,6 +1222,51 @@ something like this simple program: | |||
1216 | #include <fcntl.h> | 1222 | #include <fcntl.h> |
1217 | #include <unistd.h> | 1223 | #include <unistd.h> |
1218 | 1224 | ||
1225 | #define _STR(x) #x | ||
1226 | #define STR(x) _STR(x) | ||
1227 | #define MAX_PATH 256 | ||
1228 | |||
1229 | const char *find_debugfs(void) | ||
1230 | { | ||
1231 | static char debugfs[MAX_PATH+1]; | ||
1232 | static int debugfs_found; | ||
1233 | char type[100]; | ||
1234 | FILE *fp; | ||
1235 | |||
1236 | if (debugfs_found) | ||
1237 | return debugfs; | ||
1238 | |||
1239 | if ((fp = fopen("/proc/mounts","r")) == NULL) { | ||
1240 | perror("/proc/mounts"); | ||
1241 | return NULL; | ||
1242 | } | ||
1243 | |||
1244 | while (fscanf(fp, "%*s %" | ||
1245 | STR(MAX_PATH) | ||
1246 | "s %99s %*s %*d %*d\n", | ||
1247 | debugfs, type) == 2) { | ||
1248 | if (strcmp(type, "debugfs") == 0) | ||
1249 | break; | ||
1250 | } | ||
1251 | fclose(fp); | ||
1252 | |||
1253 | if (strcmp(type, "debugfs") != 0) { | ||
1254 | fprintf(stderr, "debugfs not mounted"); | ||
1255 | return NULL; | ||
1256 | } | ||
1257 | |||
1258 | debugfs_found = 1; | ||
1259 | |||
1260 | return debugfs; | ||
1261 | } | ||
1262 | |||
1263 | const char *tracing_file(const char *file_name) | ||
1264 | { | ||
1265 | static char trace_file[MAX_PATH+1]; | ||
1266 | snprintf(trace_file, MAX_PATH, "%s/%s", find_debugfs(), file_name); | ||
1267 | return trace_file; | ||
1268 | } | ||
1269 | |||
1219 | int main (int argc, char **argv) | 1270 | int main (int argc, char **argv) |
1220 | { | 1271 | { |
1221 | if (argc < 1) | 1272 | if (argc < 1) |
@@ -1226,12 +1277,12 @@ int main (int argc, char **argv) | |||
1226 | char line[64]; | 1277 | char line[64]; |
1227 | int s; | 1278 | int s; |
1228 | 1279 | ||
1229 | ffd = open("/debug/tracing/current_tracer", O_WRONLY); | 1280 | ffd = open(tracing_file("current_tracer"), O_WRONLY); |
1230 | if (ffd < 0) | 1281 | if (ffd < 0) |
1231 | exit(-1); | 1282 | exit(-1); |
1232 | write(ffd, "nop", 3); | 1283 | write(ffd, "nop", 3); |
1233 | 1284 | ||
1234 | fd = open("/debug/tracing/set_ftrace_pid", O_WRONLY); | 1285 | fd = open(tracing_file("set_ftrace_pid"), O_WRONLY); |
1235 | s = sprintf(line, "%d\n", getpid()); | 1286 | s = sprintf(line, "%d\n", getpid()); |
1236 | write(fd, line, s); | 1287 | write(fd, line, s); |
1237 | 1288 | ||
@@ -1383,22 +1434,22 @@ want, depending on your needs. | |||
1383 | tracing_cpu_mask file) or you might sometimes see unordered | 1434 | tracing_cpu_mask file) or you might sometimes see unordered |
1384 | function calls while cpu tracing switch. | 1435 | function calls while cpu tracing switch. |
1385 | 1436 | ||
1386 | hide: echo nofuncgraph-cpu > /debug/tracing/trace_options | 1437 | hide: echo nofuncgraph-cpu > trace_options |
1387 | show: echo funcgraph-cpu > /debug/tracing/trace_options | 1438 | show: echo funcgraph-cpu > trace_options |
1388 | 1439 | ||
1389 | - The duration (function's time of execution) is displayed on | 1440 | - The duration (function's time of execution) is displayed on |
1390 | the closing bracket line of a function or on the same line | 1441 | the closing bracket line of a function or on the same line |
1391 | than the current function in case of a leaf one. It is default | 1442 | than the current function in case of a leaf one. It is default |
1392 | enabled. | 1443 | enabled. |
1393 | 1444 | ||
1394 | hide: echo nofuncgraph-duration > /debug/tracing/trace_options | 1445 | hide: echo nofuncgraph-duration > trace_options |
1395 | show: echo funcgraph-duration > /debug/tracing/trace_options | 1446 | show: echo funcgraph-duration > trace_options |
1396 | 1447 | ||
1397 | - The overhead field precedes the duration field in case of | 1448 | - The overhead field precedes the duration field in case of |
1398 | reached duration thresholds. | 1449 | reached duration thresholds. |
1399 | 1450 | ||
1400 | hide: echo nofuncgraph-overhead > /debug/tracing/trace_options | 1451 | hide: echo nofuncgraph-overhead > trace_options |
1401 | show: echo funcgraph-overhead > /debug/tracing/trace_options | 1452 | show: echo funcgraph-overhead > trace_options |
1402 | depends on: funcgraph-duration | 1453 | depends on: funcgraph-duration |
1403 | 1454 | ||
1404 | ie: | 1455 | ie: |
@@ -1427,8 +1478,8 @@ want, depending on your needs. | |||
1427 | - The task/pid field displays the thread cmdline and pid which | 1478 | - The task/pid field displays the thread cmdline and pid which |
1428 | executed the function. It is default disabled. | 1479 | executed the function. It is default disabled. |
1429 | 1480 | ||
1430 | hide: echo nofuncgraph-proc > /debug/tracing/trace_options | 1481 | hide: echo nofuncgraph-proc > trace_options |
1431 | show: echo funcgraph-proc > /debug/tracing/trace_options | 1482 | show: echo funcgraph-proc > trace_options |
1432 | 1483 | ||
1433 | ie: | 1484 | ie: |
1434 | 1485 | ||
@@ -1451,8 +1502,8 @@ want, depending on your needs. | |||
1451 | system clock since it started. A snapshot of this time is | 1502 | system clock since it started. A snapshot of this time is |
1452 | given on each entry/exit of functions | 1503 | given on each entry/exit of functions |
1453 | 1504 | ||
1454 | hide: echo nofuncgraph-abstime > /debug/tracing/trace_options | 1505 | hide: echo nofuncgraph-abstime > trace_options |
1455 | show: echo funcgraph-abstime > /debug/tracing/trace_options | 1506 | show: echo funcgraph-abstime > trace_options |
1456 | 1507 | ||
1457 | ie: | 1508 | ie: |
1458 | 1509 | ||
@@ -1549,7 +1600,7 @@ listed in: | |||
1549 | 1600 | ||
1550 | available_filter_functions | 1601 | available_filter_functions |
1551 | 1602 | ||
1552 | # cat /debug/tracing/available_filter_functions | 1603 | # cat available_filter_functions |
1553 | put_prev_task_idle | 1604 | put_prev_task_idle |
1554 | kmem_cache_create | 1605 | kmem_cache_create |
1555 | pick_next_task_rt | 1606 | pick_next_task_rt |
@@ -1561,12 +1612,12 @@ mutex_lock | |||
1561 | If I am only interested in sys_nanosleep and hrtimer_interrupt: | 1612 | If I am only interested in sys_nanosleep and hrtimer_interrupt: |
1562 | 1613 | ||
1563 | # echo sys_nanosleep hrtimer_interrupt \ | 1614 | # echo sys_nanosleep hrtimer_interrupt \ |
1564 | > /debug/tracing/set_ftrace_filter | 1615 | > set_ftrace_filter |
1565 | # echo ftrace > /debug/tracing/current_tracer | 1616 | # echo ftrace > current_tracer |
1566 | # echo 1 > /debug/tracing/tracing_enabled | 1617 | # echo 1 > tracing_enabled |
1567 | # usleep 1 | 1618 | # usleep 1 |
1568 | # echo 0 > /debug/tracing/tracing_enabled | 1619 | # echo 0 > tracing_enabled |
1569 | # cat /debug/tracing/trace | 1620 | # cat trace |
1570 | # tracer: ftrace | 1621 | # tracer: ftrace |
1571 | # | 1622 | # |
1572 | # TASK-PID CPU# TIMESTAMP FUNCTION | 1623 | # TASK-PID CPU# TIMESTAMP FUNCTION |
@@ -1577,7 +1628,7 @@ If I am only interested in sys_nanosleep and hrtimer_interrupt: | |||
1577 | 1628 | ||
1578 | To see which functions are being traced, you can cat the file: | 1629 | To see which functions are being traced, you can cat the file: |
1579 | 1630 | ||
1580 | # cat /debug/tracing/set_ftrace_filter | 1631 | # cat set_ftrace_filter |
1581 | hrtimer_interrupt | 1632 | hrtimer_interrupt |
1582 | sys_nanosleep | 1633 | sys_nanosleep |
1583 | 1634 | ||
@@ -1597,7 +1648,7 @@ Note: It is better to use quotes to enclose the wild cards, | |||
1597 | otherwise the shell may expand the parameters into names | 1648 | otherwise the shell may expand the parameters into names |
1598 | of files in the local directory. | 1649 | of files in the local directory. |
1599 | 1650 | ||
1600 | # echo 'hrtimer_*' > /debug/tracing/set_ftrace_filter | 1651 | # echo 'hrtimer_*' > set_ftrace_filter |
1601 | 1652 | ||
1602 | Produces: | 1653 | Produces: |
1603 | 1654 | ||
@@ -1618,7 +1669,7 @@ Produces: | |||
1618 | 1669 | ||
1619 | Notice that we lost the sys_nanosleep. | 1670 | Notice that we lost the sys_nanosleep. |
1620 | 1671 | ||
1621 | # cat /debug/tracing/set_ftrace_filter | 1672 | # cat set_ftrace_filter |
1622 | hrtimer_run_queues | 1673 | hrtimer_run_queues |
1623 | hrtimer_run_pending | 1674 | hrtimer_run_pending |
1624 | hrtimer_init | 1675 | hrtimer_init |
@@ -1644,17 +1695,17 @@ To append to the filters, use '>>' | |||
1644 | To clear out a filter so that all functions will be recorded | 1695 | To clear out a filter so that all functions will be recorded |
1645 | again: | 1696 | again: |
1646 | 1697 | ||
1647 | # echo > /debug/tracing/set_ftrace_filter | 1698 | # echo > set_ftrace_filter |
1648 | # cat /debug/tracing/set_ftrace_filter | 1699 | # cat set_ftrace_filter |
1649 | # | 1700 | # |
1650 | 1701 | ||
1651 | Again, now we want to append. | 1702 | Again, now we want to append. |
1652 | 1703 | ||
1653 | # echo sys_nanosleep > /debug/tracing/set_ftrace_filter | 1704 | # echo sys_nanosleep > set_ftrace_filter |
1654 | # cat /debug/tracing/set_ftrace_filter | 1705 | # cat set_ftrace_filter |
1655 | sys_nanosleep | 1706 | sys_nanosleep |
1656 | # echo 'hrtimer_*' >> /debug/tracing/set_ftrace_filter | 1707 | # echo 'hrtimer_*' >> set_ftrace_filter |
1657 | # cat /debug/tracing/set_ftrace_filter | 1708 | # cat set_ftrace_filter |
1658 | hrtimer_run_queues | 1709 | hrtimer_run_queues |
1659 | hrtimer_run_pending | 1710 | hrtimer_run_pending |
1660 | hrtimer_init | 1711 | hrtimer_init |
@@ -1677,7 +1728,7 @@ hrtimer_init_sleeper | |||
1677 | The set_ftrace_notrace prevents those functions from being | 1728 | The set_ftrace_notrace prevents those functions from being |
1678 | traced. | 1729 | traced. |
1679 | 1730 | ||
1680 | # echo '*preempt*' '*lock*' > /debug/tracing/set_ftrace_notrace | 1731 | # echo '*preempt*' '*lock*' > set_ftrace_notrace |
1681 | 1732 | ||
1682 | Produces: | 1733 | Produces: |
1683 | 1734 | ||
@@ -1767,13 +1818,13 @@ the effect on the tracing is different. Every read from | |||
1767 | trace_pipe is consumed. This means that subsequent reads will be | 1818 | trace_pipe is consumed. This means that subsequent reads will be |
1768 | different. The trace is live. | 1819 | different. The trace is live. |
1769 | 1820 | ||
1770 | # echo function > /debug/tracing/current_tracer | 1821 | # echo function > current_tracer |
1771 | # cat /debug/tracing/trace_pipe > /tmp/trace.out & | 1822 | # cat trace_pipe > /tmp/trace.out & |
1772 | [1] 4153 | 1823 | [1] 4153 |
1773 | # echo 1 > /debug/tracing/tracing_enabled | 1824 | # echo 1 > tracing_enabled |
1774 | # usleep 1 | 1825 | # usleep 1 |
1775 | # echo 0 > /debug/tracing/tracing_enabled | 1826 | # echo 0 > tracing_enabled |
1776 | # cat /debug/tracing/trace | 1827 | # cat trace |
1777 | # tracer: function | 1828 | # tracer: function |
1778 | # | 1829 | # |
1779 | # TASK-PID CPU# TIMESTAMP FUNCTION | 1830 | # TASK-PID CPU# TIMESTAMP FUNCTION |
@@ -1809,7 +1860,7 @@ number listed is the number of entries that can be recorded per | |||
1809 | CPU. To know the full size, multiply the number of possible CPUS | 1860 | CPU. To know the full size, multiply the number of possible CPUS |
1810 | with the number of entries. | 1861 | with the number of entries. |
1811 | 1862 | ||
1812 | # cat /debug/tracing/buffer_size_kb | 1863 | # cat buffer_size_kb |
1813 | 1408 (units kilobytes) | 1864 | 1408 (units kilobytes) |
1814 | 1865 | ||
1815 | Note, to modify this, you must have tracing completely disabled. | 1866 | Note, to modify this, you must have tracing completely disabled. |
@@ -1817,18 +1868,18 @@ To do that, echo "nop" into the current_tracer. If the | |||
1817 | current_tracer is not set to "nop", an EINVAL error will be | 1868 | current_tracer is not set to "nop", an EINVAL error will be |
1818 | returned. | 1869 | returned. |
1819 | 1870 | ||
1820 | # echo nop > /debug/tracing/current_tracer | 1871 | # echo nop > current_tracer |
1821 | # echo 10000 > /debug/tracing/buffer_size_kb | 1872 | # echo 10000 > buffer_size_kb |
1822 | # cat /debug/tracing/buffer_size_kb | 1873 | # cat buffer_size_kb |
1823 | 10000 (units kilobytes) | 1874 | 10000 (units kilobytes) |
1824 | 1875 | ||
1825 | The number of pages which will be allocated is limited to a | 1876 | The number of pages which will be allocated is limited to a |
1826 | percentage of available memory. Allocating too much will produce | 1877 | percentage of available memory. Allocating too much will produce |
1827 | an error. | 1878 | an error. |
1828 | 1879 | ||
1829 | # echo 1000000000000 > /debug/tracing/buffer_size_kb | 1880 | # echo 1000000000000 > buffer_size_kb |
1830 | -bash: echo: write error: Cannot allocate memory | 1881 | -bash: echo: write error: Cannot allocate memory |
1831 | # cat /debug/tracing/buffer_size_kb | 1882 | # cat buffer_size_kb |
1832 | 85 | 1883 | 85 |
1833 | 1884 | ||
1834 | ----------- | 1885 | ----------- |
diff --git a/Documentation/trace/mmiotrace.txt b/Documentation/trace/mmiotrace.txt index 5731c67abc55..162effbfbdec 100644 --- a/Documentation/trace/mmiotrace.txt +++ b/Documentation/trace/mmiotrace.txt | |||
@@ -32,41 +32,41 @@ is no way to automatically detect if you are losing events due to CPUs racing. | |||
32 | Usage Quick Reference | 32 | Usage Quick Reference |
33 | --------------------- | 33 | --------------------- |
34 | 34 | ||
35 | $ mount -t debugfs debugfs /debug | 35 | $ mount -t debugfs debugfs /sys/kernel/debug |
36 | $ echo mmiotrace > /debug/tracing/current_tracer | 36 | $ echo mmiotrace > /sys/kernel/debug/tracing/current_tracer |
37 | $ cat /debug/tracing/trace_pipe > mydump.txt & | 37 | $ cat /sys/kernel/debug/tracing/trace_pipe > mydump.txt & |
38 | Start X or whatever. | 38 | Start X or whatever. |
39 | $ echo "X is up" > /debug/tracing/trace_marker | 39 | $ echo "X is up" > /sys/kernel/debug/tracing/trace_marker |
40 | $ echo nop > /debug/tracing/current_tracer | 40 | $ echo nop > /sys/kernel/debug/tracing/current_tracer |
41 | Check for lost events. | 41 | Check for lost events. |
42 | 42 | ||
43 | 43 | ||
44 | Usage | 44 | Usage |
45 | ----- | 45 | ----- |
46 | 46 | ||
47 | Make sure debugfs is mounted to /debug. If not, (requires root privileges) | 47 | Make sure debugfs is mounted to /sys/kernel/debug. If not, (requires root privileges) |
48 | $ mount -t debugfs debugfs /debug | 48 | $ mount -t debugfs debugfs /sys/kernel/debug |
49 | 49 | ||
50 | Check that the driver you are about to trace is not loaded. | 50 | Check that the driver you are about to trace is not loaded. |
51 | 51 | ||
52 | Activate mmiotrace (requires root privileges): | 52 | Activate mmiotrace (requires root privileges): |
53 | $ echo mmiotrace > /debug/tracing/current_tracer | 53 | $ echo mmiotrace > /sys/kernel/debug/tracing/current_tracer |
54 | 54 | ||
55 | Start storing the trace: | 55 | Start storing the trace: |
56 | $ cat /debug/tracing/trace_pipe > mydump.txt & | 56 | $ cat /sys/kernel/debug/tracing/trace_pipe > mydump.txt & |
57 | The 'cat' process should stay running (sleeping) in the background. | 57 | The 'cat' process should stay running (sleeping) in the background. |
58 | 58 | ||
59 | Load the driver you want to trace and use it. Mmiotrace will only catch MMIO | 59 | Load the driver you want to trace and use it. Mmiotrace will only catch MMIO |
60 | accesses to areas that are ioremapped while mmiotrace is active. | 60 | accesses to areas that are ioremapped while mmiotrace is active. |
61 | 61 | ||
62 | During tracing you can place comments (markers) into the trace by | 62 | During tracing you can place comments (markers) into the trace by |
63 | $ echo "X is up" > /debug/tracing/trace_marker | 63 | $ echo "X is up" > /sys/kernel/debug/tracing/trace_marker |
64 | This makes it easier to see which part of the (huge) trace corresponds to | 64 | This makes it easier to see which part of the (huge) trace corresponds to |
65 | which action. It is recommended to place descriptive markers about what you | 65 | which action. It is recommended to place descriptive markers about what you |
66 | do. | 66 | do. |
67 | 67 | ||
68 | Shut down mmiotrace (requires root privileges): | 68 | Shut down mmiotrace (requires root privileges): |
69 | $ echo nop > /debug/tracing/current_tracer | 69 | $ echo nop > /sys/kernel/debug/tracing/current_tracer |
70 | The 'cat' process exits. If it does not, kill it by issuing 'fg' command and | 70 | The 'cat' process exits. If it does not, kill it by issuing 'fg' command and |
71 | pressing ctrl+c. | 71 | pressing ctrl+c. |
72 | 72 | ||
@@ -78,10 +78,10 @@ to view your kernel log and look for "mmiotrace has lost events" warning. If | |||
78 | events were lost, the trace is incomplete. You should enlarge the buffers and | 78 | events were lost, the trace is incomplete. You should enlarge the buffers and |
79 | try again. Buffers are enlarged by first seeing how large the current buffers | 79 | try again. Buffers are enlarged by first seeing how large the current buffers |
80 | are: | 80 | are: |
81 | $ cat /debug/tracing/buffer_size_kb | 81 | $ cat /sys/kernel/debug/tracing/buffer_size_kb |
82 | gives you a number. Approximately double this number and write it back, for | 82 | gives you a number. Approximately double this number and write it back, for |
83 | instance: | 83 | instance: |
84 | $ echo 128000 > /debug/tracing/buffer_size_kb | 84 | $ echo 128000 > /sys/kernel/debug/tracing/buffer_size_kb |
85 | Then start again from the top. | 85 | Then start again from the top. |
86 | 86 | ||
87 | If you are doing a trace for a driver project, e.g. Nouveau, you should also | 87 | If you are doing a trace for a driver project, e.g. Nouveau, you should also |
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 37e0f81cada2..83650e00632d 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -430,7 +430,7 @@ static void pkt_sysfs_cleanup(void) | |||
430 | /******************************************************************** | 430 | /******************************************************************** |
431 | entries in debugfs | 431 | entries in debugfs |
432 | 432 | ||
433 | /debugfs/pktcdvd[0-7]/ | 433 | /sys/kernel/debug/pktcdvd[0-7]/ |
434 | info | 434 | info |
435 | 435 | ||
436 | *******************************************************************/ | 436 | *******************************************************************/ |
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index c77c6c6d9d2c..6ce0e2667a85 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c | |||
@@ -105,7 +105,7 @@ int drm_debugfs_create_files(struct drm_info_list *files, int count, | |||
105 | ent = debugfs_create_file(files[i].name, S_IFREG | S_IRUGO, | 105 | ent = debugfs_create_file(files[i].name, S_IFREG | S_IRUGO, |
106 | root, tmp, &drm_debugfs_fops); | 106 | root, tmp, &drm_debugfs_fops); |
107 | if (!ent) { | 107 | if (!ent) { |
108 | DRM_ERROR("Cannot create /debugfs/dri/%s/%s\n", | 108 | DRM_ERROR("Cannot create /sys/kernel/debug/dri/%s/%s\n", |
109 | name, files[i].name); | 109 | name, files[i].name); |
110 | drm_free(tmp, sizeof(struct drm_info_node), | 110 | drm_free(tmp, sizeof(struct drm_info_node), |
111 | _DRM_DRIVER); | 111 | _DRM_DRIVER); |
@@ -133,9 +133,9 @@ EXPORT_SYMBOL(drm_debugfs_create_files); | |||
133 | * \param minor device minor number | 133 | * \param minor device minor number |
134 | * \param root DRI debugfs dir entry. | 134 | * \param root DRI debugfs dir entry. |
135 | * | 135 | * |
136 | * Create the DRI debugfs root entry "/debugfs/dri", the device debugfs root entry | 136 | * Create the DRI debugfs root entry "/sys/kernel/debug/dri", the device debugfs root entry |
137 | * "/debugfs/dri/%minor%/", and each entry in debugfs_list as | 137 | * "/sys/kernel/debug/dri/%minor%/", and each entry in debugfs_list as |
138 | * "/debugfs/dri/%minor%/%name%". | 138 | * "/sys/kernel/debug/dri/%minor%/%name%". |
139 | */ | 139 | */ |
140 | int drm_debugfs_init(struct drm_minor *minor, int minor_id, | 140 | int drm_debugfs_init(struct drm_minor *minor, int minor_id, |
141 | struct dentry *root) | 141 | struct dentry *root) |
@@ -148,7 +148,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id, | |||
148 | sprintf(name, "%d", minor_id); | 148 | sprintf(name, "%d", minor_id); |
149 | minor->debugfs_root = debugfs_create_dir(name, root); | 149 | minor->debugfs_root = debugfs_create_dir(name, root); |
150 | if (!minor->debugfs_root) { | 150 | if (!minor->debugfs_root) { |
151 | DRM_ERROR("Cannot create /debugfs/dri/%s\n", name); | 151 | DRM_ERROR("Cannot create /sys/kernel/debug/dri/%s\n", name); |
152 | return -1; | 152 | return -1; |
153 | } | 153 | } |
154 | 154 | ||
@@ -165,7 +165,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id, | |||
165 | ret = dev->driver->debugfs_init(minor); | 165 | ret = dev->driver->debugfs_init(minor); |
166 | if (ret) { | 166 | if (ret) { |
167 | DRM_ERROR("DRM: Driver failed to initialize " | 167 | DRM_ERROR("DRM: Driver failed to initialize " |
168 | "/debugfs/dri.\n"); | 168 | "/sys/kernel/debug/dri.\n"); |
169 | return ret; | 169 | return ret; |
170 | } | 170 | } |
171 | } | 171 | } |
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 019b7c578236..1bf7efd8d334 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c | |||
@@ -339,7 +339,7 @@ static int __init drm_core_init(void) | |||
339 | 339 | ||
340 | drm_debugfs_root = debugfs_create_dir("dri", NULL); | 340 | drm_debugfs_root = debugfs_create_dir("dri", NULL); |
341 | if (!drm_debugfs_root) { | 341 | if (!drm_debugfs_root) { |
342 | DRM_ERROR("Cannot create /debugfs/dri\n"); | 342 | DRM_ERROR("Cannot create /sys/kernel/debug/dri\n"); |
343 | ret = -1; | 343 | ret = -1; |
344 | goto err_p3; | 344 | goto err_p3; |
345 | } | 345 | } |
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 89050684fe0d..387a8de1bc7e 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c | |||
@@ -343,7 +343,7 @@ static int drm_get_minor(struct drm_device *dev, struct drm_minor **minor, int t | |||
343 | #if defined(CONFIG_DEBUG_FS) | 343 | #if defined(CONFIG_DEBUG_FS) |
344 | ret = drm_debugfs_init(new_minor, minor_id, drm_debugfs_root); | 344 | ret = drm_debugfs_init(new_minor, minor_id, drm_debugfs_root); |
345 | if (ret) { | 345 | if (ret) { |
346 | DRM_ERROR("DRM: Failed to initialize /debugfs/dri.\n"); | 346 | DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n"); |
347 | goto err_g2; | 347 | goto err_g2; |
348 | } | 348 | } |
349 | #endif | 349 | #endif |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 01f282cd0989..3b6383168c69 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -2206,7 +2206,7 @@ config SKGE_DEBUG | |||
2206 | depends on SKGE && DEBUG_FS | 2206 | depends on SKGE && DEBUG_FS |
2207 | help | 2207 | help |
2208 | This option adds the ability to dump driver state for debugging. | 2208 | This option adds the ability to dump driver state for debugging. |
2209 | The file debugfs/skge/ethX displays the state of the internal | 2209 | The file /sys/kernel/debug/skge/ethX displays the state of the internal |
2210 | transmit and receive rings. | 2210 | transmit and receive rings. |
2211 | 2211 | ||
2212 | If unsure, say N. | 2212 | If unsure, say N. |
@@ -2232,7 +2232,7 @@ config SKY2_DEBUG | |||
2232 | depends on SKY2 && DEBUG_FS | 2232 | depends on SKY2 && DEBUG_FS |
2233 | help | 2233 | help |
2234 | This option adds the ability to dump driver state for debugging. | 2234 | This option adds the ability to dump driver state for debugging. |
2235 | The file debugfs/sky2/ethX displays the state of the internal | 2235 | The file /sys/kernel/debug/sky2/ethX displays the state of the internal |
2236 | transmit and receive rings. | 2236 | transmit and receive rings. |
2237 | 2237 | ||
2238 | If unsure, say N. | 2238 | If unsure, say N. |
diff --git a/drivers/net/wimax/i2400m/i2400m.h b/drivers/net/wimax/i2400m/i2400m.h index 1fe5da4cf0a0..60330f313f27 100644 --- a/drivers/net/wimax/i2400m/i2400m.h +++ b/drivers/net/wimax/i2400m/i2400m.h | |||
@@ -432,7 +432,7 @@ struct i2400m { | |||
432 | unsigned ready:1; /* all probing steps done */ | 432 | unsigned ready:1; /* all probing steps done */ |
433 | unsigned rx_reorder:1; /* RX reorder is enabled */ | 433 | unsigned rx_reorder:1; /* RX reorder is enabled */ |
434 | u8 trace_msg_from_user; /* echo rx msgs to 'trace' pipe */ | 434 | u8 trace_msg_from_user; /* echo rx msgs to 'trace' pipe */ |
435 | /* typed u8 so debugfs/u8 can tweak */ | 435 | /* typed u8 so /sys/kernel/debug/u8 can tweak */ |
436 | enum i2400m_system_state state; | 436 | enum i2400m_system_state state; |
437 | wait_queue_head_t state_wq; /* Woken up when on state updates */ | 437 | wait_queue_head_t state_wq; /* Woken up when on state updates */ |
438 | 438 | ||
diff --git a/drivers/net/wireless/ath/ath5k/Kconfig b/drivers/net/wireless/ath/ath5k/Kconfig index 509b6f94f73b..daf0c83527d8 100644 --- a/drivers/net/wireless/ath/ath5k/Kconfig +++ b/drivers/net/wireless/ath/ath5k/Kconfig | |||
@@ -28,11 +28,10 @@ config ATH5K_DEBUG | |||
28 | Say Y, if and you will get debug options for ath5k. | 28 | Say Y, if and you will get debug options for ath5k. |
29 | To use this, you need to mount debugfs: | 29 | To use this, you need to mount debugfs: |
30 | 30 | ||
31 | mkdir /debug/ | 31 | mount -t debugfs debug /sys/kernel/debug |
32 | mount -t debugfs debug /debug/ | ||
33 | 32 | ||
34 | You will get access to files under: | 33 | You will get access to files under: |
35 | /debug/ath5k/phy0/ | 34 | /sys/kernel/debug/ath5k/phy0/ |
36 | 35 | ||
37 | To enable debug, pass the debug level to the debug module | 36 | To enable debug, pass the debug level to the debug module |
38 | parameter. For example: | 37 | parameter. For example: |
diff --git a/drivers/net/wireless/libertas/README b/drivers/net/wireless/libertas/README index d860fc375752..ab6a2d518af0 100644 --- a/drivers/net/wireless/libertas/README +++ b/drivers/net/wireless/libertas/README | |||
@@ -72,7 +72,7 @@ rdrf | |||
72 | location that is to be read. This parameter must be specified in | 72 | location that is to be read. This parameter must be specified in |
73 | hexadecimal (its possible to preceed preceding the number with a "0x"). | 73 | hexadecimal (its possible to preceed preceding the number with a "0x"). |
74 | 74 | ||
75 | Path: /debugfs/libertas_wireless/ethX/registers/ | 75 | Path: /sys/kernel/debug/libertas_wireless/ethX/registers/ |
76 | 76 | ||
77 | Usage: | 77 | Usage: |
78 | echo "0xa123" > rdmac ; cat rdmac | 78 | echo "0xa123" > rdmac ; cat rdmac |
@@ -95,7 +95,7 @@ wrrf | |||
95 | sleepparams | 95 | sleepparams |
96 | This command is used to set the sleepclock configurations | 96 | This command is used to set the sleepclock configurations |
97 | 97 | ||
98 | Path: /debugfs/libertas_wireless/ethX/ | 98 | Path: /sys/kernel/debug/libertas_wireless/ethX/ |
99 | 99 | ||
100 | Usage: | 100 | Usage: |
101 | cat sleepparams: reads the current sleepclock configuration | 101 | cat sleepparams: reads the current sleepclock configuration |
@@ -115,7 +115,7 @@ subscribed_events | |||
115 | The subscribed_events directory contains the interface for the | 115 | The subscribed_events directory contains the interface for the |
116 | subscribed events API. | 116 | subscribed events API. |
117 | 117 | ||
118 | Path: /debugfs/libertas_wireless/ethX/subscribed_events/ | 118 | Path: /sys/kernel/debug/libertas_wireless/ethX/subscribed_events/ |
119 | 119 | ||
120 | Each event is represented by a filename. Each filename consists of the | 120 | Each event is represented by a filename. Each filename consists of the |
121 | following three fields: | 121 | following three fields: |
@@ -165,7 +165,7 @@ subscribed_events | |||
165 | extscan | 165 | extscan |
166 | This command is used to do a specific scan. | 166 | This command is used to do a specific scan. |
167 | 167 | ||
168 | Path: /debugfs/libertas_wireless/ethX/ | 168 | Path: /sys/kernel/debug/libertas_wireless/ethX/ |
169 | 169 | ||
170 | Usage: echo "SSID" > extscan | 170 | Usage: echo "SSID" > extscan |
171 | 171 | ||
@@ -179,7 +179,7 @@ getscantable | |||
179 | Display the current contents of the driver scan table (ie. get the | 179 | Display the current contents of the driver scan table (ie. get the |
180 | scan results). | 180 | scan results). |
181 | 181 | ||
182 | Path: /debugfs/libertas_wireless/ethX/ | 182 | Path: /sys/kernel/debug/libertas_wireless/ethX/ |
183 | 183 | ||
184 | Usage: | 184 | Usage: |
185 | cat getscantable | 185 | cat getscantable |
@@ -188,7 +188,7 @@ setuserscan | |||
188 | Initiate a customized scan and retrieve the results | 188 | Initiate a customized scan and retrieve the results |
189 | 189 | ||
190 | 190 | ||
191 | Path: /debugfs/libertas_wireless/ethX/ | 191 | Path: /sys/kernel/debug/libertas_wireless/ethX/ |
192 | 192 | ||
193 | Usage: | 193 | Usage: |
194 | echo "[ARGS]" > setuserscan | 194 | echo "[ARGS]" > setuserscan |
diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c index 2b02b1fb39a0..8d0f0de76b63 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c | |||
@@ -53,8 +53,7 @@ | |||
53 | * debugfs interface | 53 | * debugfs interface |
54 | * | 54 | * |
55 | * To access this interface the user should: | 55 | * To access this interface the user should: |
56 | * # mkdir /debug | 56 | * # mount -t debugfs none /sys/kernel/debug |
57 | * # mount -t debugfs none /debug | ||
58 | * | 57 | * |
59 | * The lpfc debugfs directory hierarchy is: | 58 | * The lpfc debugfs directory hierarchy is: |
60 | * lpfc/lpfcX/vportY | 59 | * lpfc/lpfcX/vportY |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 883cd44ff765..99b7aada28da 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -406,7 +406,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
406 | * | 406 | * |
407 | * Use tracing_on/tracing_off when you want to quickly turn on or off | 407 | * Use tracing_on/tracing_off when you want to quickly turn on or off |
408 | * tracing. It simply enables or disables the recording of the trace events. | 408 | * tracing. It simply enables or disables the recording of the trace events. |
409 | * This also corresponds to the user space debugfs/tracing/tracing_on | 409 | * This also corresponds to the user space /sys/kernel/debug/tracing/tracing_on |
410 | * file, which gives a means for the kernel and userspace to interact. | 410 | * file, which gives a means for the kernel and userspace to interact. |
411 | * Place a tracing_off() in the kernel where you want tracing to end. | 411 | * Place a tracing_off() in the kernel where you want tracing to end. |
412 | * From user space, examine the trace, and then echo 1 > tracing_on | 412 | * From user space, examine the trace, and then echo 1 > tracing_on |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 14df7e635d43..b9dc4ca0246f 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -198,7 +198,7 @@ static inline void tracepoint_synchronize_unregister(void) | |||
198 | * * This is how the trace record is structured and will | 198 | * * This is how the trace record is structured and will |
199 | * * be saved into the ring buffer. These are the fields | 199 | * * be saved into the ring buffer. These are the fields |
200 | * * that will be exposed to user-space in | 200 | * * that will be exposed to user-space in |
201 | * * /debug/tracing/events/<*>/format. | 201 | * * /sys/kernel/debug/tracing/events/<*>/format. |
202 | * * | 202 | * * |
203 | * * The declared 'local variable' is called '__entry' | 203 | * * The declared 'local variable' is called '__entry' |
204 | * * | 204 | * * |
@@ -258,7 +258,7 @@ static inline void tracepoint_synchronize_unregister(void) | |||
258 | * tracepoint callback (this is used by programmatic plugins and | 258 | * tracepoint callback (this is used by programmatic plugins and |
259 | * can also by used by generic instrumentation like SystemTap), and | 259 | * can also by used by generic instrumentation like SystemTap), and |
260 | * it is also used to expose a structured trace record in | 260 | * it is also used to expose a structured trace record in |
261 | * /debug/tracing/events/. | 261 | * /sys/kernel/debug/tracing/events/. |
262 | */ | 262 | */ |
263 | 263 | ||
264 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ | 264 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ |
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 4a13e5a01ce3..61071fecc82e 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig | |||
@@ -147,7 +147,7 @@ config IRQSOFF_TRACER | |||
147 | disabled by default and can be runtime (re-)started | 147 | disabled by default and can be runtime (re-)started |
148 | via: | 148 | via: |
149 | 149 | ||
150 | echo 0 > /debugfs/tracing/tracing_max_latency | 150 | echo 0 > /sys/kernel/debug/tracing/tracing_max_latency |
151 | 151 | ||
152 | (Note that kernel size and overhead increases with this option | 152 | (Note that kernel size and overhead increases with this option |
153 | enabled. This option and the preempt-off timing option can be | 153 | enabled. This option and the preempt-off timing option can be |
@@ -168,7 +168,7 @@ config PREEMPT_TRACER | |||
168 | disabled by default and can be runtime (re-)started | 168 | disabled by default and can be runtime (re-)started |
169 | via: | 169 | via: |
170 | 170 | ||
171 | echo 0 > /debugfs/tracing/tracing_max_latency | 171 | echo 0 > /sys/kernel/debug/tracing/tracing_max_latency |
172 | 172 | ||
173 | (Note that kernel size and overhead increases with this option | 173 | (Note that kernel size and overhead increases with this option |
174 | enabled. This option and the irqs-off timing option can be | 174 | enabled. This option and the irqs-off timing option can be |
@@ -261,7 +261,7 @@ config PROFILE_ANNOTATED_BRANCHES | |||
261 | This tracer profiles all the the likely and unlikely macros | 261 | This tracer profiles all the the likely and unlikely macros |
262 | in the kernel. It will display the results in: | 262 | in the kernel. It will display the results in: |
263 | 263 | ||
264 | /debugfs/tracing/profile_annotated_branch | 264 | /sys/kernel/debug/tracing/profile_annotated_branch |
265 | 265 | ||
266 | Note: this will add a significant overhead, only turn this | 266 | Note: this will add a significant overhead, only turn this |
267 | on if you need to profile the system's use of these macros. | 267 | on if you need to profile the system's use of these macros. |
@@ -274,7 +274,7 @@ config PROFILE_ALL_BRANCHES | |||
274 | taken in the kernel is recorded whether it hit or miss. | 274 | taken in the kernel is recorded whether it hit or miss. |
275 | The results will be displayed in: | 275 | The results will be displayed in: |
276 | 276 | ||
277 | /debugfs/tracing/profile_branch | 277 | /sys/kernel/debug/tracing/profile_branch |
278 | 278 | ||
279 | This option also enables the likely/unlikely profiler. | 279 | This option also enables the likely/unlikely profiler. |
280 | 280 | ||
@@ -323,7 +323,7 @@ config STACK_TRACER | |||
323 | select KALLSYMS | 323 | select KALLSYMS |
324 | help | 324 | help |
325 | This special tracer records the maximum stack footprint of the | 325 | This special tracer records the maximum stack footprint of the |
326 | kernel and displays it in debugfs/tracing/stack_trace. | 326 | kernel and displays it in /sys/kernel/debug/tracing/stack_trace. |
327 | 327 | ||
328 | This tracer works by hooking into every function call that the | 328 | This tracer works by hooking into every function call that the |
329 | kernel executes, and keeping a maximum stack depth value and | 329 | kernel executes, and keeping a maximum stack depth value and |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 8acd9b81a5d7..c1878bfb2e1e 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -344,7 +344,7 @@ static raw_spinlock_t ftrace_max_lock = | |||
344 | /* | 344 | /* |
345 | * Copy the new maximum trace into the separate maximum-trace | 345 | * Copy the new maximum trace into the separate maximum-trace |
346 | * structure. (this way the maximum trace is permanently saved, | 346 | * structure. (this way the maximum trace is permanently saved, |
347 | * for later retrieval via /debugfs/tracing/latency_trace) | 347 | * for later retrieval via /sys/kernel/debug/tracing/latency_trace) |
348 | */ | 348 | */ |
349 | static void | 349 | static void |
350 | __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu) | 350 | __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu) |
@@ -2414,21 +2414,20 @@ static const struct file_operations tracing_iter_fops = { | |||
2414 | 2414 | ||
2415 | static const char readme_msg[] = | 2415 | static const char readme_msg[] = |
2416 | "tracing mini-HOWTO:\n\n" | 2416 | "tracing mini-HOWTO:\n\n" |
2417 | "# mkdir /debug\n" | 2417 | "# mount -t debugfs nodev /sys/kernel/debug\n\n" |
2418 | "# mount -t debugfs nodev /debug\n\n" | 2418 | "# cat /sys/kernel/debug/tracing/available_tracers\n" |
2419 | "# cat /debug/tracing/available_tracers\n" | ||
2420 | "wakeup preemptirqsoff preemptoff irqsoff function sched_switch nop\n\n" | 2419 | "wakeup preemptirqsoff preemptoff irqsoff function sched_switch nop\n\n" |
2421 | "# cat /debug/tracing/current_tracer\n" | 2420 | "# cat /sys/kernel/debug/tracing/current_tracer\n" |
2422 | "nop\n" | 2421 | "nop\n" |
2423 | "# echo sched_switch > /debug/tracing/current_tracer\n" | 2422 | "# echo sched_switch > /sys/kernel/debug/tracing/current_tracer\n" |
2424 | "# cat /debug/tracing/current_tracer\n" | 2423 | "# cat /sys/kernel/debug/tracing/current_tracer\n" |
2425 | "sched_switch\n" | 2424 | "sched_switch\n" |
2426 | "# cat /debug/tracing/trace_options\n" | 2425 | "# cat /sys/kernel/debug/tracing/trace_options\n" |
2427 | "noprint-parent nosym-offset nosym-addr noverbose\n" | 2426 | "noprint-parent nosym-offset nosym-addr noverbose\n" |
2428 | "# echo print-parent > /debug/tracing/trace_options\n" | 2427 | "# echo print-parent > /sys/kernel/debug/tracing/trace_options\n" |
2429 | "# echo 1 > /debug/tracing/tracing_enabled\n" | 2428 | "# echo 1 > /sys/kernel/debug/tracing/tracing_enabled\n" |
2430 | "# cat /debug/tracing/trace > /tmp/trace.txt\n" | 2429 | "# cat /sys/kernel/debug/tracing/trace > /tmp/trace.txt\n" |
2431 | "# echo 0 > /debug/tracing/tracing_enabled\n" | 2430 | "# echo 0 > /sys/kernel/debug/tracing/tracing_enabled\n" |
2432 | ; | 2431 | ; |
2433 | 2432 | ||
2434 | static ssize_t | 2433 | static ssize_t |
diff --git a/scripts/tracing/draw_functrace.py b/scripts/tracing/draw_functrace.py index 902f9a992620..db40fa04cd51 100644 --- a/scripts/tracing/draw_functrace.py +++ b/scripts/tracing/draw_functrace.py | |||
@@ -12,10 +12,9 @@ calls. Only the functions's names and the the call time are provided. | |||
12 | 12 | ||
13 | Usage: | 13 | Usage: |
14 | Be sure that you have CONFIG_FUNCTION_TRACER | 14 | Be sure that you have CONFIG_FUNCTION_TRACER |
15 | # mkdir /debugfs | 15 | # mount -t debugfs nodev /sys/kernel/debug |
16 | # mount -t debug debug /debug | 16 | # echo function > /sys/kernel/debug/tracing/current_tracer |
17 | # echo function > /debug/tracing/current_tracer | 17 | $ cat /sys/kernel/debug/tracing/trace_pipe > ~/raw_trace_func |
18 | $ cat /debug/tracing/trace_pipe > ~/raw_trace_func | ||
19 | Wait some times but not too much, the script is a bit slow. | 18 | Wait some times but not too much, the script is a bit slow. |
20 | Break the pipe (Ctrl + Z) | 19 | Break the pipe (Ctrl + Z) |
21 | $ scripts/draw_functrace.py < raw_trace_func > draw_functrace | 20 | $ scripts/draw_functrace.py < raw_trace_func > draw_functrace |