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

Configure Feed

Select the types of activity you want to include in your feed.

perf trace beauty: Always show param if show_zero is set

For some parameters, it is best to also display them when they are 0,
e.g. flags.

Here we only check the show_zero property and let arg printer handle
special cases.

Signed-off-by: Changbin Du <changbin.du@huawei.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240522033542.1359421-2-changbin.du@huawei.com

authored by

Changbin Du and committed by
Namhyung Kim
92968dcc a93c83ec

+7 -22
+7 -22
tools/perf/builtin-trace.c
··· 2091 2091 val = syscall_arg_fmt__mask_val(&sc->arg_fmt[arg.idx], &arg, val); 2092 2092 2093 2093 /* 2094 - * Suppress this argument if its value is zero and 2095 - * and we don't have a string associated in an 2096 - * strarray for it. 2097 - */ 2098 - if (val == 0 && 2099 - !trace->show_zeros && 2100 - !(sc->arg_fmt && 2101 - (sc->arg_fmt[arg.idx].show_zero || 2102 - sc->arg_fmt[arg.idx].scnprintf == SCA_STRARRAY || 2103 - sc->arg_fmt[arg.idx].scnprintf == SCA_STRARRAYS) && 2104 - sc->arg_fmt[arg.idx].parm)) 2094 + * Suppress this argument if its value is zero and show_zero 2095 + * property isn't set. 2096 + */ 2097 + if (val == 0 && !trace->show_zeros && 2098 + !(sc->arg_fmt && sc->arg_fmt[arg.idx].show_zero)) 2105 2099 continue; 2106 2100 2107 2101 printed += scnprintf(bf + printed, size - printed, "%s", printed ? ", " : ""); ··· 2790 2796 */ 2791 2797 val = syscall_arg_fmt__mask_val(arg, &syscall_arg, val); 2792 2798 2793 - /* 2794 - * Suppress this argument if its value is zero and 2795 - * we don't have a string associated in an 2796 - * strarray for it. 2797 - */ 2798 - if (val == 0 && 2799 - !trace->show_zeros && 2800 - !((arg->show_zero || 2801 - arg->scnprintf == SCA_STRARRAY || 2802 - arg->scnprintf == SCA_STRARRAYS) && 2803 - arg->parm)) 2799 + /* Suppress this argument if its value is zero and show_zero property isn't set. */ 2800 + if (val == 0 && !trace->show_zeros && !arg->show_zero) 2804 2801 continue; 2805 2802 2806 2803 printed += scnprintf(bf + printed, size - printed, "%s", printed ? ", " : "");