diff options
author | Jiri Olsa <jolsa@kernel.org> | 2014-12-01 14:06:24 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-12-09 07:14:35 -0500 |
commit | 99ce8e9fce99147f865cda8a8e471900518c9a49 (patch) | |
tree | 3df52ba599da96ec305c0437c5324caee2359e8d /tools/perf/util/config.c | |
parent | eec5a688f426d6fe4097feb0b916ad41803d2ebb (diff) |
perf tools: Add --buildid-dir option to set cache directory
Adding --buildid-dir to be able to set specific cache directory. It's
going to be handy for buildid tests coming in shortly.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1417460789-13874-4-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/config.c')
-rw-r--r-- | tools/perf/util/config.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c index c802236b2bfe..e18f653cd7db 100644 --- a/tools/perf/util/config.c +++ b/tools/perf/util/config.c | |||
@@ -539,12 +539,14 @@ static void check_buildid_dir_config(void) | |||
539 | perf_config(buildid_dir_command_config, &c); | 539 | perf_config(buildid_dir_command_config, &c); |
540 | } | 540 | } |
541 | 541 | ||
542 | void set_buildid_dir(void) | 542 | void set_buildid_dir(const char *dir) |
543 | { | 543 | { |
544 | buildid_dir[0] = '\0'; | 544 | if (dir) |
545 | scnprintf(buildid_dir, MAXPATHLEN-1, "%s", dir); | ||
545 | 546 | ||
546 | /* try config file */ | 547 | /* try config file */ |
547 | check_buildid_dir_config(); | 548 | if (buildid_dir[0] == '\0') |
549 | check_buildid_dir_config(); | ||
548 | 550 | ||
549 | /* default to $HOME/.debug */ | 551 | /* default to $HOME/.debug */ |
550 | if (buildid_dir[0] == '\0') { | 552 | if (buildid_dir[0] == '\0') { |