Skip to content

Commit

Permalink
usm: Include PathId in debug traced program list
Browse files Browse the repository at this point in the history
Currently it's possible to see things like the below where the same
paths are displayed as part of separate entries in the traced programs
list with no hint as to why this is the case.  Include the PathId to the
traced programs list to make it clear exactly which file (dev/inode) is
being traced.

Before:

 {
   "FilePath": "/usr/lib64/libssl.so.1.0.2k",
   "PIDs": [
     4275,
     1111324,
     3971,
     4240,
     4416,
     1110985
   ],
   "ProgramType": "shared_libraries"
 },
 {
   "FilePath": "/usr/lib64/libssl.so.1.0.2k",
   "PIDs": [
     7562
   ],
   "ProgramType": "shared_libraries"
 },

After:

 {
   "FilePath": "/usr/lib64/libssl.so.1.0.2k",
    "PathID": {
      "Dev": 64516,
      "Inode": 655961,
    },
   "PIDs": [
     4275,
     1111324,
     3971,
     4240,
     4416,
     1110985
   ],
   "ProgramType": "shared_libraries"
 },
 {
   "FilePath": "/usr/lib64/libssl.so.1.0.2k",
    "PathID": {
      "Dev": 130,
      "Inode": 4421665,
    },
   "PIDs": [
     7562
   ],
   "ProgramType": "shared_libraries"
 },
  • Loading branch information
vitkyrka committed Dec 18, 2024
1 parent 459aa24 commit cbaa50d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/network/usm/utils/debugger.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type Attacher interface {
type TracedProgram struct {
ProgramType string
FilePath string
PathID PathIdentifier
PIDs []uint32
}

Expand Down Expand Up @@ -131,6 +132,7 @@ func (d *tlsDebugger) GetTracedPrograms(moduleName string) []TracedProgram {

program.ProgramType = programType
program.FilePath = registration.sampleFilePath
program.PathID = pathID
}
registry.m.Unlock()

Expand Down

0 comments on commit cbaa50d

Please sign in to comment.