From e7da88dd66b58f98f54985f3c096f02579313b14 Mon Sep 17 00:00:00 2001 From: Nick Connolly Date: Tue, 6 Jul 2021 11:20:35 +0100 Subject: [PATCH] app/trace: Use PRIu64 for portability POSIX defines PRId64/PRIu64/PRIx64 for printing 64-bit values in a portable way. Replace a reference to %lu to remove the assumption about the size of a long. Signed-off-by: Nick Connolly Change-Id: I5696bcdb3add3d8b9d5ea91d9bc50b1dad1fbc95 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8685 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Konrad Sztyber Reviewed-by: Shuhei Matsumoto Reviewed-by: Aleksey Marchuk --- app/trace/trace.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/trace/trace.cpp b/app/trace/trace.cpp index cf3ef14aa..2c4644895 100644 --- a/app/trace/trace.cpp +++ b/app/trace/trace.cpp @@ -369,12 +369,12 @@ print_event_json(struct spdk_trace_entry *e, uint64_t tsc_rate, spdk_json_write_named_object_begin(g_json, "object"); if (d->new_object) { object_type = g_histories->flags.object[d->object_type].id_prefix; - spdk_json_write_named_string_fmt(g_json, "id", "%c%lu", object_type, + spdk_json_write_named_string_fmt(g_json, "id", "%c%" PRIu64, object_type, stats->index[e->object_id]); } else if (d->object_type != OBJECT_NONE) { object_type = g_histories->flags.object[d->object_type].id_prefix; if (stats->start.find(e->object_id) != stats->start.end()) { - spdk_json_write_named_string_fmt(g_json, "id", "%c%lu", + spdk_json_write_named_string_fmt(g_json, "id", "%c%" PRIu64, object_type, stats->index[e->object_id]); spdk_json_write_named_uint64(g_json, "time",