Commit Graph
160 Commits
Author SHA1 Message Date
CodeLingo Bot ea6bc01ef5 Fix function comments based on best practices from Effective Go
Signed-off-by: CodeLingo Bot <bot@codelingo.io>
2019-03-11 00:56:50 +00:00
John Howard 1a8911d1ed Merge pull request #110 from Microsoft/jjh/lineendings
Convert to Uix line endings
2019-02-21 09:35:31 -08:00
John Howard c16103c642 Convert to UNix line endings
Signed-off-by: John Howard <jhoward@microsoft.com>
2019-02-21 09:33:18 -08:00
Kevin Parsons 75bf6ca3d7 Merge pull request #108 from kevpar/etw-set-provider-info
Set ETW provider info so it's always treated as TraceLogging
2019-01-17 13:15:22 -08:00
Kevin Parsons 7dba96a333 Set ETW provider info so it's always treated as TraceLogging
Signed-off-by: Kevin Parsons <kevpar@ntdev.microsoft.com>
2019-01-17 10:45:50 -08:00
Justin 16cfc97580 Merge pull request #107 from Microsoft/etw_generator
Add a simple tool to generate provider ID's
2019-01-15 21:26:04 -08:00
Justin Terry (VM) 950c57133f Add a simple tool to generate provider ID's
Also implements the Stringer interface for etw.Provider to output the ID

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
2019-01-15 15:56:17 -08:00
Justin 6c8aa416ae Merge pull request #106 from kevpar/etw-moretypes
Support logging more Go types to ETW
2019-01-11 13:49:48 -08:00
Kevin Parsons 6e71d2839c Add test cases for logging empty slices
Signed-off-by: Kevin Parsons <kevpar@ntdev.microsoft.com>
2019-01-11 12:22:02 -08:00
Kevin Parsons 515e920a0a Support logging more Go types to ETW
Signed-off-by: Kevin Parsons <kevpar@ntdev.microsoft.com>
2019-01-10 11:08:01 -08:00
Kevin Parsons a0ca357ef7 Merge pull request #104 from kevpar/etw-nofields
Support ETW events with no data fields
2019-01-08 12:25:37 -08:00
Kevin Parsons b08043063d Merge branch 'master' into etw-nofields 2019-01-08 11:28:28 -08:00
Kevin Parsons f8ca910a3b Merge pull request #105 from kevpar/etw-activityid
Support ETW activity ID
2019-01-08 11:23:21 -08:00
Kevin Parsons 1844c5213b Support ETW activity ID 2019-01-07 16:01:46 -08:00
Kevin Parsons e82c358c71 Support ETW events with no data fields 2019-01-07 15:49:09 -08:00
Kevin Parsons 763dedbc18 Merge pull request #103 from kevpar/etw
Add basic Go ETW implementation
2019-01-03 16:09:57 -08:00
Kevin Parsons 82fc62aed2 Return error from WriteEvent in Logrus hook 2019-01-03 16:08:24 -08:00
Kevin Parsons d23783336b Fix indices in provider name to ID 2019-01-03 14:57:37 -08:00
Kevin Parsons 37af28e005 Pass blob pointers safely to ETW 2019-01-03 13:57:57 -08:00
Kevin Parsons b87cea3696 Clean up and PR feedback 2019-01-03 13:08:23 -08:00
Kevin Parsons fac5ca0c3a Separate ETW into low-level and high-level API 2018-12-21 16:18:22 -08:00
Kevin Parsons 7c26c75173 Add ETW support for arrays 2018-12-21 10:10:06 -08:00
Kevin Parsons 50cf0baa2f Support auto-generation of ETW provider ID 2018-12-20 14:05:36 -08:00
Kevin Parsons 82ad381699 Add ETW support for out type and tags 2018-12-20 01:28:55 -08:00
Kevin Parsons 824a366a22 Make etw package internal 2018-12-19 01:52:15 -08:00
Kevin Parsons 32544c5852 Merge branch 'etw' of https://github.com/kevpar/go-winio into etw 2018-12-19 01:44:38 -08:00
Kevin Parsons dcfdf4a9f6 Improve ETW callback support and track provider enable state 2018-12-19 01:42:44 -08:00
Kevin Parsons 35e42dab22 Address PR feedback 2018-12-19 01:38:48 -08:00
John Starksandkevpar 98d07c865e Update pkg/etw/event.go
Co-Authored-By: kevpar <kevpar@users.noreply.github.com>
2018-12-18 18:20:29 -08:00
Kevin Parsons cd4b2fefe9 Change from reflection to type switch in Logrus hook 2018-12-13 17:23:55 -08:00
Kevin Parsons 62f7a6b7b9 Rearrange etw packages 2018-12-13 14:26:45 -08:00
Kevin Parsons bb628025f5 Clean up some types and comments 2018-12-13 14:12:44 -08:00
Kevin Parsons 083046a6cd Add comments 2018-12-12 18:20:51 -08:00
Kevin Parsons 899181905d Add basic Go ETW implementation 2018-12-12 16:05:33 -08:00
Justin 97e4973ce5 Merge pull request #91 from Microsoft/detach
Added DetachVhd
2018-08-23 15:24:21 -07:00
John Howard 275ee76c20 Add DetachVhd entrypoint
Signed-off-by: John Howard <jhoward@microsoft.com>
2018-08-23 15:01:31 -07:00
Justin 399410cd8c Merge pull request #92 from Microsoft/dos2unix
Convert all files to unix line endings
2018-08-23 14:58:28 -07:00
John Howard 09c0aff8d5 Convert all files to unix line endings
Signed-off-by: John Howard <jhoward@microsoft.com>
2018-08-23 14:56:23 -07:00
Justin 78a084671d Merge pull request #88 from jiria/fileattributes_size
Update FileAttributes size to work across all platforms
2018-08-06 13:04:50 -07:00
Jiri Appl 5380df2ba5 Changes based on PR 2018-08-03 12:01:41 -07:00
Jiri Appl 350b9857de Update FileAttributes size to work on 32 bit platforms 2018-08-02 10:42:57 -07:00
John Starks a6d595ae73 Merge pull request #80 from nanomsg/norace2
fixes #67 DialPipe problem with multiple calls / waiting for busy pipe
2018-07-19 15:37:18 -07:00
Garrett D'Amore effecfb659 Reduce the timeout to 2 seconds, and close the client handle.
We can safely close the client handle, because the server side
is not closed, and thsi keeps our hold on the pipe instance.
2018-07-18 12:07:29 -07:00
John Starks 67921128fb Merge pull request #82 from jstarks/pipe_message_mode
Support pipe message read mode
2018-06-25 13:58:01 -07:00
John Starks 3eabd1969d Clean up message mode pipe handling, add test 2018-06-25 09:31:55 -07:00
Garrett D'Amore ecd994be06 fixes #67 DialPipe problem with multiple calls / waiting for busy pipe
This changes a few things to try to ensure that we never wind up with
a result of ERROR_FILE_NOT_FOUND, due to a race between closing the
last pipe instance and opening the next.

First we keep an "open" client instance (unused) while the listener
is open, so that we are guaranteed to always have an active pipe
instance.  This means attempts to open while no other instances exist
result in ERROR_PIPE_BUSY instead of ERROR_FILE_NOT_FOUND.

Second we have changed the loop for dialing to eliminate a race condition
that is more or less inherent in WaitNamedPipe when synchronizing with
CreateFile.  The real timeout needs to be some larger value than the
WaitNamedPipe timeout, and furthermore WaitNamedPipe is not very nice
with the Go runtime, since it is a blocking system call.  Instead we
just put the goroutine to sleep for 10 milliseconds, and keep retrying
the CreateFile until the maximum timeout is reached.  If no timeout is
specified we assume a reasonable and large default of 5 seconds, which is
similar to a TCP connection timeout.

This isn't perfect, as a client attempting to connect to an extremely
busy pipe server can be starved out by other clients coming in while
it is in that brief sleep, but this potential race was already present
with WaitNamedPipe.  The numerous retries (by default 500 retries!)
mean its pretty unlikely to occur, and if a single client hits the
race once, it has an excellent chance of getting in the next cycle.

(A real "fix" that is completely race free and fair would require
changes in the underlying Named Pipe implementation, or some other
kind of external coordination.)
2018-06-24 11:39:09 -07:00
Tejaswini Duggaraju 3f914f36b8 Tread ERROR_MORE_DATA as success and return the remaining n number of bytes required to be read. 2018-05-25 13:37:14 -07:00
Tejaswini Duggaraju 211d6ebb39 Allow for message pipes in message readmode for Windows named pipes. 2018-05-25 12:13:39 -07:00
John Howard ab35fc04b6 Merge pull request #77 from johnstep/fix-valid-sid-test
Call Fatalf to use the format specifier
2018-05-01 10:05:46 -07:00
John Stephens 1891e2bbff Call Fatalf to use the format specifier
Signed-off-by: John Stephens <johnstep@docker.com>
2018-04-30 16:52:55 -07:00