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>
This commit is contained in:
Jiri Olsa
2014-12-01 20:06:24 +01:00
committed by Arnaldo Carvalho de Melo
parent eec5a688f4
commit 99ce8e9fce
4 changed files with 22 additions and 6 deletions

View File

@@ -539,12 +539,14 @@ static void check_buildid_dir_config(void)
perf_config(buildid_dir_command_config, &c);
}
void set_buildid_dir(void)
void set_buildid_dir(const char *dir)
{
buildid_dir[0] = '\0';
if (dir)
scnprintf(buildid_dir, MAXPATHLEN-1, "%s", dir);
/* try config file */
check_buildid_dir_config();
if (buildid_dir[0] == '\0')
check_buildid_dir_config();
/* default to $HOME/.debug */
if (buildid_dir[0] == '\0') {