From ad23f75c1f283758beedf555adafd193714d0644 Mon Sep 17 00:00:00 2001 From: Krzysztof Karas Date: Mon, 27 Sep 2021 10:31:41 +0000 Subject: [PATCH] app/trace: include relation information while printing json Add relation information to printed json traces to later read them in trace.py. Change-Id: I090b7ffa2b85da00b6ad57825c7208dd5cfc396a Signed-off-by: Krzysztof Karas Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9637 Reviewed-by: Tomasz Zawadzki Reviewed-by: Konrad Sztyber Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI --- app/trace/trace.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/trace/trace.cpp b/app/trace/trace.cpp index 7432d0932..6eeb4724f 100644 --- a/app/trace/trace.cpp +++ b/app/trace/trace.cpp @@ -243,6 +243,14 @@ print_event_json(struct spdk_trace_parser_entry *entry, uint64_t tsc_rate, uint6 spdk_json_write_named_uint64(g_json, "value", e->object_id); spdk_json_write_object_end(g_json); } + + /* Print related objects array */ + if (entry->related_index != UINT64_MAX) { + spdk_json_write_named_string_fmt(g_json, "related", "%c%" PRIu64, + g_flags->object[entry->related_type].id_prefix, + entry->related_index); + } + if (d->num_args > 0) { spdk_json_write_named_array_begin(g_json, "args"); for (i = 0; i < d->num_args; ++i) {