Add opcode support to etw package

This commit is contained in:
Kevin Parsons
2019-03-28 14:34:17 -07:00
parent 812eb80041
commit 873693efb7
2 changed files with 29 additions and 2 deletions
+10
View File
@@ -36,12 +36,20 @@ func WithKeyword(keyword uint64) EventOpt {
}
}
// WithChannel specifies the channel of the event to be written.
func WithChannel(channel Channel) EventOpt {
return func(options *eventOptions) {
options.descriptor.channel = channel
}
}
// WithOpcode specifies the opcode of the event to be written.
func WithOpcode(opcode Opcode) EventOpt {
return func(options *eventOptions) {
options.descriptor.opcode = opcode
}
}
// WithTags specifies the tags of the event to be written. Tags is a 28-bit
// value (top 4 bits are ignored) which are interpreted by the event consumer.
func WithTags(newTags uint32) EventOpt {
@@ -50,12 +58,14 @@ func WithTags(newTags uint32) EventOpt {
}
}
// WithActivityID specifies the activity ID of the event to be written.
func WithActivityID(activityID *windows.GUID) EventOpt {
return func(options *eventOptions) {
options.activityID = activityID
}
}
// WithRelatedActivityID specifies the parent activity ID of the event to be written.
func WithRelatedActivityID(activityID *windows.GUID) EventOpt {
return func(options *eventOptions) {
options.relatedActivityID = activityID