Commit Graph
58 Commits
Author SHA1 Message Date
Thomas d4c02ad896 Add missing build constraints 2021-02-10 23:54:19 +00:00
Thomas f0d2c76ab3 Fix missing platform/architecture separation 2021-02-10 23:09:41 +00:00
Thomas eb9d8c9346 Separate platform from architecture build constraints 2021-02-10 23:05:19 +00:00
Thomas Way 9d8277341f Add build guards for all Windows imports 2021-01-21 23:24:01 +00:00
Kevin Parsons f272bf30b3 Add new process package
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-09-18 18:03:14 -07:00
Kevin Parsons c20fb68775 etw: Add test for provider name to GUID conversion
Also simplified the name to GUID conversion code, and improved the
comments.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-07-10 15:12:20 -07:00
Kevin Parsons 177d2ec7ea guid: Add V5 GUID support
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-07-10 15:08:22 -07:00
Kevin Parsons c5294c98c0 guid: Improve version and variant handling
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-07-10 15:03:44 -07:00
Eric Hotinger 28396ed851 Updates the error message in GetFileSystemType to match the function's
casing and exports the error.

Signed-off-by: Eric Hotinger <ehotinger@gmail.com>
2019-07-01 14:25:30 -07:00
Eric Hotinger 9fe4f5c769 Adds a file system helper file for determining the file system type.
Signed-off-by: Eric Hotinger <ehotinger@gmail.com>
2019-06-25 13:42:09 -07:00
Justin d2ef9cfdac Merge pull request #149 from microsoft/etw-logrus-time
etwlogrus: Pass through entry time as ETW field
2019-06-25 10:40:15 -07:00
Kevin Parsons 09baa54393 etwlogrus: Pass through entry time as ETW field
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-06-25 10:36:45 -07:00
Kevin Parsons 2ae559ad19 Replace ETW Logrus hook levels with AllLevels
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-06-25 10:32:12 -07:00
Kevin Parsons 3dac69f6ea pkg/guid: Switch from json.Marshaler to encoding.TextMarshaler
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-05-13 14:31:21 -07:00
Kevin Parsons b940a6f7ae pkg/guid: Improve error messages
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-05-13 14:30:09 -07:00
Kevin Parsons 2dc6637e2c pkg/guid: Support big-endian and Windows encodings
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-05-13 14:28:49 -07:00
Kevin Parsons 6dd84a2574 pkg/guid: Add helper functions to tests
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-05-13 14:25:53 -07:00
Kevin Parsons 1197d54849 pkg/guid: Add variant and version support
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-05-13 14:22:42 -07:00
Kevin Parsons a2a7cd6b7d Fix errors introduced with guid-by-value change
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-05-08 16:43:22 -07:00
Kevin Parsons 7185c03f75 pkg/guid: Prefer passing GUID by value
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-05-08 15:52:52 -07:00
John Starks 2be8053e58 Merge pull request #138 from microsoft/etw-write-error
etwlogrus: Ignore error from ETW WriteEvent
2019-05-08 08:21:23 -07:00
John Starks 1bcf844dd4 Merge pull request #140 from microsoft/etwlogrus-tests
etwlogrus: Improve tests to actually go through logrus hook
2019-05-08 08:20:37 -07:00
Kevin Parsons afa8dc2e8d etwlogrus: Improve tests to actually go through logrus hook
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-05-08 00:01:40 -07:00
Kevin Parsons ed00d9afc1 etwlogrus: Fix event logging not including fields
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-05-07 23:51:39 -07:00
Kevin Parsons 2093f10e12 etwlogrus: Ignore error from ETW WriteEvent
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2019-05-07 23:41:01 -07:00
John Starks e90d8317de Merge pull request #133 from jstarks/sort_keys
pkg/etwlogrus: Ensure stable event field order
2019-05-07 13:40:08 -07:00
John Starks 664840fcdb pkg/etwlogrus: Ensure stable event field order
This change updates the logrus hook to sort the incoming logrus data
before passing it to the tracelogging code. This is useful because it
ensures that two instances of the same event have the fields in the same
order, which is necessary to get WPA to line the fields up.
2019-05-07 19:27:13 +00:00
Justin f4260581c2 Merge pull request #132 from jstarks/etwtime
pkg/etw: Add support for time.Time
2019-05-07 10:25:08 -07:00
John Starks 89c1d0e19d pkg/etw: Add support for time.Time
This change adds support for encoding time.Time values as FILETIME
values in tracelogging events. FILETIME has slightly less precision than
time.Time (100ns vs 1ns), but it is the closest availble match.
2019-05-05 00:02:18 +00:00
Kevin Parsons 0112307ab4 Fix ETW package to work on 386
The ETW registration handle is defined to be 64-bits on all platforms. The Go
type previously used a uintptr which created problems on 32-bit systems. This
change adds a new wrapper file which receives a 64-bit handle for the functions
defined in it, and correctly passes it to the native ETW functions either as-is
(on 64-bit) or as two 32-bit values (on 32-bit).

This required a minor change in mksyscall_windows.go, to allow multiple syscalls
that map to the same underlying function without causing a duplicate definition
error in the generated file.
2019-04-22 10:28:49 -07:00
Kevin Parsons 1af701744e Add stock mksyscall_windows.go to ETW package
This is just so we can see the alterations we make to this file as a diff in
the next commit.
2019-04-22 10:24:50 -07:00
Kevin Parsons a4918f0a0f Make ETW no-op on ARM
Proper support for ETW on ARM will require additional changes in Go to support
more than 16 bytes of arguments to a syscall callback. Until this work is done,
the ETW package is being changed to no-op on ARM.
2019-04-20 19:23:37 -07:00
Kevin Parsons dac77d8a7c etw: Fix panic when provider creation fails
There is a cleanup function deferred to remove the provider from the global
provider map. However, this function didn't bind the value of provider ahead of
time, so when the provider creation returned with nil for provider, we tried to
cleanup a nil provider, and panicked.
2019-04-19 10:43:53 -07:00
Kevin Parsons 88da7d1491 Add guid package 2019-04-01 16:07:14 -07:00
Kevin Parsons 873693efb7 Add opcode support to etw package 2019-03-28 14:34:17 -07:00
Kevin Parsons dd3d7fa178 Merge pull request #120 from kevpar/etw-smart-field
Move smart ETW field logging to base etw library
2019-03-22 14:48:08 -07:00
Kevin Parsons a132ab2270 Move smart ETW field logging to base etw library 2019-03-22 14:16:54 -07:00
Kevin Parsons 9ea416ec01 Fix activity ID not being passed in ETW 2019-03-22 11:11:18 -07:00
John Howard 8df5952535 Fix GrantVmGroupAccess
Signed-off-by: John Howard <jhoward@microsoft.com>
2019-03-21 12:32:46 -07:00
John Howard 884f680ab9 Add GrantVmGroupAccess
Signed-off-by: John Howard <jhoward@microsoft.com>
2019-03-20 19:35:27 -07:00
Justin 584c8d8bd8 Merge pull request #115 from kevpar/etw-logrus-pass-provider
Etw logrus pass provider
2019-03-19 11:13:27 -07:00
Justin 19a2e5edd7 Merge pull request #113 from kevpar/public-etw
Export etw package
2019-03-19 11:12:31 -07:00
Kevin Parsons 811b34668c Provide a hook constructor which accepts an ETW provider
Previously, the only constructor for the etwlogrus hook accepted a name, and
created a new ETW provider with that name. With this change, there is another
constructor which takes an already created ETW provider. This is to allow the
use of the ETW provider for other things, such as if the application wants to
support ETW capture state.
2019-03-19 00:09:35 -07:00
Kevin Parsons b246ce4803 Map Logrus level to standard ETW level
ETW and Logrus have similar, but different definitiosn of log level.
Originally, the plan was to just convert the integer value of the Logrus level
to an ETW level, and leave it at that. However, it turns out there are tools
that assume you are logging with the standard set of ETW log level. So now we
will map the Logrus level to an ETW level, so that these tools better.
2019-03-19 00:01:56 -07:00
Kevin Parsons ce5a3739bc Export etw package 2019-03-18 23:57:19 -07: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 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 82fc62aed2 Return error from WriteEvent in Logrus hook 2019-01-03 16:08:24 -08:00
Kevin Parsons b87cea3696 Clean up and PR feedback 2019-01-03 13:08:23 -08:00