summaryrefslogtreecommitdiff
path: root/ioctl.c
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-08-20 02:12:33 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2011-08-23 12:53:01 +0200
commit39fca628019cbfa01835482ac8559e21fde7f03c (patch)
treec4c70bdf7c9b37c3b399d7232e56b3eabc7ded56 /ioctl.c
parent5c774b2be4c64f24c8473d7bdf2ad23b8bc314cc (diff)
downloadstrace-39fca628019cbfa01835482ac8559e21fde7f03c.tar.gz
strace-39fca628019cbfa01835482ac8559e21fde7f03c.tar.bz2
strace-39fca628019cbfa01835482ac8559e21fde7f03c.tar.xz
Small optimization in signal and ioctl tables
Trivial shuffling of data tables puts them all in one file, allowing gcc to see their sizes and eliminate variables which store these sizes. Surprisingly, in C mode gcc does not optimize out static const int variables. Help it by using enums instead. * defs.h: Stop exporting ioctlent{0,1,2}, nioctlents{0,1,2}, signalent{0,1,2}, nsignals{0,1,2}. * ioctl.c: Remove definitions of ioctlent{,0,1,2} and nioctlents{,0,1,2}. * signal.c: Remove definitions of signalent{,0,1,2} and nsignals{,0,1,2}. * syscall.c: Move above definitions to this file. Make them static const or enums if suitable.
Diffstat (limited to 'ioctl.c')
-rw-r--r--ioctl.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/ioctl.c b/ioctl.c
index d7927c6..153e5df 100644
--- a/ioctl.c
+++ b/ioctl.c
@@ -32,42 +32,10 @@
#include "defs.h"
-const struct ioctlent ioctlent0[] = {
-/*
- * `ioctlent.h' may be generated from `ioctlent.raw' by the auxiliary
- * program `ioctlsort', such that the list is sorted by the `code' field.
- * This has the side-effect of resolving the _IO.. macros into
- * plain integers, eliminating the need to include here everything
- * in "/usr/include" .
- */
-#include "ioctlent.h"
-};
-
#ifdef LINUX
#include <asm/ioctl.h>
#endif
-const int nioctlents0 = ARRAY_SIZE(ioctlent0);
-
-#if SUPPORTED_PERSONALITIES >= 2
-const struct ioctlent ioctlent1[] = {
-#include "ioctlent1.h"
-};
-
-const int nioctlents1 = ARRAY_SIZE(ioctlent1);
-#endif /* SUPPORTED_PERSONALITIES >= 2 */
-
-#if SUPPORTED_PERSONALITIES >= 3
-const struct ioctlent ioctlent2[] = {
-#include "ioctlent2.h"
-};
-
-const int nioctlents2 = ARRAY_SIZE(ioctlent2);
-#endif /* SUPPORTED_PERSONALITIES >= 3 */
-
-const struct ioctlent *ioctlent;
-int nioctlents;
-
static int
compare(const void *a, const void *b)
{