From 953b26bd6d41f714051536b8b64b992a50b6d80c Mon Sep 17 00:00:00 2001 From: Krzysztof Karas Date: Mon, 18 Oct 2021 14:38:36 +0000 Subject: [PATCH] scripts/bpf/trace.py: enable printing relations for NativeProvider Currently the only way to see the relations, while using trace.py script, is to feed it a JSON formatted file. This patch allows trace.py to do the same for the for the binary trace files. Change-Id: I7237896ede608080d3bec896a43586e34c297b04 Signed-off-by: Krzysztof Karas Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9906 Reviewed-by: Tomasz Zawadzki Reviewed-by: Konrad Sztyber Reviewed-by: Jim Harris Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins --- scripts/bpf/trace.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/bpf/trace.py b/scripts/bpf/trace.py index 3bb19218d..9f0bd2faa 100755 --- a/scripts/bpf/trace.py +++ b/scripts/bpf/trace.py @@ -405,10 +405,15 @@ class NativeProvider(TraceProvider): else: poller_id = None + if pe.related_type != OBJECT_NONE: + related = '{}{}'.format(self._objects[pe.related_type], pe.related_index) + else: + related = None + yield TraceEntry(tpoint=tpoint, lcore=lcore, tsc=entry.tsc, size=entry.size, object_id=object_id, object_ptr=entry.object_id, poller=poller_id, time=ts, - args=args, related=None) + args=args, related=related) class Trace: