Skip to content

Commit 4e072e7

Browse files
committed
Fix GPU collector
1 parent 4c4da74 commit 4e072e7

File tree

5 files changed

+3
-5
lines changed

5 files changed

+3
-5
lines changed

parcagpu/parcagpu.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func Start(ctx context.Context, tr *tracer.Tracer,
111111
var cbid int32
112112
for frames := libpf.EbpfFrame(rawTrace.FrameData); len(frames) > 0; frames = frames[frames.Length():] {
113113
if frames.Type() == libpf.CUDAKernelFrame {
114-
lineno := frames.Data()
114+
lineno := frames.Variable(0)
115115
correlationID = uint32(lineno)
116116
cbid = int32(lineno >> 32)
117117
break

processmanager/manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ func (pm *ProcessManager) convertFrame(pid libpf.PID, ef libpf.EbpfFrame, dst *l
260260
// Preserve AddressOrLineno which encodes correlation ID | (CBID << 32).
261261
dst.Append(&libpf.Frame{
262262
Type: ef.Type(),
263-
AddressOrLineno: libpf.AddressOrLineno(ef.Data()),
263+
AddressOrLineno: libpf.AddressOrLineno(ef.Variable(0)),
264264
})
265265
default:
266266
err := pm.symbolizeFrame(pid, ef, dst, libpf.FrameMapping{})

support/ebpf/tracemgmt.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -787,12 +787,10 @@ static inline EBPF_INLINE int collect_trace(
787787
if (cuda_id != 0) {
788788
// Create a CUDA kernel frame, Symbolize will later resolve the kernel name from the ID.
789789
u64 *data =
790-
push_frame(&record->state, trace, FRAME_MARKER_CUDA_KERNEL, FRAME_FLAG_PID_SPECIFIC, 0, 2);
790+
push_frame(&record->state, trace, FRAME_MARKER_CUDA_KERNEL, FRAME_FLAG_PID_SPECIFIC, 0, 1);
791791
if (!data)
792792
return ERR_STACK_LENGTH_EXCEEDED;
793793
data[0] = cuda_id;
794-
// this is used by userland to stash the kernel name pointer
795-
data[1] = 0;
796794
}
797795

798796
// Recursive unwind frames

support/ebpf/tracer.ebpf.amd64

-112 Bytes
Binary file not shown.

support/ebpf/tracer.ebpf.arm64

-112 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)