@@ -242,13 +242,12 @@ func TestAddTraceAndTimes(t *testing.T) {
242242 assert .Equal (t , "0" , out .Trace .CustomLabels ["cuda_device" ])
243243 assert .Equal (t , "7" , out .Trace .CustomLabels ["cuda_stream" ])
244244
245- // Verify the CUDA frame got the demangled kernel name and zeroed AddressOrLineno.
245+ // Verify the CUDA frame got the kernel name and zeroed AddressOrLineno.
246246 cudaFrame := out .Trace .Frames [0 ].Value ()
247247 assert .Equal (t , libpf .CUDAKernelFrame , cudaFrame .Type )
248248 assert .Equal (t , libpf .AddressOrLineno (0 ), cudaFrame .AddressOrLineno ,
249249 "correlation ID should be zeroed in output" )
250- assert .Contains (t , cudaFrame .FunctionName .String (), "myKernel" ,
251- "kernel name should be demangled" )
250+ assert .Equal (t , "_Z9myKernelPfS_i" , cudaFrame .FunctionName .String ())
252251}
253252
254253func TestAddTimeThenTrace (t * testing.T ) {
@@ -293,7 +292,7 @@ func TestAddTimeThenTrace(t *testing.T) {
293292 assert .Equal (t , "1" , out .Trace .CustomLabels ["cuda_device" ])
294293
295294 cudaFrame := out .Trace .Frames [0 ].Value ()
296- assert .Contains (t , cudaFrame .FunctionName .String (), "square" )
295+ assert .Equal (t , "_Z6squarePfS_" , cudaFrame .FunctionName .String ())
297296 assert .Equal (t , libpf .AddressOrLineno (0 ), cudaFrame .AddressOrLineno )
298297}
299298
@@ -344,7 +343,7 @@ func TestCachedTemplateWithDifferentCorrelationIDs(t *testing.T) {
344343 assert .Equal (t , libpf .AddressOrLineno (0 ), cudaFrame .AddressOrLineno ,
345344 "correlation ID must not leak into output" )
346345 // Verify each launch got its own kernel name.
347- assert .Contains (t , cudaFrame .FunctionName .String (), tc . kernelName [ 3 : 10 ] ,
346+ assert .Equal (t , tc . kernelName , cudaFrame .FunctionName .String (),
348347 "each launch should get its own kernel name" )
349348 }
350349}
@@ -382,7 +381,7 @@ func TestCUDAFrameIdxNonZero(t *testing.T) {
382381 // The CUDA frame at index 2 should have the kernel name.
383382 cudaFrame := outputs [0 ].Trace .Frames [2 ].Value ()
384383 assert .Equal (t , libpf .CUDAKernelFrame , cudaFrame .Type )
385- assert .Contains (t , cudaFrame .FunctionName .String (), "test" )
384+ assert .Equal (t , "_Z4testv" , cudaFrame .FunctionName .String ())
386385
387386 // The non-CUDA frames should be untouched.
388387 for _ , idx := range []int {0 , 1 , 3 , 4 } {
0 commit comments