Skip to content

Commit

Permalink
removed probes declaration when creating the manager
Browse files Browse the repository at this point in the history
added a detailed comment to explain the logic
  • Loading branch information
val06 committed Nov 6, 2024
1 parent c10a701 commit 1f40d96
Showing 1 changed file with 8 additions and 32 deletions.
40 changes: 8 additions & 32 deletions pkg/gpu/probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,38 +258,14 @@ func getAttacherConfig(cfg *config.Config) uprobes.AttacherConfig {

func getManager(buf io.ReaderAt, opts manager.Options) (*ddebpf.Manager, error) {
m := ddebpf.NewManagerWithDefault(&manager.Manager{
Probes: []*manager.Probe{
{
ProbeIdentificationPair: manager.ProbeIdentificationPair{
EBPFFuncName: cudaLaunchKernelProbe,
},
},
{
ProbeIdentificationPair: manager.ProbeIdentificationPair{
EBPFFuncName: cudaMallocProbe,
},
},
{
ProbeIdentificationPair: manager.ProbeIdentificationPair{
EBPFFuncName: cudaMallocRetProbe,
},
},
{
ProbeIdentificationPair: manager.ProbeIdentificationPair{
EBPFFuncName: cudaStreamSyncProbe,
},
},
{
ProbeIdentificationPair: manager.ProbeIdentificationPair{
EBPFFuncName: cudaStreamSyncRetProbe,
},
},
{
ProbeIdentificationPair: manager.ProbeIdentificationPair{
EBPFFuncName: cudaFreeProbe,
},
},
},
/* We don't init the probes list here, because the manager will try to attach them at startup
and fail since those are uprobes and their full path is resolved in runtime using the uprobeAttacher
the uprobeAttacher will add those probe later via manager.AddHook API
All manager's modifiers will still run as they operate on the ProgramSpecs map
of the manager,which is populated while parsing the elf file and creating the CollectionSpec
*/

Maps: []*manager.Map{
{
Name: cudaAllocCacheMap,
Expand Down

0 comments on commit 1f40d96

Please sign in to comment.