Skip to content

Commit

Permalink
remove flush and cleanup as well
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcacheux committed Jun 16, 2024
1 parent 5a52177 commit 4d65c42
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
17 changes: 0 additions & 17 deletions pkg/security/probe/probe_kernel_file_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,6 @@ type cleanupArgs struct {
// nolint: unused
type closeArgs cleanupArgs

// nolint: unused
type flushArgs cleanupArgs

func (wp *WindowsProbe) parseCleanupArgs(e *etw.DDEventRecord) (*cleanupArgs, error) {
ca := &cleanupArgs{
DDEventHeader: e.EventHeader,
Expand Down Expand Up @@ -457,15 +454,6 @@ func (wp *WindowsProbe) parseCloseArgs(e *etw.DDEventRecord) (*closeArgs, error)
return (*closeArgs)(ca), nil
}

// nolint: unused
func (wp *WindowsProbe) parseFlushArgs(e *etw.DDEventRecord) (*flushArgs, error) {
ca, err := wp.parseCleanupArgs(e)
if err != nil {
return nil, err
}
return (*flushArgs)(ca), nil
}

// nolint: unused
func (ca *cleanupArgs) string(t string) string {
var output strings.Builder
Expand All @@ -488,11 +476,6 @@ func (ca *closeArgs) String() string {
return (*cleanupArgs)(ca).string("CLOSE")
}

// nolint: unused
func (fa *flushArgs) String() string {
return (*cleanupArgs)(fa).string("FLUSH")
}

type readArgs struct {
etw.DDEventHeader
ByteOffset uint64
Expand Down
19 changes: 0 additions & 19 deletions pkg/security/probe/probe_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,16 +472,6 @@ func (p *WindowsProbe) setupEtw(ecb etwCallback) error {
p.stats.fileProcessedNotifications[e.EventHeader.EventDescriptor.ID]++
p.stats.fpnLock.Unlock()

ecb(ca, e.EventHeader.ProcessID)
}
case idCleanup:
if ca, err := p.parseCleanupArgs(e); err == nil {
log.Tracef("Received cleanup event %d %s\n", e.EventHeader.EventDescriptor.ID, ca)

p.stats.fpnLock.Lock()
p.stats.fileProcessedNotifications[e.EventHeader.EventDescriptor.ID]++
p.stats.fpnLock.Unlock()

ecb(ca, e.EventHeader.ProcessID)
}
case idClose:
Expand All @@ -497,15 +487,6 @@ func (p *WindowsProbe) setupEtw(ecb etwCallback) error {
p.discardedFileHandles.Remove(ca.fileObject)
p.filePathResolver.Remove(ca.fileObject)
}
case idFlush:
if fa, err := p.parseFlushArgs(e); err == nil {

p.stats.fpnLock.Lock()
p.stats.fileProcessedNotifications[e.EventHeader.EventDescriptor.ID]++
p.stats.fpnLock.Unlock()

ecb(fa, e.EventHeader.ProcessID)
}

case idWrite:
if p.isWriteEnabled {
Expand Down

0 comments on commit 4d65c42

Please sign in to comment.