From 59819338ab4533bb8c70f8a5132f9908b9cac5f6 Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Tue, 13 Mar 2018 23:46:14 +0100 Subject: [PATCH] print_fields.h: add PRINT_FIELD_U64 for printing u64 with UINT64_MAX handling * print_fields.h (PRINT_FIELD_U64): New macro. --- print_fields.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/print_fields.h b/print_fields.h index 0b810d5c..99c0cc13 100644 --- a/print_fields.h +++ b/print_fields.h @@ -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_); \ -- 2.40.0