Skip to content

Commit

Permalink
adding process tree to AP
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Bertschy <[email protected]>
  • Loading branch information
matthyx committed Jan 9, 2025
1 parent 5d7cdf3 commit 1e812b4
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 10 deletions.
26 changes: 21 additions & 5 deletions pkg/apis/softwarecomposition/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,10 @@ type RulePolicy struct {
}

type ExecCalls struct {
Path string
Args []string
Envs []string
Path string
Args []string
Envs []string
ProcessTree StackTrace
}

const sep = "␟"
Expand All @@ -267,8 +268,9 @@ func (e ExecCalls) String() string {
}

type OpenCalls struct {
Path string
Flags []string
Path string
Flags []string
ProcessTree StackTrace
}

func (e OpenCalls) String() string {
Expand All @@ -282,6 +284,20 @@ func (e OpenCalls) String() string {
return s.String()
}

type StackTrace struct {
Root FileName
Nodes map[FileName]StackFrame
}

type StackFrame struct {
File FileName
Address uint64
Children []FileName
Parents []FileName
}

type FileName string

type ApplicationProfileStatus struct {
}

Expand Down
26 changes: 21 additions & 5 deletions pkg/apis/softwarecomposition/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,32 @@ type ApplicationProfileContainer struct {
}

type ExecCalls struct {
Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"`
Args []string `json:"args,omitempty" protobuf:"bytes,2,opt,name=args"`
Envs []string `json:"envs,omitempty" protobuf:"bytes,3,opt,name=envs"`
Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"`
Args []string `json:"args,omitempty" protobuf:"bytes,2,opt,name=args"`
Envs []string `json:"envs,omitempty" protobuf:"bytes,3,opt,name=envs"`
ProcessTree StackTrace `json:"processTree,omitempty" protobuf:"bytes,4,opt,name=processTree"`
}

type OpenCalls struct {
Path string `json:"path" yaml:"path" protobuf:"bytes,1,req,name=path"`
Flags []string `json:"flags" yaml:"flags" protobuf:"bytes,2,rep,name=flags"`
Path string `json:"path" yaml:"path" protobuf:"bytes,1,req,name=path"`
Flags []string `json:"flags" yaml:"flags" protobuf:"bytes,2,rep,name=flags"`
ProcessTree StackTrace `json:"processTree,omitempty" protobuf:"bytes,4,opt,name=processTree"`
}

type StackTrace struct {
Root FileName `json:"root" protobuf:"bytes,1,opt,name=root"`
Nodes map[FileName]StackFrame `json:"nodes" protobuf:"bytes,2,rep,name=nodes"`
}

type StackFrame struct {
File FileName `json:"file" protobuf:"bytes,1,opt,name=file"`
Address uint64 `json:"address" protobuf:"bytes,2,opt,name=address"`
Children []FileName `json:"children" protobuf:"bytes,3,rep,name=children"`
Parents []FileName `json:"parents" protobuf:"bytes,4,rep,name=parents"`
}

type FileName string

type ApplicationProfileStatus struct {
}

Expand Down

0 comments on commit 1e812b4

Please sign in to comment.