Skip to content

Commit

Permalink
fix incorrect merge
Browse files Browse the repository at this point in the history
  • Loading branch information
derekwbrown committed May 14, 2024
1 parent 06eee4f commit 77489b6
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions comp/etw/impl/etwSession.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,19 +218,6 @@ func createEtwSession(name string, f etw.SessionConfigurationFunc) (*etwSession,
if err != nil {
return nil, fmt.Errorf("incorrect session name; %w", err)
}
<<<<<<< HEAD
=======

// get any caller supplied configuration
cfg := &etw.SessionConfiguration{}
if f != nil {
f(cfg)
}

sessionNameSize := (len(utf16SessionName) * int(unsafe.Sizeof(utf16SessionName[0])))
bufSize := int(unsafe.Sizeof(C.EVENT_TRACE_PROPERTIES{})) + sessionNameSize
propertiesBuf := make([]byte, bufSize)
>>>>>>> 66cd601430 ([windows] Update ETW with new functions; add ability to get ETW stats)

// get any caller supplied configuration
if f != nil {
Expand All @@ -242,9 +229,6 @@ func createEtwSession(name string, f etw.SessionConfigurationFunc) (*etwSession,

propertiesBuf, pProperties := initializeRealtimeSessionProperties(s)

if cfg.MaxBuffers > 0 {
pProperties.MaximumBuffers = C.ulong(cfg.MaxBuffers)
}
ret := windows.Errno(C.StartTraceW(
&s.hSession,
C.LPWSTR(unsafe.Pointer(&s.utf16name[0])),
Expand Down Expand Up @@ -277,7 +261,6 @@ func createWellKnownEtwSession(name string, f etw.SessionConfigurationFunc) (*et
}

// get any caller supplied configuration
<<<<<<< HEAD
if f != nil {
f(&s.sessionConfig)
if s.sessionConfig.MaxBuffers != 0 && s.sessionConfig.MaxBuffers < s.sessionConfig.MinBuffers {
Expand All @@ -291,13 +274,6 @@ func createWellKnownEtwSession(name string, f etw.SessionConfigurationFunc) (*et

func initializeRealtimeSessionProperties(s *etwSession) ([]byte, C.PEVENT_TRACE_PROPERTIES) {
sessionNameSize := (len(s.utf16name) * int(unsafe.Sizeof(s.utf16name[0])))
=======
cfg := &etw.SessionConfiguration{}
if f != nil {
f(cfg)
}
sessionNameSize := (len(utf16SessionName) * int(unsafe.Sizeof(utf16SessionName[0])))
>>>>>>> 66cd601430 ([windows] Update ETW with new functions; add ability to get ETW stats)
bufSize := int(unsafe.Sizeof(C.EVENT_TRACE_PROPERTIES{})) + sessionNameSize
propertiesBuf := make([]byte, bufSize)

Expand All @@ -307,20 +283,11 @@ func initializeRealtimeSessionProperties(s *etwSession) ([]byte, C.PEVENT_TRACE_
pProperties.Wnode.Flags = C.WNODE_FLAG_TRACED_GUID

pProperties.LogFileMode = C.EVENT_TRACE_REAL_TIME_MODE
<<<<<<< HEAD
if s.sessionConfig.MaxBuffers > 0 {
pProperties.MaximumBuffers = C.ulong(s.sessionConfig.MaxBuffers)
}
if s.sessionConfig.MinBuffers > 0 {
pProperties.MinimumBuffers = C.ulong(s.sessionConfig.MinBuffers)
}
return propertiesBuf, pProperties
=======
if cfg.MaxBuffers > 0 {
pProperties.MaximumBuffers = C.ulong(cfg.MaxBuffers)
}

s.propertiesBuf = propertiesBuf
return s, nil
>>>>>>> 66cd601430 ([windows] Update ETW with new functions; add ability to get ETW stats)
}

0 comments on commit 77489b6

Please sign in to comment.