diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2009-06-26 12:38:27 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2009-06-26 12:38:27 -0400 |
commit | 4698c1f2bbe44ce852ef1a6716973c1f5401a4c4 (patch) | |
tree | 9ca3be2353d3757e2926689351eff2bb09aaf6f7 /Documentation | |
parent | bab4a34afc301fdb81b6ea0e3098d96fc356e03a (diff) |
kmemleak: Do not trigger a scan when reading the debug/kmemleak file
Since there is a kernel thread for automatically scanning the memory, it
makes sense for the debug/kmemleak file to only show its findings. This
patch also adds support for "echo scan > debug/kmemleak" to trigger an
intermediate memory scan and eliminates the kmemleak_mutex (scan_mutex
covers all the cases now).
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/kmemleak.txt | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Documentation/kmemleak.txt b/Documentation/kmemleak.txt index c06f7ba64993..89068030b01b 100644 --- a/Documentation/kmemleak.txt +++ b/Documentation/kmemleak.txt | |||
@@ -17,12 +17,16 @@ Usage | |||
17 | 17 | ||
18 | CONFIG_DEBUG_KMEMLEAK in "Kernel hacking" has to be enabled. A kernel | 18 | CONFIG_DEBUG_KMEMLEAK in "Kernel hacking" has to be enabled. A kernel |
19 | thread scans the memory every 10 minutes (by default) and prints the | 19 | thread scans the memory every 10 minutes (by default) and prints the |
20 | number of new unreferenced objects found. To trigger an intermediate | 20 | number of new unreferenced objects found. To display the details of all |
21 | scan and display the details of all the possible memory leaks: | 21 | the possible memory leaks: |
22 | 22 | ||
23 | # mount -t debugfs nodev /sys/kernel/debug/ | 23 | # mount -t debugfs nodev /sys/kernel/debug/ |
24 | # cat /sys/kernel/debug/kmemleak | 24 | # cat /sys/kernel/debug/kmemleak |
25 | 25 | ||
26 | To trigger an intermediate memory scan: | ||
27 | |||
28 | # echo scan > /sys/kernel/debug/kmemleak | ||
29 | |||
26 | Note that the orphan objects are listed in the order they were allocated | 30 | Note that the orphan objects are listed in the order they were allocated |
27 | and one object at the beginning of the list may cause other subsequent | 31 | and one object at the beginning of the list may cause other subsequent |
28 | objects to be reported as orphan. | 32 | objects to be reported as orphan. |
@@ -37,6 +41,7 @@ Memory scanning parameters can be modified at run-time by writing to the | |||
37 | scan=off - stop the automatic memory scanning thread | 41 | scan=off - stop the automatic memory scanning thread |
38 | scan=<secs> - set the automatic memory scanning period in seconds | 42 | scan=<secs> - set the automatic memory scanning period in seconds |
39 | (default 600, 0 to stop the automatic scanning) | 43 | (default 600, 0 to stop the automatic scanning) |
44 | scan - trigger a memory scan | ||
40 | 45 | ||
41 | Kmemleak can also be disabled at boot-time by passing "kmemleak=off" on | 46 | Kmemleak can also be disabled at boot-time by passing "kmemleak=off" on |
42 | the kernel command line. | 47 | the kernel command line. |