diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-03-19 09:36:42 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2012-03-19 09:36:42 +0100 |
commit | 9fd4f96d2a2527ac7ca90c156bfc11ce10118684 (patch) | |
tree | 28fc6ab201afec903b58fad7b21dcaf57085af9f /io.c | |
parent | 1be02798f56f3ee940c9cbc047be627fd12eef16 (diff) | |
download | strace-9fd4f96d2a2527ac7ca90c156bfc11ce10118684.tar.gz strace-9fd4f96d2a2527ac7ca90c156bfc11ce10118684.tar.bz2 strace-9fd4f96d2a2527ac7ca90c156bfc11ce10118684.tar.xz |
Optimize code if we have only one personality
On i386:
text data bss dec hex filename
238025 672 18980 257677 3ee8d strace.before
237389 704 18944 257037 3ec0d strace
* defs.h: Define PERSONALITY0_WORDSIZE as sizeof(long) if not defined.
Introduce new define, current_wordsize as
(personality_wordsize[current_personality]).
Make set_personality() no-op, current_personality constant zero,
current_wordsize as PERSONALITY0_WORDSIZE if we have only one personality.
* count.c (call_summary): Use current_wordsize instead of
personality_wordsize[current_personality].
* desc.c (printflock): Likewise.
* file.c (sys_utime): Likewise.
* io.c (tprint_iov): Likewise.
* process.c (printargv): Likewise.
* resource.c (decode_rlimit): Likewise.
* signal.c (sys_kill): Likewise.
(sys_rt_sigaction): Likewise.
* time.c (sprinttv): Likewise.
(sprint_timespec): Likewise.
(printitv_bitness): Likewise.
(tprint_timex): Likewise.
(printsigevent): Likewise.
* util.c (dumpiov): Likewise.
(umoven): Likewise.
(umovestr): Likewise.
* syscall.c: Initialize sysent to sysent0 etc.
Make current_personality, personality_wordsize[], set_personality()
conditional on SUPPORTED_PERSONALITIES > 1.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -72,14 +72,11 @@ tprint_iov(struct tcb *tcp, unsigned long len, unsigned long addr, int decode_io struct { u_int64_t base; u_int64_t len; } iov64; } iov; #define sizeof_iov \ - (personality_wordsize[current_personality] == 4 \ - ? sizeof(iov.iov32) : sizeof(iov.iov64)) + (current_wordsize == 4 ? sizeof(iov.iov32) : sizeof(iov.iov64)) #define iov_iov_base \ - (personality_wordsize[current_personality] == 4 \ - ? (u_int64_t) iov.iov32.base : iov.iov64.base) + (current_wordsize == 4 ? (uint64_t) iov.iov32.base : iov.iov64.base) #define iov_iov_len \ - (personality_wordsize[current_personality] == 4 \ - ? (u_int64_t) iov.iov32.len : iov.iov64.len) + (current_wordsize == 4 ? (uint64_t) iov.iov32.len : iov.iov64.len) #else struct iovec iov; #define sizeof_iov sizeof(iov) |