]> granicus.if.org Git - strace/commitdiff
defs.h: compact struct tcb a bit by moving currpers field
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sun, 13 Oct 2019 14:35:53 +0000 (16:35 +0200)
committerEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 18 Oct 2019 19:00:32 +0000 (21:00 +0200)
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.

defs.h

diff --git a/defs.h b/defs.h
index 5be982ac90a93f81604e164de53fff1cbb8b5189..db1de7d4ba4c7594d753f85b0e45449cc9f283e5 100644 (file)
--- 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 */