From: Eugene Syromyatnikov Date: Sun, 13 Oct 2019 14:35:53 +0000 (+0200) Subject: defs.h: compact struct tcb a bit by moving currpers field X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=49aa9bcfb34ef8dae7d49a27b86cadd1a6c382ac;p=strace defs.h: compact struct tcb a bit by moving currpers field As reported by pahole, struct tcb has size of 328 bytes and 8 bytes of holes on x86_64; by moving currpers after qual_flg, both holes are leminated and the structure fits into 8 cache lines now. This should also benefit other 64-bit architectures. * defs.h [SUPPORTED_PERSONALITIES > 1] (struct tcb): Move currpers field after qual_flg field. --- diff --git a/defs.h b/defs.h index 5be982ac..db1de7d4 100644 --- a/defs.h +++ b/defs.h @@ -251,13 +251,13 @@ struct tcb { int flags; /* See below for TCB_ values */ int pid; /* If 0, this tcb is free */ int qual_flg; /* qual_flags[scno] or DEFAULT_QUAL_FLAGS + RAW */ +# if SUPPORTED_PERSONALITIES > 1 + unsigned int currpers; /* Personality at the time of scno update */ +# endif unsigned long u_error; /* Error code */ kernel_ulong_t scno; /* System call number */ kernel_ulong_t u_arg[MAX_ARGS]; /* System call arguments */ kernel_long_t u_rval; /* Return value */ -# if SUPPORTED_PERSONALITIES > 1 - unsigned int currpers; /* Personality at the time of scno update */ -# endif int sys_func_rval; /* Syscall entry parser's return value */ int curcol; /* Output column for this process */ FILE *outf; /* Output file for this process */