OSDN Git Service

perf tools: Extend PRINT_ATTRf to support printing of members with a value of 0
authorYang Jihong <yangjihong1@huawei.com>
Fri, 23 Jun 2023 05:44:14 +0000 (05:44 +0000)
committerNamhyung Kim <namhyung@kernel.org>
Sat, 24 Jun 2023 05:30:23 +0000 (22:30 -0700)
commit5492e72500646170cd409b14fe273e6d067b9fae
tree183a0268aabc19f2b2a1bc140ffe08a5a4bb8029
parent220f88b5a11a88539fbc44d2740c41bf995ecb45
perf tools: Extend PRINT_ATTRf to support printing of members with a value of 0

When printing attr, members whose value is 0 will not be printed, we want
to print the case where attr->type is 0(PERF_TYPE_HARDWARE), add `_a`
param to PRINT_ATTRf macro to always print member when it is true
No functional change.

Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: anshuman.khandual@arm.com
Cc: mark.rutland@arm.com
Cc: irogers@google.com
Cc: jesussanp@google.com
Cc: peterz@infradead.org
Cc: acme@kernel.org
Cc: jolsa@kernel.org
Cc: alexander.shishkin@linux.intel.com
Cc: mingo@redhat.com
Link: https://lore.kernel.org/r/20230623054416.160858-3-yangjihong1@huawei.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/perf_event_attr_fprintf.c