print_fields.h: add PRINT_FIELD_U64 for printing u64 with UINT64_MAX handling

* print_fields.h (PRINT_FIELD_U64): New macro.
This commit is contained in:
Eugene Syromyatnikov 2018-03-13 23:46:14 +01:00 committed by Dmitry V. Levin
parent 2342efed27
commit 59819338ab

View File

@ -106,6 +106,16 @@
#define PRINT_FIELD_UID PRINT_FIELD_ID
#define PRINT_FIELD_U64(prefix_, where_, field_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \
if (zero_extend_signed_to_ull((where_).field_) == UINT64_MAX) \
print_xlat_ex(UINT64_MAX, "UINT64_MAX", XLAT_STYLE_FMT_U); \
else \
STRACE_PRINTF("%llu", \
zero_extend_signed_to_ull((where_).field_)); \
} while (0)
#define PRINT_FIELD_STRING(prefix_, where_, field_, len_, style_) \
do { \
STRACE_PRINTF("%s%s=", (prefix_), #field_); \