summaryrefslogtreecommitdiff
path: root/resource.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2012-03-19 09:36:42 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2012-03-19 09:36:42 +0100
commit9fd4f96d2a2527ac7ca90c156bfc11ce10118684 (patch)
tree28fc6ab201afec903b58fad7b21dcaf57085af9f /resource.c
parent1be02798f56f3ee940c9cbc047be627fd12eef16 (diff)
downloadstrace-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 'resource.c')
-rw-r--r--resource.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/resource.c b/resource.c
index 77a94a2..d7a34ef 100644
--- a/resource.c
+++ b/resource.c
@@ -180,7 +180,7 @@ decode_rlimit(struct tcb *tcp, unsigned long addr)
# if SIZEOF_RLIM_T == 4
print_rlimit32(tcp, addr);
# else
- if (personality_wordsize[current_personality] == 4)
+ if (current_wordsize == 4)
print_rlimit32(tcp, addr);
else
print_rlimit64(tcp, addr);