Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf tools: Move get_current_dir_name() cond prototype out of util.h

And in a separate header, so that we erode util.h a bit more.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-xpzvuu9d0gei9jl9bkzgobln@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+12 -7
+3 -3
tools/perf/util/get_current_dir_name.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - // Copyright (C) 2018, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> 1 + // SPDX-License-Identifier: LGPL-2.1 2 + // Copyright (C) 2018, 2019 Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> 3 3 // 4 4 #ifndef HAVE_GET_CURRENT_DIR_NAME 5 - #include "util.h" 5 + #include "get_current_dir_name.h" 6 6 #include <unistd.h> 7 7 #include <stdlib.h> 8 8 #include <stdlib.h>
+8
tools/perf/util/get_current_dir_name.h
··· 1 + // SPDX-License-Identifier: LGPL-2.1 2 + // Copyright (C) 2018, 2019 Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> 3 + // 4 + #ifndef __PERF_GET_CURRENT_DIR_NAME_H 5 + #ifndef HAVE_GET_CURRENT_DIR_NAME 6 + char *get_current_dir_name(void); 7 + #endif // HAVE_GET_CURRENT_DIR_NAME 8 + #endif // __PERF_GET_CURRENT_DIR_NAME_H
+1
tools/perf/util/namespaces.c
··· 7 7 #include "namespaces.h" 8 8 #include "util.h" 9 9 #include "event.h" 10 + #include "get_current_dir_name.h" 10 11 #include <sys/types.h> 11 12 #include <sys/stat.h> 12 13 #include <fcntl.h>
-4
tools/perf/util/util.h
··· 59 59 60 60 const char *perf_tip(const char *dirpath); 61 61 62 - #ifndef HAVE_GET_CURRENT_DIR_NAME 63 - char *get_current_dir_name(void); 64 - #endif 65 - 66 62 #ifndef HAVE_SCHED_GETCPU_SUPPORT 67 63 int sched_getcpu(void); 68 64 #endif