]> git.baikalelectronics.ru Git - kernel.git/commit
dynamic_debug: add trim_prefix() to provide source-root relative paths
authorJim Cromie <jim.cromie@gmail.com>
Mon, 19 Dec 2011 22:13:12 +0000 (17:13 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 24 Jan 2012 20:48:55 +0000 (12:48 -0800)
commit47ff819f5eca9e8077768b15bbbe7f94932d5196
tree3227bbc5c9c187b6dbaa133a6f7e2e4364942594
parent658c04fcc8271ecf8e3fb73dc78c02df46764b5a
dynamic_debug: add trim_prefix() to provide source-root relative paths

trim_prefix(path) skips past the absolute source path root, and
returns the pointer to the relative path from there.  It is used to
shorten the displayed path in $DBGMT/dynamic_debug/control via
ddebug_proc_show(), and in ddebug_change() to allow relative filenames
to be used in applied queries.  For example:

  ~# echo file kernel/freezer.c +p > $DBGMT/dynamic_debug/control

  kernel/freezer.c:128 [freezer]cancel_freezing p "  clean up: %s\012"

trim_prefix(path) insures common prefix before trimming it, so
out-of-tree module paths are shown as full absolute paths.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Documentation/dynamic-debug-howto.txt
lib/dynamic_debug.c