Skip to contentSkip to conversation

tools: Unify export.h

PATCH In review Borislav Petkov 5 participants 14 messages Feb 23, 2014 – Apr 14, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: Unify export.h

From: Borislav Petkov <[email protected]>

So tools/ has been growing three, at a different stage of their development export.h headers and so we should unite into one. Add tools/include/ to the include path of virtio and liblockdep to pick the shared header now.

Cc Sasha Levin <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Rusty Russell <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
---
 tools/{virtio => include}/linux/export.h  | 5 +++++
 tools/lib/lockdep/Makefile                | 2 +-
 tools/lib/lockdep/uinclude/linux/export.h | 7 -------
 tools/perf/Makefile.perf                  | 2 +-
 tools/perf/util/include/linux/export.h    | 6 ------
 tools/virtio/Makefile                     | 2 +-
 6 files changed, 8 insertions(+), 16 deletions(-)
 rename tools/{virtio => include}/linux/export.h (70%)
 delete mode 100644 tools/lib/lockdep/uinclude/linux/export.h
 delete mode 100644 tools/perf/util/include/linux/export.h
tools/include/linux/export.h renamed from tools/virtio/linux/export.h +5 -0
similarity index 70%
rename from tools/virtio/linux/export.h
rename to tools/include/linux/export.h
index 7311d326894a..d07e586b9ba0 100644
@@ -1,5 +1,10 @@
+#ifndef _TOOLS_LINUX_EXPORT_H_
+#define _TOOLS_LINUX_EXPORT_H_
+
 #define EXPORT_SYMBOL(sym)
 #define EXPORT_SYMBOL_GPL(sym)
 #define EXPORT_SYMBOL_GPL_FUTURE(sym)
 #define EXPORT_UNUSED_SYMBOL(sym)
 #define EXPORT_UNUSED_SYMBOL_GPL(sym)
+
+#endif
tools/lib/lockdep/Makefile +1 -1
index da8b7aa3d351..d3d7a1b5ce35 100644
@@ -112,7 +112,7 @@ export Q VERBOSE
 
 LIBLOCKDEP_VERSION = $(LL_VERSION).$(LL_PATCHLEVEL).$(LL_EXTRAVERSION)
 
-INCLUDES = -I. -I/usr/local/include -I./uinclude $(CONFIG_INCLUDES)
+INCLUDES = -I. -I/usr/local/include -I./uinclude -I../../include $(CONFIG_INCLUDES)
 
 # Set compile option CFLAGS if not set elsewhere
 CFLAGS ?= -g -DCONFIG_LOCKDEP -DCONFIG_STACKTRACE -DCONFIG_PROVE_LOCKING -DBITS_PER_LONG=__WORDSIZE -DLIBLOCKDEP_VERSION='"$(LIBLOCKDEP_VERSION)"' -rdynamic -O0 -g
tools/lib/lockdep/uinclude/linux/export.h deleted +0 -7
deleted file mode 100644
index 6bdf3492c535..000000000000
@@ -1,7 +0,0 @@
-#ifndef _LIBLOCKDEP_LINUX_EXPORT_H_
-#define _LIBLOCKDEP_LINUX_EXPORT_H_
-
-#define EXPORT_SYMBOL(sym)
-#define EXPORT_SYMBOL_GPL(sym)
-
-#endif
tools/perf/Makefile.perf +1 -1
index 77b153fa23a5..018e1d151a67 100644
@@ -217,7 +217,7 @@ LIB_H += util/include/linux/const.h
 LIB_H += util/include/linux/ctype.h
 LIB_H += util/include/linux/kernel.h
 LIB_H += util/include/linux/list.h
-LIB_H += util/include/linux/export.h
+LIB_H += ../include/linux/export.h
 LIB_H += util/include/linux/poison.h
 LIB_H += util/include/linux/rbtree.h
 LIB_H += util/include/linux/rbtree_augmented.h
tools/perf/util/include/linux/export.h deleted +0 -6
deleted file mode 100644
index b43e2dc21e04..000000000000
@@ -1,6 +0,0 @@
-#ifndef PERF_LINUX_MODULE_H
-#define PERF_LINUX_MODULE_H
-
-#define EXPORT_SYMBOL(name)
-
-#endif
tools/virtio/Makefile +1 -1
index 3187c62d9814..9325f4693821 100644
@@ -3,7 +3,7 @@ test: virtio_test vringh_test
 virtio_test: virtio_ring.o virtio_test.o
 vringh_test: vringh_test.o vringh.o virtio_ring.o
 
-CFLAGS += -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE
+CFLAGS += -g -O2 -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE
 vpath %.c ../../drivers/virtio ../../drivers/vhost
 mod:
 	${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test
Signature · 1 line
1.9.0
#1 lore raw
Quoted 6 lines · Borislav Petkov

From: Borislav Petkov <[email protected]>

So tools/ has been growing three, at a different stage of their development export.h headers and so we should unite into one. Add tools/include/ to the include path of virtio and liblockdep to pick the shared header now.

Should we get more ambitious and start a fake-kernel/ directory where we can put userspace equivs/stubs of kernel functionality?

Cheers,
Rusty.

#2 lore raw
In reply to Borislav Petkov
Quoted 6 lines · Borislav Petkov

From: Borislav Petkov <[email protected]>

So tools/ has been growing three, at a different stage of their development export.h headers and so we should unite into one. Add tools/include/ to the include path of virtio and liblockdep to pick the shared header now.

Should we get more ambitious and start a fake-kernel/ directory where we can put userspace equivs/stubs of kernel functionality?

Cheers,
Rusty.

#3 lore raw
Quoted 2 lines · Rusty Russell

Should we get more ambitious and start a fake-kernel/ directory where we can put userspace equivs/stubs of kernel functionality?

Dunno - people like to do that now, it seems.

In any case, cleanups and unifications like that would definitely help if we decide to do that because, in this particular example, we have only one export.h to go and fish out.

Signature · 5 lines
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
#4 lore raw
In reply to Rusty Russell
Quoted 2 lines · Rusty Russell

Should we get more ambitious and start a fake-kernel/ directory where we can put userspace equivs/stubs of kernel functionality?

Dunno - people like to do that now, it seems.

In any case, cleanups and unifications like that would definitely help if we decide to do that because, in this particular example, we have only one export.h to go and fish out.

Signature · 5 lines
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
Acked-by
#5 lore raw
Quoted 9 lines · Borislav Petkov
Quoted 2 lines · Rusty Russell

Should we get more ambitious and start a fake-kernel/ directory where we can put userspace equivs/stubs of kernel functionality?

Dunno - people like to do that now, it seems.

In any case, cleanups and unifications like that would definitely help if we decide to do that because, in this particular example, we have only one export.h to go and fish out.

Agreed.

Cheers,
Rusty

#6 lore raw

Em Tue, Feb 25, 2014 at 10:52:02PM +1030, Rusty Russell escreveu:

Quoted 7 lines
Quoted 6 lines · Borislav Petkov
Quoted 2 lines · Rusty Russell

Should we get more ambitious and start a fake-kernel/ directory where we can put userspace equivs/stubs of kernel functionality?

Dunno - people like to do that now, it seems.

Quoted 7 lines
Quoted 3 lines

In any case, cleanups and unifications like that would definitely help if we decide to do that because, in this particular example, we have only one export.h to go and fish out.

Agreed.

I'm ok with it as well and will stash it in my perf/core branch after a bit more time for others in the CC list to say something.

- Arnaldo

#7 lore raw
In reply to Rusty Russell

Em Tue, Feb 25, 2014 at 10:52:02PM +1030, Rusty Russell escreveu:

Quoted 7 lines
Quoted 6 lines · Borislav Petkov
Quoted 2 lines · Rusty Russell

Should we get more ambitious and start a fake-kernel/ directory where we can put userspace equivs/stubs of kernel functionality?

Dunno - people like to do that now, it seems.

Quoted 7 lines
Quoted 3 lines

In any case, cleanups and unifications like that would definitely help if we decide to do that because, in this particular example, we have only one export.h to go and fish out.

Agreed.

I'm ok with it as well and will stash it in my perf/core branch after a bit more time for others in the CC list to say something.

- Arnaldo

#8 lore raw

Rebased onto current acme/perf/core:

--
From: Borislav Petkov <[email protected]>
Date: Sun, 23 Feb 2014 12:04:53 +0100
Subject: [PATCH] tools: Unify export.h

So tools/ has been growing three, at a different stage of their development export.h headers and so we should unite into one. Add tools/include/ to the include path of virtio and liblockdep to pick the shared header now.

Cc Sasha Levin <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Rusty Russell <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
---
 tools/{virtio => include}/linux/export.h  | 5 +++++
 tools/lib/lockdep/Makefile                | 2 +-
 tools/lib/lockdep/uinclude/linux/export.h | 7 -------
 tools/perf/Makefile.perf                  | 2 +-
 tools/perf/util/include/linux/export.h    | 6 ------
 tools/virtio/Makefile                     | 2 +-
 6 files changed, 8 insertions(+), 16 deletions(-)
 rename tools/{virtio => include}/linux/export.h (70%)
 delete mode 100644 tools/lib/lockdep/uinclude/linux/export.h
 delete mode 100644 tools/perf/util/include/linux/export.h
tools/include/linux/export.h renamed from tools/virtio/linux/export.h +5 -0
similarity index 70%
rename from tools/virtio/linux/export.h
rename to tools/include/linux/export.h
index 7311d326894a..d07e586b9ba0 100644
@@ -1,5 +1,10 @@
+#ifndef _TOOLS_LINUX_EXPORT_H_
+#define _TOOLS_LINUX_EXPORT_H_
+
 #define EXPORT_SYMBOL(sym)
 #define EXPORT_SYMBOL_GPL(sym)
 #define EXPORT_SYMBOL_GPL_FUTURE(sym)
 #define EXPORT_UNUSED_SYMBOL(sym)
 #define EXPORT_UNUSED_SYMBOL_GPL(sym)
+
+#endif
tools/lib/lockdep/Makefile +1 -1
index 07b0b7542511..41d4a99ce46e 100644
@@ -112,7 +112,7 @@ export Q VERBOSE
 
 LIBLOCKDEP_VERSION = $(LL_VERSION).$(LL_PATCHLEVEL).$(LL_EXTRAVERSION)
 
-INCLUDES = -I. -I/usr/local/include -I./uinclude -I./include $(CONFIG_INCLUDES)
+INCLUDES = -I. -I/usr/local/include -I./uinclude -I./include -I../../include $(CONFIG_INCLUDES)
 
 # Set compile option CFLAGS if not set elsewhere
 CFLAGS ?= -g -DCONFIG_LOCKDEP -DCONFIG_STACKTRACE -DCONFIG_PROVE_LOCKING -DBITS_PER_LONG=__WORDSIZE -DLIBLOCKDEP_VERSION='"$(LIBLOCKDEP_VERSION)"' -rdynamic -O0 -g
tools/lib/lockdep/uinclude/linux/export.h deleted +0 -7
deleted file mode 100644
index 6bdf3492c535..000000000000
@@ -1,7 +0,0 @@
-#ifndef _LIBLOCKDEP_LINUX_EXPORT_H_
-#define _LIBLOCKDEP_LINUX_EXPORT_H_
-
-#define EXPORT_SYMBOL(sym)
-#define EXPORT_SYMBOL_GPL(sym)
-
-#endif
tools/perf/Makefile.perf +1 -1
index 667e85a1f949..791ad6d1994e 100644
@@ -222,7 +222,7 @@ LIB_H += util/include/linux/const.h
 LIB_H += util/include/linux/ctype.h
 LIB_H += util/include/linux/kernel.h
 LIB_H += util/include/linux/list.h
-LIB_H += util/include/linux/export.h
+LIB_H += ../include/linux/export.h
 LIB_H += util/include/linux/poison.h
 LIB_H += util/include/linux/rbtree.h
 LIB_H += util/include/linux/rbtree_augmented.h
tools/perf/util/include/linux/export.h deleted +0 -6
deleted file mode 100644
index b43e2dc21e04..000000000000
@@ -1,6 +0,0 @@
-#ifndef PERF_LINUX_MODULE_H
-#define PERF_LINUX_MODULE_H
-
-#define EXPORT_SYMBOL(name)
-
-#endif
tools/virtio/Makefile +1 -1
index 3187c62d9814..9325f4693821 100644
@@ -3,7 +3,7 @@ test: virtio_test vringh_test
 virtio_test: virtio_ring.o virtio_test.o
 vringh_test: vringh_test.o vringh.o virtio_ring.o
 
-CFLAGS += -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE
+CFLAGS += -g -O2 -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE
 vpath %.c ../../drivers/virtio ../../drivers/vhost
 mod:
 	${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test
Signature · 8 lines
1.9.0

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
#9 lore raw
Quoted 11 lines · Borislav Petkov

Rebased onto current acme/perf/core:

--
From: Borislav Petkov <[email protected]>
Date: Sun, 23 Feb 2014 12:04:53 +0100
Subject: [PATCH] tools: Unify export.h

So tools/ has been growing three, at a different stage of their development export.h headers and so we should unite into one. Add tools/include/ to the include path of virtio and liblockdep to pick the shared header now.

hum, this breaks tarpkg test.. note that I needed attached patch to make the test output verbose

jirka

[jolsa@krava perf]$ make -f tests/make tarpkg
- tarpkg: ./tests/perf-targz-src-pkg .
make: *** [tarpkg] Error 2
[jolsa@krava perf]$ cat tarpkg
./tests/perf-targz-src-pkg .
+ PERF=.
+ cd ./../..
+ make perf-targz-src-pkg
TAR
++ ls -rt perf-3.14.0-rc6.tar.gz
+ TARBALL=perf-3.14.0-rc6.tar.gz
++ mktemp -d
+ TMP_DEST=/tmp/tmp.27M0WzGGue
+ tar xf perf-3.14.0-rc6.tar.gz -C /tmp/tmp.27M0WzGGue
+ rm -f perf-3.14.0-rc6.tar.gz
+ cd -
+ make -C /tmp/tmp.27M0WzGGue/perf-3.14.0-rc6/tools/perf
BUILD: Doing 'make -j4' parallel build
config/Makefile:289: No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR

Auto-detecting system features:

...                         dwarf: [ on  ]
...                         glibc: [ on  ]
...                          gtk2: [ on  ]
...                      libaudit: [ on  ]
...                        libbfd: [ on  ]
...                        libelf: [ on  ]
...                       libnuma: [ on  ]
...                       libperl: [ on  ]
...                     libpython: [ on  ]
...                      libslang: [ on  ]
...                     libunwind: [ on  ]

... libdw-dwarf-unwind: [ OFF ]
... DWARF post unwind library: libunwind

GEN common-cmds.h
make[2]: *** No rule to make target ../include/linux/export.h', needed by builtin-annotate.o'. Stop. make[2]: *** Waiting for unfinished jobs....
FLAGS: * new build flags or prefix
PERF_VERSION = 3.14.rc6.g3b66a2
make[1]: *** [all] Error 2
+ RC=2
+ rm -rf /tmp/tmp.27M0WzGGue
+ exit 2

---

tools/perf/tests/perf-targz-src-pkg +4 -2
index 238aa39..f20d29e 100755
@@ -7,15 +7,17 @@
 # like when we made some files that were in tools/perf/ available to other tools/
 # codebases by moving it to tools/include/, etc.
 
+set -x
+
 PERF=$1
 cd ${PERF}/../..
-make perf-targz-src-pkg > /dev/null
+make perf-targz-src-pkg
 TARBALL=$(ls -rt perf-*.tar.gz)
 TMP_DEST=$(mktemp -d)
 tar xf ${TARBALL} -C $TMP_DEST
 rm -f ${TARBALL}
 cd - > /dev/null
-make -C $TMP_DEST/perf*/tools/perf > /dev/null 2>&1
+make -C $TMP_DEST/perf*/tools/perf
 RC=$?
 rm -rf ${TMP_DEST}
 exit $RC
#10 lore raw
In reply to Borislav Petkov
Quoted 11 lines · Borislav Petkov

Rebased onto current acme/perf/core:

--
From: Borislav Petkov <[email protected]>
Date: Sun, 23 Feb 2014 12:04:53 +0100
Subject: [PATCH] tools: Unify export.h

So tools/ has been growing three, at a different stage of their development export.h headers and so we should unite into one. Add tools/include/ to the include path of virtio and liblockdep to pick the shared header now.

hum, this breaks tarpkg test.. note that I needed attached patch to make the test output verbose

jirka

[jolsa@krava perf]$ make -f tests/make tarpkg
- tarpkg: ./tests/perf-targz-src-pkg .
make: *** [tarpkg] Error 2
[jolsa@krava perf]$ cat tarpkg
./tests/perf-targz-src-pkg .
+ PERF=.
+ cd ./../..
+ make perf-targz-src-pkg
TAR
++ ls -rt perf-3.14.0-rc6.tar.gz
+ TARBALL=perf-3.14.0-rc6.tar.gz
++ mktemp -d
+ TMP_DEST=/tmp/tmp.27M0WzGGue
+ tar xf perf-3.14.0-rc6.tar.gz -C /tmp/tmp.27M0WzGGue
+ rm -f perf-3.14.0-rc6.tar.gz
+ cd -
+ make -C /tmp/tmp.27M0WzGGue/perf-3.14.0-rc6/tools/perf
BUILD: Doing 'make -j4' parallel build
config/Makefile:289: No libdw DWARF unwind found, Please install elfutils-devel/libdw-dev >= 0.158 and/or set LIBDW_DIR

Auto-detecting system features:

...                         dwarf: [ on  ]
...                         glibc: [ on  ]
...                          gtk2: [ on  ]
...                      libaudit: [ on  ]
...                        libbfd: [ on  ]
...                        libelf: [ on  ]
...                       libnuma: [ on  ]
...                       libperl: [ on  ]
...                     libpython: [ on  ]
...                      libslang: [ on  ]
...                     libunwind: [ on  ]

... libdw-dwarf-unwind: [ OFF ]
... DWARF post unwind library: libunwind

GEN common-cmds.h
make[2]: *** No rule to make target ../include/linux/export.h', needed by builtin-annotate.o'. Stop. make[2]: *** Waiting for unfinished jobs....
FLAGS: * new build flags or prefix
PERF_VERSION = 3.14.rc6.g3b66a2
make[1]: *** [all] Error 2
+ RC=2
+ rm -rf /tmp/tmp.27M0WzGGue
+ exit 2

---

tools/perf/tests/perf-targz-src-pkg +4 -2
index 238aa39..f20d29e 100755
@@ -7,15 +7,17 @@
 # like when we made some files that were in tools/perf/ available to other tools/
 # codebases by moving it to tools/include/, etc.
 
+set -x
+
 PERF=$1
 cd ${PERF}/../..
-make perf-targz-src-pkg > /dev/null
+make perf-targz-src-pkg
 TARBALL=$(ls -rt perf-*.tar.gz)
 TMP_DEST=$(mktemp -d)
 tar xf ${TARBALL} -C $TMP_DEST
 rm -f ${TARBALL}
 cd - > /dev/null
-make -C $TMP_DEST/perf*/tools/perf > /dev/null 2>&1
+make -C $TMP_DEST/perf*/tools/perf
 RC=$?
 rm -rf ${TMP_DEST}
 exit $RC
#11 lore raw
Quoted 2 lines · Jiri Olsa

hum, this breaks tarpkg test.. note that I needed attached patch to make the test output verbose

Bah, I could swear

make -C tools/perf build-test

passed before sending out. Alternatively, I might've been smoking something funny yesterday, though, too.

Anyway, it is the MANIFEST - I keep forgetting this thing and acme already made me aware about it in the past. Shame on me!

Anyway, here's a fixed version which passes.

Thanks.

---
From: Borislav Petkov <[email protected]>
Date: Sun, 23 Feb 2014 12:04:53 +0100
Subject: [PATCH] tools: Unify export.h

So tools/ has been growing three, at a different stage of their development export.h headers and so we should unite into one. Add tools/include/ to the include path of virtio and liblockdep to pick the shared header now.

Cc Sasha Levin <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Rusty Russell <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
---
 tools/{virtio => include}/linux/export.h  | 5 +++++
 tools/lib/lockdep/Makefile                | 2 +-
 tools/lib/lockdep/uinclude/linux/export.h | 7 -------
 tools/perf/MANIFEST                       | 1 +
 tools/perf/Makefile.perf                  | 2 +-
 tools/perf/util/include/linux/export.h    | 6 ------
 tools/virtio/Makefile                     | 2 +-
 7 files changed, 9 insertions(+), 16 deletions(-)
 rename tools/{virtio => include}/linux/export.h (70%)
 delete mode 100644 tools/lib/lockdep/uinclude/linux/export.h
 delete mode 100644 tools/perf/util/include/linux/export.h
tools/include/linux/export.h renamed from tools/virtio/linux/export.h +5 -0
similarity index 70%
rename from tools/virtio/linux/export.h
rename to tools/include/linux/export.h
index 7311d326894a..d07e586b9ba0 100644
@@ -1,5 +1,10 @@
+#ifndef _TOOLS_LINUX_EXPORT_H_
+#define _TOOLS_LINUX_EXPORT_H_
+
 #define EXPORT_SYMBOL(sym)
 #define EXPORT_SYMBOL_GPL(sym)
 #define EXPORT_SYMBOL_GPL_FUTURE(sym)
 #define EXPORT_UNUSED_SYMBOL(sym)
 #define EXPORT_UNUSED_SYMBOL_GPL(sym)
+
+#endif
tools/lib/lockdep/Makefile +1 -1
index 07b0b7542511..41d4a99ce46e 100644
@@ -112,7 +112,7 @@ export Q VERBOSE
 
 LIBLOCKDEP_VERSION = $(LL_VERSION).$(LL_PATCHLEVEL).$(LL_EXTRAVERSION)
 
-INCLUDES = -I. -I/usr/local/include -I./uinclude -I./include $(CONFIG_INCLUDES)
+INCLUDES = -I. -I/usr/local/include -I./uinclude -I./include -I../../include $(CONFIG_INCLUDES)
 
 # Set compile option CFLAGS if not set elsewhere
 CFLAGS ?= -g -DCONFIG_LOCKDEP -DCONFIG_STACKTRACE -DCONFIG_PROVE_LOCKING -DBITS_PER_LONG=__WORDSIZE -DLIBLOCKDEP_VERSION='"$(LIBLOCKDEP_VERSION)"' -rdynamic -O0 -g
tools/lib/lockdep/uinclude/linux/export.h deleted +0 -7
deleted file mode 100644
index 6bdf3492c535..000000000000
@@ -1,7 +0,0 @@
-#ifndef _LIBLOCKDEP_LINUX_EXPORT_H_
-#define _LIBLOCKDEP_LINUX_EXPORT_H_
-
-#define EXPORT_SYMBOL(sym)
-#define EXPORT_SYMBOL_GPL(sym)
-
-#endif
tools/perf/MANIFEST +1 -0
index c0c87c87b60f..81783c2037fc 100644
@@ -7,6 +7,7 @@ tools/lib/symbol/kallsyms.h
 tools/include/asm/bug.h
 tools/include/linux/compiler.h
 tools/include/linux/hash.h
+tools/include/linux/export.h
 include/linux/const.h
 include/linux/perf_event.h
 include/linux/rbtree.h
tools/perf/Makefile.perf +1 -1
index 667e85a1f949..791ad6d1994e 100644
@@ -222,7 +222,7 @@ LIB_H += util/include/linux/const.h
 LIB_H += util/include/linux/ctype.h
 LIB_H += util/include/linux/kernel.h
 LIB_H += util/include/linux/list.h
-LIB_H += util/include/linux/export.h
+LIB_H += ../include/linux/export.h
 LIB_H += util/include/linux/poison.h
 LIB_H += util/include/linux/rbtree.h
 LIB_H += util/include/linux/rbtree_augmented.h
tools/perf/util/include/linux/export.h deleted +0 -6
deleted file mode 100644
index b43e2dc21e04..000000000000
@@ -1,6 +0,0 @@
-#ifndef PERF_LINUX_MODULE_H
-#define PERF_LINUX_MODULE_H
-
-#define EXPORT_SYMBOL(name)
-
-#endif
tools/virtio/Makefile +1 -1
index 3187c62d9814..9325f4693821 100644
@@ -3,7 +3,7 @@ test: virtio_test vringh_test
 virtio_test: virtio_ring.o virtio_test.o
 vringh_test: vringh_test.o vringh.o virtio_ring.o
 
-CFLAGS += -g -O2 -Wall -I. -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE
+CFLAGS += -g -O2 -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE
 vpath %.c ../../drivers/virtio ../../drivers/vhost
 mod:
 	${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test
Signature · 8 lines
1.9.0

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
#12 lore raw

PATCH 1/1 tools: Consolidate types.h

And while we're at it, let's do another consolidation:

---
From: Borislav Petkov <[email protected]>
Date: Sat, 12 Apr 2014 20:10:49 +0200
Subject: [PATCH] tools: Consolidate types.h

Combine all definitions into a common tools/include/linux/types.h and kill the wild growth elsewhere. While at it, move u64_swap to its only user, evsel.h.

---
 .../lockdep/uinclude => include}/linux/types.h     | 29 +++++++++++++++++-----
 tools/perf/MANIFEST                                |  1 +
 tools/perf/Makefile.perf                           |  3 +--
 tools/perf/arch/x86/include/perf_regs.h            |  2 +-
 tools/perf/arch/x86/util/tsc.c                     |  2 +-
 tools/perf/arch/x86/util/tsc.h                     |  2 +-
 tools/perf/perf.h                                  |  4 +--
 tools/perf/tests/attr.c                            |  7 ------
 tools/perf/tests/code-reading.c                    |  3 +--
 tools/perf/tests/dso-data.c                        |  2 +-
 tools/perf/tests/dwarf-unwind.c                    |  2 +-
 tools/perf/tests/keep-tracking.c                   |  2 +-
 tools/perf/tests/mmap-thread-lookup.c              |  2 +-
 tools/perf/tests/parse-no-sample-id-all.c          |  2 +-
 tools/perf/tests/perf-targz-src-pkg                | 10 +++++---
 tools/perf/tests/perf-time-to-tsc.c                |  3 +--
 tools/perf/tests/rdpmc.c                           |  2 +-
 tools/perf/tests/sample-parsing.c                  |  2 +-
 tools/perf/ui/browser.h                            |  4 +--
 tools/perf/ui/progress.h                           |  2 +-
 tools/perf/util/annotate.h                         |  2 +-
 tools/perf/util/build-id.h                         |  2 +-
 tools/perf/util/dso.h                              |  2 +-
 tools/perf/util/evsel.h                            |  9 +++++--
 tools/perf/util/header.h                           |  3 ++-
 tools/perf/util/include/linux/list.h               |  1 +
 tools/perf/util/include/linux/types.h              | 29 ----------------------
 tools/perf/util/map.h                              |  2 +-
 tools/perf/util/parse-events.h                     |  3 +--
 tools/perf/util/parse-events.y                     |  2 +-
 tools/perf/util/perf_regs.h                        |  2 +-
 tools/perf/util/pmu.h                              |  1 +
 tools/perf/util/pmu.y                              |  1 +
 tools/perf/util/stat.h                             |  2 +-
 tools/perf/util/svghelper.h                        |  2 +-
 tools/perf/util/top.h                              |  2 +-
 tools/perf/util/types.h                            | 24 ------------------
 tools/perf/util/unwind-libdw.c                     |  2 +-
 tools/perf/util/unwind.h                           |  2 +-
 tools/perf/util/util.h                             |  5 +++-
 tools/perf/util/values.h                           |  2 +-
 tools/virtio/linux/kernel.h                        |  7 ------
 tools/virtio/linux/types.h                         | 28 ---------------------
 43 files changed, 75 insertions(+), 146 deletions(-)
 rename tools/{lib/lockdep/uinclude => include}/linux/types.h (63%)
 delete mode 100644 tools/perf/util/include/linux/types.h
 delete mode 100644 tools/perf/util/types.h
 delete mode 100644 tools/virtio/linux/types.h
tools/include/linux/types.h renamed from tools/lib/lockdep/uinclude/linux/types.h +23 -6
similarity index 63%
rename from tools/lib/lockdep/uinclude/linux/types.h
rename to tools/include/linux/types.h
index 929938f426de..98d0cbcaa600 100644
@@ -1,8 +1,9 @@
-#ifndef _LIBLOCKDEP_LINUX_TYPES_H_
-#define _LIBLOCKDEP_LINUX_TYPES_H_
+#ifndef _TOOLS_LINUX_TYPES_H_
+#define _TOOLS_LINUX_TYPES_H_
 
 #include <stdbool.h>
 #include <stddef.h>
+#include <stdint.h>
 
 #define __SANE_USERSPACE_TYPES__	/* For PPC64, to get LL64 types */
 #include <asm/types.h>
@@ -10,10 +11,22 @@
 struct page;
 struct kmem_cache;
 
-typedef unsigned gfp_t;
+typedef enum {
+	GFP_KERNEL,
+	GFP_ATOMIC,
+	__GFP_HIGHMEM,
+	__GFP_HIGH
+} gfp_t;
 
-typedef __u64 u64;
-typedef __s64 s64;
+/*
+ * We define u64 as uint64_t for every architecture
+ * so that we can print it with "%"PRIx64 without getting warnings.
+ *
+ * typedef __u64 u64;
+ * typedef __s64 s64;
+ */
+typedef uint64_t u64;
+typedef int64_t	s64;
 
 typedef __u32 u32;
 typedef __s32 s32;
@@ -35,6 +48,10 @@ typedef __s8  s8;
 #define __bitwise
 #endif
 
+#define __force
+#define __user
+#define __must_check
+#define __cold
 
 typedef __u16 __bitwise __le16;
 typedef __u16 __bitwise __be16;
@@ -55,4 +72,4 @@ struct hlist_node {
 	struct hlist_node *next, **pprev;
 };
 
-#endif
+#endif /* _TOOLS_LINUX_TYPES_H_ */
tools/perf/MANIFEST +1 -0
index 81783c2037fc..45da209b6ed3 100644
@@ -8,6 +8,7 @@ tools/include/asm/bug.h
 tools/include/linux/compiler.h
 tools/include/linux/hash.h
 tools/include/linux/export.h
+tools/include/linux/types.h
 include/linux/const.h
 include/linux/perf_event.h
 include/linux/rbtree.h
tools/perf/Makefile.perf +1 -2
index 791ad6d1994e..acc86ea4320d 100644
@@ -227,7 +227,7 @@ LIB_H += util/include/linux/poison.h
 LIB_H += util/include/linux/rbtree.h
 LIB_H += util/include/linux/rbtree_augmented.h
 LIB_H += util/include/linux/string.h
-LIB_H += util/include/linux/types.h
+LIB_H += ../include/linux/types.h
 LIB_H += util/include/linux/linkage.h
 LIB_H += util/include/asm/asm-offsets.h
 LIB_H += ../include/asm/bug.h
@@ -252,7 +252,6 @@ LIB_H += util/event.h
 LIB_H += util/evsel.h
 LIB_H += util/evlist.h
 LIB_H += util/exec_cmd.h
-LIB_H += util/types.h
 LIB_H += util/levenshtein.h
 LIB_H += util/machine.h
 LIB_H += util/map.h
tools/perf/arch/x86/include/perf_regs.h +1 -1
index fc819ca34a7e..7df517acfef8 100644
@@ -2,7 +2,7 @@
 #define ARCH_PERF_REGS_H
 
 #include <stdlib.h>
-#include "../../util/types.h"
+#include <linux/types.h>
 #include <asm/perf_regs.h>
 
 void perf_regs_load(u64 *regs);
tools/perf/arch/x86/util/tsc.c +1 -1
index b2519e49424f..40021fa3129b 100644
@@ -4,7 +4,7 @@
 #include <linux/perf_event.h>
 
 #include "../../perf.h"
-#include "../../util/types.h"
+#include <linux/types.h>
 #include "../../util/debug.h"
 #include "tsc.h"
 
tools/perf/arch/x86/util/tsc.h +1 -1
index a24dec81c795..2affe0366b59 100644
@@ -1,7 +1,7 @@
 #ifndef TOOLS_PERF_ARCH_X86_UTIL_TSC_H__
 #define TOOLS_PERF_ARCH_X86_UTIL_TSC_H__
 
-#include "../../util/types.h"
+#include <linux/types.h>
 
 struct perf_tsc_conversion {
 	u16 time_shift;
tools/perf/perf.h +1 -3
index 1138c412ff95..83ac8de3c8b5 100644
@@ -165,9 +165,8 @@
 #include <sys/types.h>
 #include <sys/syscall.h>
 
+#include <linux/types.h>
 #include <linux/perf_event.h>
-#include "util/types.h"
-#include <stdbool.h>
 
 /*
  * prctl(PR_TASK_PERF_EVENTS_DISABLE) will (cheaply) disable all
@@ -194,7 +193,6 @@ static inline unsigned long long rdclock(void)
 /*
  * Pick up some kernel type conventions:
  */
-#define __user
 #define asmlinkage
 
 #define unlikely(x)	__builtin_expect(!!(x), 0)
tools/perf/tests/attr.c +0 -7
index 00218f503b2e..2dfc9ad0e6f2 100644
@@ -1,4 +1,3 @@
-
 /*
  * The struct perf_event_attr test support.
  *
@@ -19,14 +18,8 @@
  * permissions. All the event text files are stored there.
  */
 
-/*
- * Powerpc needs __SANE_USERSPACE_TYPES__ before <linux/types.h> to select
- * 'int-ll64.h' and avoid compile warnings when printing __u64 with %llu.
- */
-#define __SANE_USERSPACE_TYPES__
 #include <stdlib.h>
 #include <stdio.h>
-#include <inttypes.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include "../perf.h"
tools/perf/tests/code-reading.c +1 -2
index 653a8fe2db95..103974eae373 100644
@@ -1,8 +1,7 @@
-#include <sys/types.h>
+#include <linux/types.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
-#include <inttypes.h>
 #include <ctype.h>
 #include <string.h>
 
tools/perf/tests/dso-data.c +1 -1
index 9cc81a3eb9b4..3e6cb171e3d3 100644
@@ -1,7 +1,7 @@
 #include "util.h"
 
 #include <stdlib.h>
-#include <sys/types.h>
+#include <linux/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <string.h>
tools/perf/tests/dwarf-unwind.c +1 -1
index c059ee81c038..108f0cd49f4e 100644
@@ -1,5 +1,5 @@
 #include <linux/compiler.h>
-#include <sys/types.h>
+#include <linux/types.h>
 #include <unistd.h>
 #include "tests.h"
 #include "debug.h"
tools/perf/tests/keep-tracking.c +1 -1
index 497957f269d8..7a5ab7b0b8f6 100644
@@ -1,4 +1,4 @@
-#include <sys/types.h>
+#include <linux/types.h>
 #include <unistd.h>
 #include <sys/prctl.h>
 
tools/perf/tests/mmap-thread-lookup.c +1 -1
index cb73e1ff9cab..428539cc72da 100644
@@ -1,6 +1,6 @@
 #include <unistd.h>
 #include <sys/syscall.h>
-#include <sys/types.h>
+#include <linux/types.h>
 #include <sys/mman.h>
 #include <pthread.h>
 #include <stdlib.h>
tools/perf/tests/parse-no-sample-id-all.c +1 -1
index e117b6c6a248..905019f9b740 100644
@@ -1,4 +1,4 @@
-#include <sys/types.h>
+#include <linux/types.h>
 #include <stddef.h>
 
 #include "tests.h"
tools/perf/tests/perf-targz-src-pkg +6 -4
index 238aa3927c71..3017d82a700f 100755
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # Test one of the main kernel Makefile targets to generate a perf sources tarball
 # suitable for build outside the full kernel sources.
 #
@@ -7,15 +7,17 @@
 # like when we made some files that were in tools/perf/ available to other tools/
 # codebases by moving it to tools/include/, etc.
 
+set -x
+
 PERF=$1
 cd ${PERF}/../..
 make perf-targz-src-pkg > /dev/null
 TARBALL=$(ls -rt perf-*.tar.gz)
 TMP_DEST=$(mktemp -d)
 tar xf ${TARBALL} -C $TMP_DEST
-rm -f ${TARBALL}
+# rm -f ${TARBALL}
 cd - > /dev/null
-make -C $TMP_DEST/perf*/tools/perf > /dev/null 2>&1
+make -C $TMP_DEST/perf*/tools/perf > w.log 2>&1
 RC=$?
-rm -rf ${TMP_DEST}
+# rm -rf ${TMP_DEST}
 exit $RC
tools/perf/tests/perf-time-to-tsc.c +1 -2
index 47146d388dbf..3b7cd4d32dcb 100644
@@ -1,7 +1,6 @@
 #include <stdio.h>
-#include <sys/types.h>
 #include <unistd.h>
-#include <inttypes.h>
+#include <linux/types.h>
 #include <sys/prctl.h>
 
 #include "parse-events.h"
tools/perf/tests/rdpmc.c +1 -1
index 46649c25fa5e..e59143fd9e71 100644
@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <signal.h>
 #include <sys/mman.h>
-#include "types.h"
+#include <linux/types.h>
 #include "perf.h"
 #include "debug.h"
 #include "tests.h"
tools/perf/tests/sample-parsing.c +1 -1
index 0014d3c8c21c..7ae8d17db3d9 100644
@@ -1,5 +1,5 @@
 #include <stdbool.h>
-#include <inttypes.h>
+#include <linux/types.h>
 
 #include "util.h"
 #include "event.h"
tools/perf/ui/browser.h +1 -3
index 118cca29dd26..03d4d6295f10 100644
@@ -1,9 +1,7 @@
 #ifndef _PERF_UI_BROWSER_H_
 #define _PERF_UI_BROWSER_H_ 1
 
-#include <stdbool.h>
-#include <sys/types.h>
-#include "../types.h"
+#include <linux/types.h>
 
 #define HE_COLORSET_TOP		50
 #define HE_COLORSET_MEDIUM	51
tools/perf/ui/progress.h +1 -1
index 29ec8efffefb..f34f89eb607c 100644
@@ -1,7 +1,7 @@
 #ifndef _PERF_UI_PROGRESS_H_
 #define _PERF_UI_PROGRESS_H_ 1
 
-#include <../types.h>
+#include <linux/types.h>
 
 void ui_progress__finish(void);
  
tools/perf/util/annotate.h +1 -1
index 56ad4f5287de..112d6e268150 100644
@@ -3,7 +3,7 @@
 
 #include <stdbool.h>
 #include <stdint.h>
-#include "types.h"
+#include <linux/types.h>
 #include "symbol.h"
 #include "hist.h"
 #include "sort.h"
tools/perf/util/build-id.h +1 -1
index 845ef865eced..ae392561470b 100644
@@ -4,7 +4,7 @@
 #define BUILD_ID_SIZE 20
 
 #include "tool.h"
-#include "types.h"
+#include <linux/types.h>
 
 extern struct perf_tool build_id__mark_dso_hit_ops;
 struct dso;
tools/perf/util/dso.h +1 -1
index ab06f1c03655..38efe95a7fdd 100644
@@ -4,7 +4,7 @@
 #include <linux/types.h>
 #include <linux/rbtree.h>
 #include <stdbool.h>
-#include "types.h"
+#include <linux/types.h>
 #include "map.h"
 #include "build-id.h"
 
tools/perf/util/evsel.h +7 -2
index 0c9926cfb292..f392ac83949f 100644
@@ -5,12 +5,17 @@
 #include <stdbool.h>
 #include <stddef.h>
 #include <linux/perf_event.h>
-#include "types.h"
+#include <linux/types.h>
 #include "xyarray.h"
 #include "cgroup.h"
 #include "hist.h"
 #include "symbol.h"
- 
+
+union u64_swap {
+	u64 val64;
+	u32 val32[2];
+};
+
 struct perf_counts_values {
 	union {
 		struct {
tools/perf/util/header.h +2 -1
index a2d047bdf4ef..4aae21a676e1 100644
@@ -4,8 +4,9 @@
 #include <linux/perf_event.h>
 #include <sys/types.h>
 #include <stdbool.h>
-#include "types.h"
+#include <linux/types.h>
 #include "event.h"
+#include "util.h"
 
 #include <linux/bitmap.h>
 
tools/perf/util/include/linux/list.h +1 -0
index bfe0a2afd0d2..76ddbc726343 100644
@@ -1,4 +1,5 @@
 #include <linux/kernel.h>
+#include <linux/types.h>
 
 #include "../../../../include/linux/list.h"
 
tools/perf/util/include/linux/types.h deleted +0 -29
deleted file mode 100644
index eb464786c084..000000000000
@@ -1,29 +0,0 @@
-#ifndef _PERF_LINUX_TYPES_H_
-#define _PERF_LINUX_TYPES_H_
-
-#include <asm/types.h>
-
-#ifndef __bitwise
-#define __bitwise
-#endif
-
-#ifndef __le32
-typedef __u32 __bitwise __le32;
-#endif
-
-#define DECLARE_BITMAP(name,bits) \
-	unsigned long name[BITS_TO_LONGS(bits)]
-
-struct list_head {
-	struct list_head *next, *prev;
-};
-
-struct hlist_head {
-	struct hlist_node *first;
-};
-
-struct hlist_node {
-	struct hlist_node *next, **pprev;
-};
-
-#endif
tools/perf/util/map.h +1 -1
index f00f058afb3b..e5d18e2e7f10 100644
@@ -6,7 +6,7 @@
 #include <linux/rbtree.h>
 #include <stdio.h>
 #include <stdbool.h>
-#include "types.h"
+#include <linux/types.h>
 
 enum map_type {
 	MAP__FUNCTION = 0,
tools/perf/util/parse-events.h +1 -2
index f1cb4c4b3c70..df094b4ed5ed 100644
@@ -6,9 +6,8 @@
 
 #include <linux/list.h>
 #include <stdbool.h>
-#include "types.h"
+#include <linux/types.h>
 #include <linux/perf_event.h>
-#include "types.h"
 
 struct list_head;
 struct perf_evsel;
tools/perf/util/parse-events.y +1 -1
index 4eb67ec333f1..e7822e0fcac6 100644
@@ -9,7 +9,7 @@
 
 #include <linux/compiler.h>
 #include <linux/list.h>
-#include "types.h"
+#include <linux/types.h>
 #include "util.h"
 #include "parse-events.h"
 #include "parse-events-bison.h"
tools/perf/util/perf_regs.h +1 -1
index d6e8b6a8d7f3..79c78f74e0cf 100644
@@ -1,7 +1,7 @@
 #ifndef __PERF_REGS_H
 #define __PERF_REGS_H
 
-#include "types.h"
+#include <linux/types.h>
 #include "event.h"
 
 #ifdef HAVE_PERF_REGS_SUPPORT
tools/perf/util/pmu.h +1 -0
index 8b64125a9281..1ad0380dd856 100644
@@ -4,6 +4,7 @@
 #include <linux/bitops.h>
 #include <linux/perf_event.h>
 #include <stdbool.h>
+#include "util.h"
 
 enum {
 	PERF_PMU_FORMAT_VALUE_CONFIG,
tools/perf/util/pmu.y +1 -0
index bfd7e8509869..a044c5c707ea 100644
@@ -8,6 +8,7 @@
 #include <linux/list.h>
 #include <linux/bitmap.h>
 #include <string.h>
+#include "util.h"
 #include "pmu.h"
 
 extern int perf_pmu_lex (void);
tools/perf/util/stat.h +1 -1
index ae8ccd7227cf..5667fc3e39cf 100644
@@ -1,7 +1,7 @@
 #ifndef __PERF_STATS_H
 #define __PERF_STATS_H
 
-#include "types.h"
+#include <linux/types.h>
 
 struct stats
 {
tools/perf/util/svghelper.h +1 -1
index f7b4d6e699ea..e3aff5332e30 100644
@@ -1,7 +1,7 @@
 #ifndef __PERF_SVGHELPER_H
 #define __PERF_SVGHELPER_H
 
-#include "types.h"
+#include <linux/types.h>
 
 extern void open_svg(const char *filename, int cpus, int rows, u64 start, u64 end);
 extern void svg_box(int Yslot, u64 start, u64 end, const char *type);
tools/perf/util/top.h +1 -1
index dab14d0ad3d0..f92c37abb0a8 100644
@@ -2,7 +2,7 @@
 #define __PERF_TOP_H 1
 
 #include "tool.h"
-#include "types.h"
+#include <linux/types.h>
 #include <stddef.h>
 #include <stdbool.h>
 #include <termios.h>
tools/perf/util/types.h deleted +0 -24
deleted file mode 100644
index c51fa6b70a28..000000000000
@@ -1,24 +0,0 @@
-#ifndef __PERF_TYPES_H
-#define __PERF_TYPES_H
-
-#include <stdint.h>
-
-/*
- * We define u64 as uint64_t for every architecture
- * so that we can print it with "%"PRIx64 without getting warnings.
- */
-typedef uint64_t	   u64;
-typedef int64_t		   s64;
-typedef unsigned int	   u32;
-typedef signed int	   s32;
-typedef unsigned short	   u16;
-typedef signed short	   s16;
-typedef unsigned char	   u8;
-typedef signed char	   s8;
-
-union u64_swap {
-	u64 val64;
-	u32 val32[2];
-};
-
-#endif /* __PERF_TYPES_H */
tools/perf/util/unwind-libdw.c +1 -1
index 67db73ec3dab..5ec80a575b50 100644
@@ -7,7 +7,7 @@
 #include "unwind-libdw.h"
 #include "machine.h"
 #include "thread.h"
-#include "types.h"
+#include <linux/types.h>
 #include "event.h"
 #include "perf_regs.h"
 
tools/perf/util/unwind.h +1 -1
index b031316f221a..f03061260b4e 100644
@@ -1,7 +1,7 @@
 #ifndef __UNWIND_H
 #define __UNWIND_H
 
-#include "types.h"
+#include <linux/types.h>
 #include "event.h"
 #include "symbol.h"
 
tools/perf/util/util.h +4 -1
index 6995d66f225c..35cc878dc97e 100644
@@ -69,7 +69,7 @@
 #include <sys/ioctl.h>
 #include <inttypes.h>
 #include <linux/magic.h>
-#include "types.h"
+#include <linux/types.h>
 #include <sys/ttydefaults.h>
 #include <api/fs/debugfs.h>
 #include <termios.h>
@@ -129,6 +129,9 @@ void put_tracing_file(char *file);
 #endif
 #endif
 
+#define DECLARE_BITMAP(name,bits) \
+	unsigned long name[BITS_TO_LONGS(bits)]
+
 #define PERF_GTK_DSO  "libperf-gtk.so"
 
 /* General helper functions */
tools/perf/util/values.h +1 -1
index 2fa967e1a88a..b21a80c6cf8d 100644
@@ -1,7 +1,7 @@
 #ifndef __PERF_VALUES_H
 #define __PERF_VALUES_H
 
-#include "types.h"
+#include <linux/types.h>
 
 struct perf_read_values {
 	int threads;
tools/virtio/linux/kernel.h +0 -7
index fba705963968..1e8ce6979c1e 100644
@@ -38,13 +38,6 @@ struct page {
 
 #define __printf(a,b) __attribute__((format(printf,a,b)))
 
-typedef enum {
-	GFP_KERNEL,
-	GFP_ATOMIC,
-	__GFP_HIGHMEM,
-	__GFP_HIGH
-} gfp_t;
-
 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
 
 extern void *__kmalloc_fake, *__kfree_ignore_start, *__kfree_ignore_end;
tools/virtio/linux/types.h deleted +0 -28
deleted file mode 100644
index f8ebb9a2b3d6..000000000000
@@ -1,28 +0,0 @@
-#ifndef TYPES_H
-#define TYPES_H
-#include <stdint.h>
-
-#define __force
-#define __user
-#define __must_check
-#define __cold
-
-typedef uint64_t u64;
-typedef int64_t s64;
-typedef uint32_t u32;
-typedef int32_t s32;
-typedef uint16_t u16;
-typedef int16_t s16;
-typedef uint8_t u8;
-typedef int8_t s8;
-
-typedef uint64_t __u64;
-typedef int64_t __s64;
-typedef uint32_t __u32;
-typedef int32_t __s32;
-typedef uint16_t __u16;
-typedef int16_t __s16;
-typedef uint8_t __u8;
-typedef int8_t __s8;
-
-#endif /* TYPES_H */
Signature · 9 lines
1.9.0


-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
#13 lore raw

Re: [PATCH] tools: Consolidate types.h

Quoted 10 lines · Borislav Petkov

And while we're at it, let's do another consolidation:

---
From: Borislav Petkov <[email protected]>
Date: Sat, 12 Apr 2014 20:10:49 +0200
Subject: [PATCH] tools: Consolidate types.h

Combine all definitions into a common tools/include/linux/types.h and kill the wild growth elsewhere. While at it, move u64_swap to its only user, evsel.h.

please put the 'u64_swap move' into separated patch plus one nit below

thanks,
jirka

Quoted 5 lines
---
 .../lockdep/uinclude => include}/linux/types.h     | 29 +++++++++++++++++-----
 tools/perf/MANIFEST                                |  1 +

SNIP

Quoted 21 lines
tools/perf/tests/perf-targz-src-pkg +3 -1
index 238aa3927c71..3017d82a700f 100755
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # Test one of the main kernel Makefile targets to generate a perf sources tarball
 # suitable for build outside the full kernel sources.
 #
@@ -7,15 +7,17 @@
 # like when we made some files that were in tools/perf/ available to other tools/
 # codebases by moving it to tools/include/, etc.
 
+set -x
+
 PERF=$1
 cd ${PERF}/../..
 make perf-targz-src-pkg > /dev/null
 TARBALL=$(ls -rt perf-*.tar.gz)
 TMP_DEST=$(mktemp -d)

tools/perf/tests/perf-targz-src-pkg line 23

Quoted 10 lines
tools/perf/tests/perf-targz-src-pkg +3 -3
 tar xf ${TARBALL} -C $TMP_DEST
-rm -f ${TARBALL}
+# rm -f ${TARBALL}
 cd - > /dev/null
-make -C $TMP_DEST/perf*/tools/perf > /dev/null 2>&1
+make -C $TMP_DEST/perf*/tools/perf > w.log 2>&1
 RC=$?
-rm -rf ${TMP_DEST}
+# rm -rf ${TMP_DEST}
 exit $RC

leftover from another change ;-)