mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-26 08:20:18 +00:00
m1n1.trace.agx: Log structure UAT permissions as meta
Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
parent
b4c687ce13
commit
586be52ec5
3 changed files with 13 additions and 4 deletions
|
@ -347,7 +347,12 @@ class ConstructClassBase(Reloadable, metaclass=ReloadableConstructMeta):
|
||||||
self._apply(obj)
|
self._apply(obj)
|
||||||
|
|
||||||
if self._addr > 0x10000:
|
if self._addr > 0x10000:
|
||||||
g_struct_trace.add((self._addr, f"{cls.name} (end: {self._addr + size:#x})"))
|
desc = f"{cls.name} (end: {self._addr + size:#x})"
|
||||||
|
if getattr(stream, "meta_fn", None):
|
||||||
|
meta = stream.meta_fn(self._addr, None)
|
||||||
|
if meta is not None:
|
||||||
|
desc += " " + meta
|
||||||
|
g_struct_trace.add((self._addr, desc))
|
||||||
g_struct_addrmap[self._addr] = f"{cls.name}"
|
g_struct_addrmap[self._addr] = f"{cls.name}"
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|
|
@ -483,7 +483,7 @@ class Channel(Reloadable):
|
||||||
assert index < count
|
assert index < count
|
||||||
addr = self.rb_base[ring] + index * size
|
addr = self.rb_base[ring] + index * size
|
||||||
stream = self.uat.iostream(0, addr)
|
stream = self.uat.iostream(0, addr)
|
||||||
stream.meta_fn = meta_fn
|
stream.meta_fn = lambda a, b: meta_fn(0, a, b)
|
||||||
return msgcls.parse_stream(stream)
|
return msgcls.parse_stream(stream)
|
||||||
|
|
||||||
def clear_message(self, ring, index):
|
def clear_message(self, ring, index):
|
||||||
|
|
|
@ -586,7 +586,11 @@ class AGXTracer(ASCTracer):
|
||||||
self.vmcnt += 1
|
self.vmcnt += 1
|
||||||
#self.mon.poll()
|
#self.mon.poll()
|
||||||
|
|
||||||
def meta_gpuvm(self, iova, size):
|
def meta_gpuvm(self, ctx, iova, size=None):
|
||||||
|
if size is None:
|
||||||
|
pte = self.uat.ioperm(ctx, iova)
|
||||||
|
return f"PTE: {pte.describe()}"
|
||||||
|
|
||||||
meta = ""
|
meta = ""
|
||||||
iova &= 0xfffffffffff
|
iova &= 0xfffffffffff
|
||||||
for off in range(size):
|
for off in range(size):
|
||||||
|
@ -605,7 +609,7 @@ class AGXTracer(ASCTracer):
|
||||||
|
|
||||||
def get_stream(self, context, off):
|
def get_stream(self, context, off):
|
||||||
stream = self.uat.iostream(context, off)
|
stream = self.uat.iostream(context, off)
|
||||||
stream.meta_fn = self.meta_gpuvm
|
stream.meta_fn = lambda a, b: self.meta_gpuvm(context, a, b)
|
||||||
return stream
|
return stream
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
|
|
Loading…
Reference in a new issue