SWDEV-439757: Remove codeobj marker on last kernel. Fixed codeobj size limit. ATT version bump.

Change-Id: Ie0b9c4de6c37acaaad4ae7d8d774d234a3847b7c


[ROCm/rocprofiler commit: 067071f669]
This commit is contained in:
Giovanni LB
2024-01-10 13:29:26 -03:00
parent 207815802b
commit 68cfdd66ba
5 changed files with 41 additions and 32 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ import gc
from collections import defaultdict
from service import CodeobjService
ATT_VERSION = 3
ATT_VERSION = 4
class TraceData(ctypes.Structure):
_fields_ = [
@@ -299,7 +299,7 @@ def persist(trace_file, SIMD, traces):
br_stalls.append(wave.num_branch_stalls)
timeline.append(wave.timeline)
cc = 1
cc = 0
insts = []
skips = traces[wave.traceid].instructions[-1]
try:
+4 -4
View File
@@ -10,9 +10,9 @@ import os
HEADER_OFFSET = 62
HEADER_MASK = 0x3
ID_OFFSET = 30
ID_MASK = (1<<32)-1
OFFSET_MASK = (1<<30)-1
ID_OFFSET = 34
ID_MASK = (1<<28)-1
OFFSET_MASK = (1<<ID_OFFSET)-1
pluginpath = '../../../lib/rocprofiler/libatt_plugin.so'
filedir = os.path.dirname(os.path.realpath(__file__))
@@ -92,7 +92,7 @@ class CodeobjService:
instance.release()
def GetInstruction(self, addr):
if addr >> HEADER_OFFSET != 0:
if not IsRawPC(addr):
return self.GetInstructionFromID(getID(addr), getOffset(addr))
else:
return self.GetInstructionFromAddr(addr)
+22 -20
View File
@@ -26,6 +26,7 @@ SETPC = 12
SWAPPC = 13
LANEIO = 14
PCINFO = 15
WAVE_ENDED = 16
DONT_KNOW = 100
WaveInstCategory = {
@@ -48,6 +49,7 @@ WaveInstCategory = {
SWAPPC: "SWAPPC",
LANEIO: "LANEIO",
PCINFO: "PCINFO",
WAVE_ENDED: "WAVE_ENDED",
DONT_KNOW: "DONT_KNOW",
}
@@ -361,8 +363,8 @@ def stitch(insts, raw_code, jumps, gfxv, bIsAuto, codeservice):
while i < N and line >= 0 and loops < MAX_STITCHED_TOKENS:
if insts[i].type == PCINFO:
i += 1
pcskip.append(i)
i += 1
continue
loops += 1
@@ -395,32 +397,30 @@ def stitch(insts, raw_code, jumps, gfxv, bIsAuto, codeservice):
elif as_line[1] == SETPC:
next = watchlist.setpc(as_line[0], i)
matched = inst.type in [SALU, JUMP]
if bIsAuto:
i += 1
pcskip.append(i)
while bIsAuto and next < 0 and i+1 < len(insts):
i += 1
pcskip.append(i+1)
while next < 0 and i+1 < len(insts):
i += 1
if insts[i].type == PCINFO:
next = watchlist.setpc(as_line[0], i-1)
pcskip.append(i+1)
else:
inst.cycles += insts[i].cycles
if insts[i].type == PCINFO:
pcskip.append(i)
next = watchlist.setpc(as_line[0], i-1)
else:
inst.cycles += insts[i].cycles
if next < 0:
print('Jump to unknown location in line', as_line[0])
break
elif as_line[1] == SWAPPC:
matched = inst.type in [SALU, JUMP]
next = watchlist.swappc(as_line[0], line, i)
if bIsAuto:
i += 1
pcskip.append(i)
while bIsAuto and next < 0 and i+1 < len(insts):
i += 1
pcskip.append(i+1)
while next < 0 and i+1 < len(insts):
i += 1
if insts[i].type == PCINFO:
next = watchlist.swappc(as_line[0], line, i-1)
pcskip.append(i+1)
else:
inst.cycles += insts[i].cycles
if insts[i].type == PCINFO:
next = watchlist.swappc(as_line[0], line, i-1)
pcskip.append(i)
else:
inst.cycles += insts[i].cycles
if next < 0:
print('Jump to unknown location in line', as_line[0])
break
@@ -560,7 +560,9 @@ def stitch(insts, raw_code, jumps, gfxv, bIsAuto, codeservice):
line = next
N = max(N, 1)
if i != N:
if i != N and insts[i].type == WAVE_ENDED:
print('Warning - Wave ended.')
elif i < N:
print('Warning - Stitching rate: '+str(i * 100 / N)+'% matched', i, ' of ', N)
print('Leftovers:', [WaveInstCategory[insts[i+k].type] for k in range(20) if i+k < len(insts)])
try: