From: Denys Vlasenko Date: Thu, 21 Feb 2013 15:15:43 +0000 (+0100) Subject: Use uint8_t for qual_flags[] instead of ints. X-Git-Tag: v4.8~130 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a585c9d6416d5ca7e3af3ffd4887205f06f8286d;p=strace Use uint8_t for qual_flags[] instead of ints. Resulting bss reduction is ~6kbytes: text data bss dec hex filename 245703 700 19072 265475 40d03 strace.t4/strace 245687 700 12928 259315 3f4f3 strace.t5/strace Signed-off-by: Denys Vlasenko --- diff --git a/defs.h b/defs.h index 855a3122..9b14a213 100644 --- a/defs.h +++ b/defs.h @@ -470,6 +470,7 @@ struct tcb { #define QUAL_READ 0x040 /* dump data read on this file descriptor */ #define QUAL_WRITE 0x080 /* dump data written to this file descriptor */ #define UNDEFINED_SCNO 0x100 /* Used only in tcp->qual_flg */ +typedef uint8_t qualbits_t; #define DEFAULT_QUAL_FLAGS (QUAL_TRACE | QUAL_ABBREV | QUAL_VERBOSE) @@ -524,7 +525,7 @@ typedef enum { CFLAG_BOTH } cflag_t; extern cflag_t cflag; -extern int *qual_flags; +extern qualbits_t *qual_flags; extern bool debug_flag; extern bool Tflag; extern bool qflag; diff --git a/syscall.c b/syscall.c index fa06156b..452ac8ef 100644 --- a/syscall.c +++ b/syscall.c @@ -166,7 +166,7 @@ enum { nsyscalls0 = ARRAY_SIZE(sysent0) }; enum { nerrnos0 = ARRAY_SIZE(errnoent0) }; enum { nsignals0 = ARRAY_SIZE(signalent0) }; enum { nioctlents0 = ARRAY_SIZE(ioctlent0) }; -int qual_flags0[MAX_QUALS]; +qualbits_t qual_flags0[MAX_QUALS]; #if SUPPORTED_PERSONALITIES >= 2 static const char *const errnoent1[] = { @@ -182,7 +182,7 @@ enum { nsyscalls1 = ARRAY_SIZE(sysent1) }; enum { nerrnos1 = ARRAY_SIZE(errnoent1) }; enum { nsignals1 = ARRAY_SIZE(signalent1) }; enum { nioctlents1 = ARRAY_SIZE(ioctlent1) }; -int qual_flags1[MAX_QUALS]; +qualbits_t qual_flags1[MAX_QUALS]; #endif #if SUPPORTED_PERSONALITIES >= 3 @@ -199,7 +199,7 @@ enum { nsyscalls2 = ARRAY_SIZE(sysent2) }; enum { nerrnos2 = ARRAY_SIZE(errnoent2) }; enum { nsignals2 = ARRAY_SIZE(signalent2) }; enum { nioctlents2 = ARRAY_SIZE(ioctlent2) }; -int qual_flags2[MAX_QUALS]; +qualbits_t qual_flags2[MAX_QUALS]; #endif const struct sysent *sysent = sysent0; @@ -210,7 +210,7 @@ unsigned nsyscalls = nsyscalls0; unsigned nerrnos = nerrnos0; unsigned nsignals = nsignals0; unsigned nioctlents = nioctlents0; -int *qual_flags = qual_flags0; +qualbits_t *qual_flags = qual_flags0; #if SUPPORTED_PERSONALITIES > 1 unsigned current_personality;