perf probe: Expand given path to absolute path
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Thu, 26 Dec 2013 05:41:50 +0000 (05:41 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 26 Dec 2013 14:21:19 +0000 (11:21 -0300)
commit8a613d40e389b723fd5889ac8d4033ed4030be31
treee5a08d256507779bcee0d3ddc3d0819d35c9e8c1
parent56560ec692c142bb9ee404764e3b67999031ad19
perf probe: Expand given path to absolute path

Expand given path to absolute path in the option parser, except for a
module name.

Since realpath at later stage in processing several probe point, can be
called several times (even if currently doesn't, it can happen when we
expands the feature), it is waste of the performance.

Processing it once at the early stage can avoid that.

Changes from previous one:
 - Fix not to print null string.
 - Allocate memory for given path/module name everytime.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: "David A. Long" <dave.long@linaro.org>
Cc: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: systemtap@sourceware.org
Cc: yrl.pp-manager.tt@hitachi.com
Link: http://lkml.kernel.org/r/20131226054150.22364.12187.stgit@kbuild-fedora.novalocal
[ Clarified the pr_warning message as per David Ahern's suggestion ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-probe.c
tools/perf/util/probe-event.c