Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
Signed-off-by: grantseltzer <[email protected]>
  • Loading branch information
grantseltzer committed Dec 19, 2024
1 parent 0c6b9ae commit c94fbc0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pkg/dynamicinstrumentation/diconfig/config_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (cm *RCConfigManager) installConfigProbe(procInfo *ditypes.ProcessInfo) err
svcConfigProbe := *configProbe
svcConfigProbe.ServiceName = procInfo.ServiceName
procInfo.ProbesByID[configProbe.ID] = &svcConfigProbe
log.Infof("Installing config probe for service: %s.", svcConfigProbe.ServiceName)
log.Infof("Installing config probe for service: %s", svcConfigProbe.ServiceName)
err = AnalyzeBinary(procInfo)
if err != nil {
return fmt.Errorf("could not analyze binary for config probe: %w", err)
Expand Down
20 changes: 10 additions & 10 deletions pkg/dynamicinstrumentation/ditypes/analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ type TypeMap struct {

// Parameter represents a function parameter as read from DWARF info
type Parameter struct {
Name string
ID string
Type string
TotalSize int64
Kind uint
Location *Location
LocationExpressions []LocationExpression
FieldOffset uint64
NotCaptureReason NotCaptureReason
ParameterPieces []*Parameter
Name string // Name is populated by the local name of the parameter
ID string // ID is randomly generated for each parameter to avoid
Type string // Type is a string representation of the type name
TotalSize int64 // TotalSize is the size of the parameter type
Kind uint // Kind is a constant representation of the type, see reflect.Kind
Location *Location // Location represents where the parameter will be in memory when passed to the target function
LocationExpressions []LocationExpression // LocationExpressions are the needed instructions for extracting the parameter value from memory
FieldOffset uint64 // FieldOffset is the offset of Parameter field within a struct, if it is a struct field
NotCaptureReason NotCaptureReason // NotCaptureReason conveys to the user why the parameter was not captured
ParameterPieces []*Parameter // ParameterPieces are the sub-fields, such as struct fields or array elements
}

func (p Parameter) String() string {
Expand Down
3 changes: 3 additions & 0 deletions pkg/dynamicinstrumentation/ditypes/arch_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@

package ditypes

// StackRegister is the register containing the address of the
// program stack. On x86 DWARF maps the register number 7 to
// the stack pointer.
const StackRegister = 7
3 changes: 3 additions & 0 deletions pkg/dynamicinstrumentation/ditypes/arch_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@

package ditypes

// StackRegister is the register containing the address of the
// program stack. On ARM64 DWARF maps the register number 29 to
// the stack pointer.
const StackRegister = 29

0 comments on commit c94fbc0

Please sign in to comment.