refactor: finding process and uid should to find with match process or uid rule, reduce memory allocation
This commit is contained in:
@ -21,6 +21,7 @@ func (ps *Process) Match(metadata *C.Metadata) bool {
|
||||
if ps.nameOnly {
|
||||
return strings.EqualFold(metadata.Process, ps.process)
|
||||
}
|
||||
|
||||
return strings.EqualFold(metadata.ProcessPath, ps.process)
|
||||
}
|
||||
|
||||
@ -32,6 +33,10 @@ func (ps *Process) Payload() string {
|
||||
return ps.process
|
||||
}
|
||||
|
||||
func (ps *Process) ShouldFindProcess() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func NewProcess(process string, adapter string, nameOnly bool) (*Process, error) {
|
||||
return &Process{
|
||||
Base: &Base{},
|
||||
|
Reference in New Issue
Block a user