summaryrefslogtreecommitdiff
path: root/time.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 /time.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 'time.c')
-rw-r--r--time.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/time.c b/time.c
index 09d0f07..537265e 100644
--- a/time.c
+++ b/time.c
@@ -79,7 +79,7 @@ sprinttv(char *buf, struct tcb *tcp, long addr, enum bitness_t bitness, int spec
if (bitness == BITNESS_32
#if SUPPORTED_PERSONALITIES > 1
- || personality_wordsize[current_personality] == 4
+ || current_wordsize == 4
#endif
)
{
@@ -135,7 +135,7 @@ sprint_timespec(char *buf, struct tcb *tcp, long addr)
int rc;
#if SUPPORTED_PERSONALITIES > 1
- if (personality_wordsize[current_personality] == 4) {
+ if (current_wordsize == 4) {
struct timeval32 tv;
rc = umove(tcp, addr, &tv);
@@ -288,7 +288,7 @@ printitv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness)
if (bitness == BITNESS_32
#if SUPPORTED_PERSONALITIES > 1
- || personality_wordsize[current_personality] == 4
+ || current_wordsize == 4
#endif
)
{
@@ -542,7 +542,7 @@ tprint_timex(struct tcb *tcp, long addr)
struct timex tx;
#if SUPPORTED_PERSONALITIES > 1
- if (personality_wordsize[current_personality] == 4)
+ if (current_wordsize == 4)
return tprint_timex32(tcp, addr);
#endif
if (umove(tcp, addr, &tx) < 0)
@@ -746,7 +746,7 @@ printsigevent(struct tcb *tcp, long arg)
struct sigevent sev;
#if SUPPORTED_PERSONALITIES > 1
- if (personality_wordsize[current_personality] == 4) {
+ if (current_wordsize == 4) {
printsigevent32(tcp, arg);
return;
}