perf hist: Shrink struct hist_entry size
authorDmitry Vyukov <dvyukov@google.com>
Thu, 13 Feb 2025 09:08:22 +0000 (10:08 +0100)
committerNamhyung Kim <namhyung@kernel.org>
Tue, 18 Feb 2025 22:04:32 +0000 (14:04 -0800)
Reorder the struct fields by size to reduce paddings and reduce
struct simd_flags size from 8 to 1 byte.

This reduces struct hist_entry size by 8 bytes (592->584),
and leaves a single more usable 6 byte padding hole.

Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Link: https://lore.kernel.org/r/7c1cb1c8f9901e945162701ba7269d0f9c70be89.1739437531.git.dvyukov@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/hist.h
tools/perf/util/sample.h

index 29d4c7a3d174736a4c780d750e5db2be2c3855c1..317d06cca8b88e3ea45cb80fff9a47318ae39fdc 100644 (file)
@@ -239,16 +239,16 @@ struct hist_entry {
        u64                     cgroup;
        u64                     ip;
        u64                     transaction;
-       s32                     socket;
-       s32                     cpu;
-       int                     parallelism;
        u64                     code_page_size;
        u64                     weight;
        u64                     ins_lat;
        u64                     p_stage_cyc;
+       s32                     socket;
+       s32                     cpu;
+       int                     parallelism;
+       int                     mem_type_off;
        u8                      cpumode;
        u8                      depth;
-       int                     mem_type_off;
        struct simd_flags       simd_flags;
 
        /* We are added by hists__add_dummy_entry. */
index bbf71e6406c4519921f88b93043c0c7a39c8c981..0e96240052e9ec66e2652172457294daf702bfa8 100644 (file)
@@ -67,7 +67,7 @@ struct aux_sample {
 };
 
 struct simd_flags {
-       u64     arch:1, /* architecture (isa) */
+       u     arch:1, /* architecture (isa) */
                pred:2; /* predication */
 };