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 <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9906
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Krzysztof Karas 2021-10-18 14:38:36 +00:00 committed by Jim Harris
parent 5594c7c847
commit 3c271d5e4c

View File

@ -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: