|author||Adrian Hunter <firstname.lastname@example.org>||2013-10-14 16:57:29 +0300|
|committer||Arnaldo Carvalho de Melo <email@example.com>||2013-10-14 12:20:38 -0300|
perf buildid-cache: Add ability to add kcore to the cache
kcore can be used to view the running kernel object code. However, kcore changes as modules are loaded and unloaded, and when the kernel decides to modify its own code. Consequently it is useful to create a copy of kcore at a particular time. Unlike vmlinux, kcore is not unique for a given build-id. And in addition, the kallsyms and modules files are also needed. The tool therefore creates a directory: ~/.debug/[kernel.kcore]/<build-id>/<YYYYmmddHHMMSShh> which contains: kcore, kallsyms and modules. Note that the copied kcore contains only code sections. See the kcore_copy() function for how that is determined. The tool will not make additional copies of kcore if there is already one with the same modules at the same addresses. Currently, perf tools will not look for kcore in the cache. That is addressed in another patch. Signed-off-by: Adrian Hunter <firstname.lastname@example.org> Cc: David Ahern <email@example.com> Cc: Frederic Weisbecker <firstname.lastname@example.org> Cc: Jiri Olsa <email@example.com> Cc: Mike Galbraith <firstname.lastname@example.org> Cc: Namhyung Kim <email@example.com> Cc: Paul Mackerras <firstname.lastname@example.org> Cc: Peter Zijlstra <email@example.com> Cc: Stephane Eranian <firstname.lastname@example.org> Link: http://lkml.kernel.org/r/525BF849.email@example.com [ renamed 'index' to 'idx' to avoid shadowing string.h symbol in f12, use at least one member initializer when initializing a struct to zeros, also to fix the build on f12 ] Signed-off-by: Arnaldo Carvalho de Melo <firstname.lastname@example.org>
Diffstat (limited to 'tools/perf/Documentation/perf-buildid-cache.txt')
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/perf/Documentation/perf-buildid-cache.txt b/tools/perf/Documentation/perf-buildid-cache.txt
index e9a8349a7172..fd77d81ea748 100644
@@ -21,6 +21,19 @@ OPTIONS
Add specified file to the cache.
+ Add specified kcore file to the cache. For the current host that is
+ /proc/kcore which requires root permissions to read. Be aware that
+ running 'perf buildid-cache' as root may update root's build-id cache
+ not the user's. Use the -v option to see where the file is created.
+ Note that the copied file contains only code sections not the whole core
+ image. Note also that files "kallsyms" and "modules" must also be in the
+ same directory and are also copied. All 3 files are created with read
+ permissions for root only. kcore will not be added if there is already a
+ kcore in the cache (with the same build-id) that has the same modules at
+ the same addresses. Use the -v option to see if a copy of kcore is
+ actually made.
Remove specified file from the cache.