aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMichael Witten <mfwitten@gmail.com>2011-02-02 12:57:41 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-02-18 04:42:07 -0500
commit8796cb9d7dc028945af4b2ea858ae8f8f2ecbe8c (patch)
treef806c9c51e8099bca8277885ccde5e7b0ae07a61 /tools
parent006cdc32618e09ffe228a7a86af044f3cc0dd714 (diff)
perf tools: Makefile: Remove platform-specific cruft
While it makes sense that this tool could be used on other platforms at least to parse data, there doesn't appear to be any real support for such usage. This commit squashes several commits that remove: SNPRINTF_RETURNS_BOGUS FREAD_READS_DIRECTORIES NO_D_{INO,TYPE}_IN_DIRENT NO_STRCASESTR NO_MEMMEM NO_STRTOUMAX and NO_STRTOULL NO_SETENV NO_UNSETENV NO_MKDTEMP NEEDS_LIBICONV NEEDS_SOCKET NO_MMAP NO_PTHREADS NO_PREAD NO_TRUSTABLE_FILEMODE NO_IPV6 and NO_SOCKADDR_STORAGE NO_ICONV and OLD_ICONV NO_NSEC, USE_NSEC, and USE_ST_TIMESPEC NO_ST_BLOCKS_IN_STRUCT_STAT NO_FINK and NO_DARWIN_PORTS NO_SYS_SELECT_H NO_HSTRERROR DIR_HAS_BSD_GROUP_SEMANTICS and FORCE_DIR_SET_GID NEEDS_NSL, NO_UINTMAX_T, NO_INET_{N,P}TON COMPAT_{CFLAGS,OBJS} Executable extension `X' Signed-off-by: Michael Witten <mfwitten@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/Makefile232
-rw-r--r--tools/perf/util/util.h26
2 files changed, 8 insertions, 250 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 544367cf6d58..53c1e93ac432 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -14,103 +14,23 @@ endif
14# Define V=1 to have a more verbose compile. 14# Define V=1 to have a more verbose compile.
15# Define V=2 to have an even more verbose compile. 15# Define V=2 to have an even more verbose compile.
16# 16#
17# Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf()
18# or vsnprintf() return -1 instead of number of characters which would
19# have been written to the final string if enough space had been available.
20#
21# Define FREAD_READS_DIRECTORIES if your are on a system which succeeds
22# when attempting to read from an fopen'ed directory.
23#
24# Define CURLDIR=/foo/bar if your curl header and library files are in 17# Define CURLDIR=/foo/bar if your curl header and library files are in
25# /foo/bar/include and /foo/bar/lib directories. 18# /foo/bar/include and /foo/bar/lib directories.
26# 19#
27# Define EXPATDIR=/foo/bar if your expat header and library files are in 20# Define EXPATDIR=/foo/bar if your expat header and library files are in
28# /foo/bar/include and /foo/bar/lib directories. 21# /foo/bar/include and /foo/bar/lib directories.
29# 22#
30# Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
31#
32# Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
33# d_type in struct dirent (latest Cygwin -- will be fixed soonish).
34#
35# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) 23# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.)
36# do not support the 'size specifiers' introduced by C99, namely ll, hh, 24# do not support the 'size specifiers' introduced by C99, namely ll, hh,
37# j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t). 25# j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t).
38# some C compilers supported these specifiers prior to C99 as an extension. 26# some C compilers supported these specifiers prior to C99 as an extension.
39# 27#
40# Define NO_STRCASESTR if you don't have strcasestr.
41#
42# Define NO_MEMMEM if you don't have memmem.
43#
44# Define NO_STRTOUMAX if you don't have strtoumax in the C library.
45# If your compiler also does not support long long or does not have
46# strtoull, define NO_STRTOULL.
47#
48# Define NO_SETENV if you don't have setenv in the C library.
49#
50# Define NO_UNSETENV if you don't have unsetenv in the C library.
51#
52# Define NO_MKDTEMP if you don't have mkdtemp in the C library.
53#
54# Define NO_SYS_SELECT_H if you don't have sys/select.h.
55#
56# Define NO_FINK if you are building on Darwin/Mac OS X, have Fink
57# installed in /sw, but don't want PERF to link against any libraries
58# installed there. If defined you may specify your own (or Fink's)
59# include directories and library directories by defining CFLAGS
60# and LDFLAGS appropriately.
61#
62# Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X,
63# have DarwinPorts installed in /opt/local, but don't want PERF to
64# link against any libraries installed there. If defined you may
65# specify your own (or DarwinPort's) include directories and
66# library directories by defining CFLAGS and LDFLAGS appropriately.
67#
68# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
69#
70# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
71# Patrick Mauritz).
72#
73# Define NO_MMAP if you want to avoid mmap.
74#
75# Define NO_PTHREADS if you do not have or do not want to use Pthreads.
76#
77# Define NO_PREAD if you have a problem with pread() system call (e.g.
78# cygwin.dll before v1.5.22).
79#
80# Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support
81# the executable mode bit, but doesn't really do so.
82#
83# Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
84#
85# Define NO_SOCKADDR_STORAGE if your platform does not have struct
86# sockaddr_storage.
87#
88# Define NO_ICONV if your libc does not properly support iconv.
89#
90# Define OLD_ICONV if your library has an old iconv(), where the second
91# (input buffer pointer) parameter is declared with type (const char **).
92#
93# Define NO_DEFLATE_BOUND if your zlib does not have deflateBound. 28# Define NO_DEFLATE_BOUND if your zlib does not have deflateBound.
94# 29#
95# Define NO_R_TO_GCC_LINKER if your gcc does not like "-R/path/lib" 30# Define NO_R_TO_GCC_LINKER if your gcc does not like "-R/path/lib"
96# that tells runtime paths to dynamic libraries; 31# that tells runtime paths to dynamic libraries;
97# "-Wl,-rpath=/path/lib" is used instead. 32# "-Wl,-rpath=/path/lib" is used instead.
98# 33#
99# Define USE_NSEC below if you want perf to care about sub-second file mtimes
100# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
101# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
102# randomly break unless your underlying filesystem supports those sub-second
103# times (my ext3 doesn't).
104#
105# Define USE_ST_TIMESPEC if your "struct stat" uses "st_ctimespec" instead of
106# "st_ctim"
107#
108# Define NO_NSEC if your "struct stat" does not have "st_ctim.tv_nsec"
109# available. This automatically turns USE_NSEC off.
110#
111# Define NO_ST_BLOCKS_IN_STRUCT_STAT if your platform does not have st_blocks
112# field that counts the on-disk footprint in 512-byte blocks.
113#
114# Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8 34# Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8
115# 35#
116# Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72. 36# Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72.
@@ -282,8 +202,6 @@ BASIC_LDFLAGS =
282# Guard against environment variables 202# Guard against environment variables
283BUILTIN_OBJS = 203BUILTIN_OBJS =
284BUILT_INS = 204BUILT_INS =
285COMPAT_CFLAGS =
286COMPAT_OBJS =
287LIB_H = 205LIB_H =
288LIB_OBJS = 206LIB_OBJS =
289PYRF_OBJS = 207PYRF_OBJS =
@@ -329,7 +247,7 @@ LANG_BINDINGS =
329ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS) 247ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
330 248
331# what 'all' will build but not install in perfexecdir 249# what 'all' will build but not install in perfexecdir
332OTHER_PROGRAMS = $(OUTPUT)perf$X 250OTHER_PROGRAMS = $(OUTPUT)perf
333 251
334# Set paths to tools early so that they can be used for version tests. 252# Set paths to tools early so that they can be used for version tests.
335ifndef SHELL_PATH 253ifndef SHELL_PATH
@@ -538,22 +456,6 @@ endif # NO_DWARF
538 456
539-include arch/$(ARCH)/Makefile 457-include arch/$(ARCH)/Makefile
540 458
541ifeq ($(uname_S),Darwin)
542 ifndef NO_FINK
543 ifeq ($(shell test -d /sw/lib && echo y),y)
544 BASIC_CFLAGS += -I/sw/include
545 BASIC_LDFLAGS += -L/sw/lib
546 endif
547 endif
548 ifndef NO_DARWIN_PORTS
549 ifeq ($(shell test -d /opt/local/lib && echo y),y)
550 BASIC_CFLAGS += -I/opt/local/include
551 BASIC_LDFLAGS += -L/opt/local/lib
552 endif
553 endif
554 PTHREAD_LIBS =
555endif
556
557ifneq ($(OUTPUT),) 459ifneq ($(OUTPUT),)
558 BASIC_CFLAGS += -I$(OUTPUT) 460 BASIC_CFLAGS += -I$(OUTPUT)
559endif 461endif
@@ -707,110 +609,9 @@ ifndef CC_LD_DYNPATH
707 endif 609 endif
708endif 610endif
709 611
710ifdef NEEDS_SOCKET
711 EXTLIBS += -lsocket
712endif
713ifdef NEEDS_NSL
714 EXTLIBS += -lnsl
715endif
716ifdef NO_D_TYPE_IN_DIRENT
717 BASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT
718endif
719ifdef NO_D_INO_IN_DIRENT
720 BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT
721endif
722ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
723 BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT
724endif
725ifdef USE_NSEC
726 BASIC_CFLAGS += -DUSE_NSEC
727endif
728ifdef USE_ST_TIMESPEC
729 BASIC_CFLAGS += -DUSE_ST_TIMESPEC
730endif
731ifdef NO_NSEC
732 BASIC_CFLAGS += -DNO_NSEC
733endif
734ifdef NO_C99_FORMAT 612ifdef NO_C99_FORMAT
735 BASIC_CFLAGS += -DNO_C99_FORMAT 613 BASIC_CFLAGS += -DNO_C99_FORMAT
736endif 614endif
737ifdef SNPRINTF_RETURNS_BOGUS
738 COMPAT_CFLAGS += -DSNPRINTF_RETURNS_BOGUS
739 COMPAT_OBJS += $(OUTPUT)compat/snprintf.o
740endif
741ifdef FREAD_READS_DIRECTORIES
742 COMPAT_CFLAGS += -DFREAD_READS_DIRECTORIES
743 COMPAT_OBJS += $(OUTPUT)compat/fopen.o
744endif
745ifdef NO_STRCASESTR
746 COMPAT_CFLAGS += -DNO_STRCASESTR
747 COMPAT_OBJS += $(OUTPUT)compat/strcasestr.o
748endif
749ifdef NO_STRTOUMAX
750 COMPAT_CFLAGS += -DNO_STRTOUMAX
751 COMPAT_OBJS += $(OUTPUT)compat/strtoumax.o
752endif
753ifdef NO_STRTOULL
754 COMPAT_CFLAGS += -DNO_STRTOULL
755endif
756ifdef NO_SETENV
757 COMPAT_CFLAGS += -DNO_SETENV
758 COMPAT_OBJS += $(OUTPUT)compat/setenv.o
759endif
760ifdef NO_MKDTEMP
761 COMPAT_CFLAGS += -DNO_MKDTEMP
762 COMPAT_OBJS += $(OUTPUT)compat/mkdtemp.o
763endif
764ifdef NO_UNSETENV
765 COMPAT_CFLAGS += -DNO_UNSETENV
766 COMPAT_OBJS += $(OUTPUT)compat/unsetenv.o
767endif
768ifdef NO_SYS_SELECT_H
769 BASIC_CFLAGS += -DNO_SYS_SELECT_H
770endif
771ifdef NO_MMAP
772 COMPAT_CFLAGS += -DNO_MMAP
773 COMPAT_OBJS += $(OUTPUT)compat/mmap.o
774else
775 ifdef USE_WIN32_MMAP
776 COMPAT_CFLAGS += -DUSE_WIN32_MMAP
777 COMPAT_OBJS += $(OUTPUT)compat/win32mmap.o
778 endif
779endif
780ifdef NO_PREAD
781 COMPAT_CFLAGS += -DNO_PREAD
782 COMPAT_OBJS += $(OUTPUT)compat/pread.o
783endif
784ifdef NO_TRUSTABLE_FILEMODE
785 BASIC_CFLAGS += -DNO_TRUSTABLE_FILEMODE
786endif
787ifdef NO_IPV6
788 BASIC_CFLAGS += -DNO_IPV6
789endif
790ifdef NO_UINTMAX_T
791 BASIC_CFLAGS += -Duintmax_t=uint32_t
792endif
793ifdef NO_SOCKADDR_STORAGE
794ifdef NO_IPV6
795 BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in
796else
797 BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in6
798endif
799endif
800ifdef NO_INET_NTOP
801 LIB_OBJS += $(OUTPUT)compat/inet_ntop.o
802endif
803ifdef NO_INET_PTON
804 LIB_OBJS += $(OUTPUT)compat/inet_pton.o
805endif
806
807ifdef NO_ICONV
808 BASIC_CFLAGS += -DNO_ICONV
809endif
810
811ifdef OLD_ICONV
812 BASIC_CFLAGS += -DOLD_ICONV
813endif
814 615
815ifdef NO_DEFLATE_BOUND 616ifdef NO_DEFLATE_BOUND
816 BASIC_CFLAGS += -DNO_DEFLATE_BOUND 617 BASIC_CFLAGS += -DNO_DEFLATE_BOUND
@@ -819,14 +620,6 @@ endif
819ifdef NO_PERL_MAKEMAKER 620ifdef NO_PERL_MAKEMAKER
820 export NO_PERL_MAKEMAKER 621 export NO_PERL_MAKEMAKER
821endif 622endif
822ifdef NO_HSTRERROR
823 COMPAT_CFLAGS += -DNO_HSTRERROR
824 COMPAT_OBJS += $(OUTPUT)compat/hstrerror.o
825endif
826ifdef NO_MEMMEM
827 COMPAT_CFLAGS += -DNO_MEMMEM
828 COMPAT_OBJS += $(OUTPUT)compat/memmem.o
829endif
830ifdef INTERNAL_QSORT 623ifdef INTERNAL_QSORT
831 COMPAT_CFLAGS += -DINTERNAL_QSORT 624 COMPAT_CFLAGS += -DINTERNAL_QSORT
832 COMPAT_OBJS += $(OUTPUT)compat/qsort.o 625 COMPAT_OBJS += $(OUTPUT)compat/qsort.o
@@ -835,9 +628,6 @@ ifdef RUNTIME_PREFIX
835 COMPAT_CFLAGS += -DRUNTIME_PREFIX 628 COMPAT_CFLAGS += -DRUNTIME_PREFIX
836endif 629endif
837 630
838ifdef DIR_HAS_BSD_GROUP_SEMANTICS
839 COMPAT_CFLAGS += -DDIR_HAS_BSD_GROUP_SEMANTICS
840endif
841ifdef NO_EXTERNAL_GREP 631ifdef NO_EXTERNAL_GREP
842 BASIC_CFLAGS += -DNO_EXTERNAL_GREP 632 BASIC_CFLAGS += -DNO_EXTERNAL_GREP
843endif 633endif
@@ -895,9 +685,6 @@ PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
895 685
896LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive $(EXTLIBS) 686LIBS = -Wl,--whole-archive $(PERFLIBS) -Wl,--no-whole-archive $(EXTLIBS)
897 687
898BASIC_CFLAGS += $(COMPAT_CFLAGS)
899LIB_OBJS += $(COMPAT_OBJS)
900
901ALL_CFLAGS += $(BASIC_CFLAGS) 688ALL_CFLAGS += $(BASIC_CFLAGS)
902ALL_CFLAGS += $(ARCH_CFLAGS) 689ALL_CFLAGS += $(ARCH_CFLAGS)
903ALL_LDFLAGS += $(BASIC_LDFLAGS) 690ALL_LDFLAGS += $(BASIC_LDFLAGS)
@@ -910,9 +697,6 @@ export TAR INSTALL DESTDIR SHELL_PATH
910SHELL = $(SHELL_PATH) 697SHELL = $(SHELL_PATH)
911 698
912all:: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(BUILT_INS) $(OTHER_PROGRAMS) $(OUTPUT)PERF-BUILD-OPTIONS 699all:: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(BUILT_INS) $(OTHER_PROGRAMS) $(OUTPUT)PERF-BUILD-OPTIONS
913ifneq (,$X)
914 $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) perf$X)), test '$p' -ef '$p$X' || $(RM) '$p';)
915endif
916 700
917all:: 701all::
918 702
@@ -921,15 +705,15 @@ please_set_SHELL_PATH_to_a_more_modern_shell:
921 705
922shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell 706shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
923 707
924strip: $(PROGRAMS) $(OUTPUT)perf$X 708strip: $(PROGRAMS) $(OUTPUT)perf
925 $(STRIP) $(STRIP_OPTS) $(PROGRAMS) $(OUTPUT)perf$X 709 $(STRIP) $(STRIP_OPTS) $(PROGRAMS) $(OUTPUT)perf
926 710
927$(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS 711$(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS
928 $(QUIET_CC)$(CC) -DPERF_VERSION='"$(PERF_VERSION)"' \ 712 $(QUIET_CC)$(CC) -DPERF_VERSION='"$(PERF_VERSION)"' \
929 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \ 713 '-DPERF_HTML_PATH="$(htmldir_SQ)"' \
930 $(ALL_CFLAGS) -c $(filter %.c,$^) -o $@ 714 $(ALL_CFLAGS) -c $(filter %.c,$^) -o $@
931 715
932$(OUTPUT)perf$X: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS) 716$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS)
933 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(OUTPUT)perf.o \ 717 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(OUTPUT)perf.o \
934 $(BUILTIN_OBJS) $(LIBS) -o $@ 718 $(BUILTIN_OBJS) $(LIBS) -o $@
935 719
@@ -1027,11 +811,11 @@ $(OUTPUT)util/scripting-engines/trace-event-python.o: util/scripting-engines/tra
1027$(OUTPUT)scripts/python/Perf-Trace-Util/Context.o: scripts/python/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS 811$(OUTPUT)scripts/python/Perf-Trace-Util/Context.o: scripts/python/Perf-Trace-Util/Context.c $(OUTPUT)PERF-CFLAGS
1028 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $< 812 $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $<
1029 813
1030$(OUTPUT)perf-%$X: %.o $(PERFLIBS) 814$(OUTPUT)perf-%: %.o $(PERFLIBS)
1031 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) 815 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
1032 816
1033$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H) 817$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
1034$(patsubst perf-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h) 818$(patsubst perf-%,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
1035 819
1036# we compile into subdirectories. if the target directory is not the source directory, they might not exists. So 820# we compile into subdirectories. if the target directory is not the source directory, they might not exists. So
1037# we depend the various files onto their directories. 821# we depend the various files onto their directories.
@@ -1168,7 +952,7 @@ export perfexec_instdir
1168 952
1169install: all 953install: all
1170 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' 954 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
1171 $(INSTALL) $(OUTPUT)perf$X '$(DESTDIR_SQ)$(bindir_SQ)' 955 $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'
1172 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace' 956 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
1173 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin' 957 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
1174 $(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' 958 $(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
@@ -1267,7 +1051,7 @@ distclean: clean
1267 1051
1268clean: 1052clean:
1269 $(RM) $(OUTPUT){*.o,*/*.o,*/*/*.o,*/*/*/*.o,$(LIB_FILE),perf-archive} 1053 $(RM) $(OUTPUT){*.o,*/*.o,*/*/*.o,*/*/*/*.o,$(LIB_FILE),perf-archive}
1270 $(RM) $(ALL_PROGRAMS) $(BUILT_INS) perf$X 1054 $(RM) $(ALL_PROGRAMS) $(BUILT_INS) perf
1271 $(RM) $(TEST_PROGRAMS) 1055 $(RM) $(TEST_PROGRAMS)
1272 $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* 1056 $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope*
1273 $(RM) -r $(PERF_TARNAME) .doc-tmp-dir 1057 $(RM) -r $(PERF_TARNAME) .doc-tmp-dir
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index e833f26f3bfc..fc784284ac8b 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -70,9 +70,7 @@
70#include <sys/poll.h> 70#include <sys/poll.h>
71#include <sys/socket.h> 71#include <sys/socket.h>
72#include <sys/ioctl.h> 72#include <sys/ioctl.h>
73#ifndef NO_SYS_SELECT_H
74#include <sys/select.h> 73#include <sys/select.h>
75#endif
76#include <netinet/in.h> 74#include <netinet/in.h>
77#include <netinet/tcp.h> 75#include <netinet/tcp.h>
78#include <arpa/inet.h> 76#include <arpa/inet.h>
@@ -83,10 +81,6 @@
83#include "types.h" 81#include "types.h"
84#include <sys/ttydefaults.h> 82#include <sys/ttydefaults.h>
85 83
86#ifndef NO_ICONV
87#include <iconv.h>
88#endif
89
90extern const char *graph_line; 84extern const char *graph_line;
91extern const char *graph_dotted_line; 85extern const char *graph_dotted_line;
92extern char buildid_dir[]; 86extern char buildid_dir[];
@@ -236,26 +230,6 @@ static inline int sane_case(int x, int high)
236 return x; 230 return x;
237} 231}
238 232
239#ifndef DIR_HAS_BSD_GROUP_SEMANTICS
240# define FORCE_DIR_SET_GID S_ISGID
241#else
242# define FORCE_DIR_SET_GID 0
243#endif
244
245#ifdef NO_NSEC
246#undef USE_NSEC
247#define ST_CTIME_NSEC(st) 0
248#define ST_MTIME_NSEC(st) 0
249#else
250#ifdef USE_ST_TIMESPEC
251#define ST_CTIME_NSEC(st) ((unsigned int)((st).st_ctimespec.tv_nsec))
252#define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtimespec.tv_nsec))
253#else
254#define ST_CTIME_NSEC(st) ((unsigned int)((st).st_ctim.tv_nsec))
255#define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtim.tv_nsec))
256#endif
257#endif
258
259int mkdir_p(char *path, mode_t mode); 233int mkdir_p(char *path, mode_t mode);
260int copyfile(const char *from, const char *to); 234int copyfile(const char *from, const char *to);
261 235