mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-09-20 13:11:53 +00:00
m1n1.agx: Logging updates
Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
parent
610f3e6a11
commit
f829afcf80
5 changed files with 9 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
import bisect
|
||||
import bisect, time
|
||||
|
||||
from .object import GPUObject, GPUAllocator
|
||||
from .initdata import build_initdata
|
||||
|
@ -19,6 +19,7 @@ class AGX:
|
|||
PAGE_SIZE = 0x4000
|
||||
|
||||
def __init__(self, u):
|
||||
self.start_time = time.time()
|
||||
self.u = u
|
||||
self.p = u.proxy
|
||||
|
||||
|
@ -184,4 +185,5 @@ class AGX:
|
|||
self.asc.work()
|
||||
|
||||
def log(self, msg):
|
||||
print("[AGX] " + msg)
|
||||
t = time.time() - self.start_time
|
||||
print(f"[AGX][{t:10.03f}] " + msg)
|
||||
|
|
|
@ -59,7 +59,7 @@ class GPUCmdQueueChannel(GPUTXChannel):
|
|||
msg.event_number = event
|
||||
msg.new_queue = 1 if queue.first_time else 0
|
||||
queue.first_time = False
|
||||
print(msg)
|
||||
#print(msg)
|
||||
self.send_message(msg)
|
||||
|
||||
class GPUDeviceControlChannel(GPUTXChannel):
|
||||
|
|
|
@ -56,7 +56,7 @@ class GPUContext:
|
|||
#if isinstance(obj.val, ConstructClassBase):
|
||||
#obj.val._addr = obj._addr
|
||||
|
||||
print(f"[Context@{self.gpu_context._addr}] Map {obj._name} size {obj._size:#x} @ {obj._addr:#x} ({obj._paddr:#x})")
|
||||
self.agx.log(f"[Context@{self.gpu_context._addr}] Map {obj._name} size {obj._size:#x} @ {obj._addr:#x} ({obj._paddr:#x})")
|
||||
|
||||
self.agx.uat.iomap_at(self.ctx, obj._addr, obj._paddr, size_align, **flags)
|
||||
self.objects[obj._addr] = obj
|
||||
|
|
|
@ -131,5 +131,5 @@ def build_initdata(agx):
|
|||
|
||||
initdata.push()
|
||||
|
||||
print(initdata.val)
|
||||
#print(initdata.val)
|
||||
return initdata
|
||||
|
|
|
@ -149,7 +149,8 @@ class GPUAllocator:
|
|||
|
||||
self.objects[obj._addr] = obj
|
||||
|
||||
print(f"[{self.name}] Alloc {obj._name} size {obj._size:#x} @ {obj._addr:#x} ({obj._paddr:#x})")
|
||||
if self.verbose:
|
||||
self.agx.log(f"[{self.name}] Alloc {obj._name} size {obj._size:#x} @ {obj._addr:#x} ({obj._paddr:#x})")
|
||||
|
||||
self.agx.reg_object(obj, track=track)
|
||||
return obj
|
||||
|
|
Loading…
Reference in a new issue