Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf report: Switch filtered from u8 to u16

We already have all u8 bits taken, adding one more filter leads to unpleasant
failure mode, where code compiles w/o warnings, but the last filters silently
don't work. Add a typedef and switch to u16.

Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Link: https://lore.kernel.org/r/32b4ce1731126c88a2d9e191dc87e39ae4651cb7.1739437531.git.dvyukov@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Dmitry Vyukov and committed by
Namhyung Kim
216f8a97 7ae1972e

+5 -3
+1 -1
tools/perf/util/addr_location.h
··· 17 17 const char *srcline; 18 18 u64 addr; 19 19 char level; 20 - u8 filtered; 21 20 u8 cpumode; 21 + u16 filtered; 22 22 s32 cpu; 23 23 s32 socket; 24 24 /* Same as machine.parallelism but within [1, nr_cpus]. */
+1 -1
tools/perf/util/hist.c
··· 585 585 return he; 586 586 } 587 587 588 - static u8 symbol__parent_filter(const struct symbol *parent) 588 + static filter_mask_t symbol__parent_filter(const struct symbol *parent) 589 589 { 590 590 if (symbol_conf.exclude_other && parent == NULL) 591 591 return 1 << HIST_FILTER__PARENT;
+3 -1
tools/perf/util/hist.h
··· 33 33 HIST_FILTER__C2C, 34 34 }; 35 35 36 + typedef u16 filter_mask_t; 37 + 36 38 enum hist_column { 37 39 HISTC_SYMBOL, 38 40 HISTC_TIME, ··· 246 244 bool leaf; 247 245 248 246 char level; 249 - u8 filtered; 247 + filter_mask_t filtered; 250 248 251 249 u16 callchain_size; 252 250 union {