# # Default configuration options for tracewpp. # # This file provides configuration settings for tracewpp. By default, tracewpp # uses "defaultwpp.ini" for configuration settings. An alternate INI file can # be specified via the -defwpp parameter. Additional configuration settings can # be specified via the -ini parameter or via "begin_wpp config" blocks in # files specified via the -scan parameter. # # When parsing an INI file or a "begin_wpp config" block, tracewpp searches for # syntax that looks like a function call, e.g. "FunctionName(arg1, ...);". For # each function call, if the function name is one of the recognized commands # described below (e.g. NOPREFIX, USEPREFIX, INCLUDE), that command is # executed. Otherwise, the function call is treated as the definition of a # trace function. ################################ # General configuration commands ################################ # # FUNC FunctionName(ARG1, ARG2, MSG, ...); # FUNC FunctionName{ARG1=value, ARG2=value}(ARG3, ARG4, MSG, ...); # # Defines a trace function and its arguments. The tracewpp tool will scan all # source files for calls to the specified trace function. The generated TMH # file will then define the specified name as a macro and will generate code # to handle each call to the macro. # # Function definitions are often prefixed by "FUNC", e.g. # "FUNC DoTraceMessage(LEVEL, MSG, ...);". The "FUNC" prefix is optional # but is helpful in drawing attention to function definitions. # # Arguments provided in {braces} are defaulted parameters (sometimes called # "assumed arguments"). If you define a trace function # MyTrace{ARG1=5}(MSG, ...), then WPP will treat any use # of MyTrace("...", a, b) as if it were MyTrace(5, "...", a, b), and WPP will # generate macros for MyTrace that include an ARG1 parameter (for use by # user-specified expressions in the macro definition). # # Note that when using TMF-based WPP, WPP will expect the user to define # ENABLED and LOGGER macros based on the arguments for defined functions. # For example, if you define a trace function # MyTrace(FLAG, MYARG, MSG, ...), WPP will expect user-defined macros # WPP_FLAG_MYARG_ENABLED(FLAG, MYARG) and WPP_FLAG_MYARG_LOGGER(FLAG, MYARG) # to be provided by the user. These user-supplied macros are usually defined # in terms of the corresponding WPP-supplied macros WPP_LEVEL_ENABLED(LEVEL) # and WPP_LEVEL_LOGGER(LEVEL). # # Certain argument names trigger special behavior: # - "MSG" is the format string. # - "..." is a placeholder for the format string arguments. If present, it # must be the last argument. # - "PUBLIC_FILTER" marks the function as conditionally public. The function # will be public if the WPP_PUBLIC_ macro is defined when the file is # compiled (where is the value of the PUBLIC_FILTER argument). # # Certain argument names trigger special behavior in manifest-based WPP: # - "ControlGuid" specifies the name of the control GUID for the event. If # there is no ControlGuid argument, tracewpp will determine the control # GUID based on the event's level or keywords. # - "Level" specifies the level of the event. If there is no Level argument, # tracewpp will look for valid level names in all arguments of the event. # If no level name is found, the level will default to "win:Verbose". # - "Keywords" specifies the keywords (flags) of the event. If there is no # Keywords argument, tracewpp will look for valid keyword names in all # arguments of the event. If no keywords are found, the keyword will be # "win:AnyKeyword" (i.e. 0). # - "Name" specifies the event name. # - "Id" allows manual assignment of event Id and Version attributes. Syntax # is either "ID" or "IDvVERSION", e.g. "24" or "24v2". The specified Id # must be a number from 0..65535 that is outside of the auto-assignment # pool. Note that the auto-assignment pool defaults to 10..65535, so manual # assignment generally requires adjusting the auto-assignment pool (via the # TRACERANGE command). # - "Func" specifies the name of the event's call site function. Note that # when using manifest-based WPP, tracewpp is unable to automatically set # the event's function name during manifest generation. The function name # can be manually specified via the Func parameter or it can be included in # the event payload via DEFAULT_FUNC_NAME_IN_EVENT/USE_FUNC_NAME_IN_EVENT. # # NOPREFIX(FunctionName); # # Removes the default trace message prefix "%!STDPREFIX!" for the specified # trace function. # # USEPREFIX(FunctionName, [Prefix, ArgNames...]); # USESUFFIX(FunctionName, [Suffix, ArgNames...]); # # Sets the trace message prefix or suffix for the specified trace function. # Each time WPP sees function("message", ...), it will add the specified # prefix or suffix to "message". # # PUBLIC_FILTER(FunctionName, Flag); # # Marks the named function as conditionally public. The function will be # public if the WPP_PUBLIC_ macro is defined when the file is compiled. # Public functions omit certain metadata from the TMF such as filename and # line number. (Not applicable to manifest-based WPP.) # # INCLUDE(IniFileName); # # Immediately processes the specified file as an INI file. # # PROCESSFILES(SourceFile...); # # Processes the specified input file(s) as if they were specified on the # tracewpp command line. Example: PROCESSFILES("MyFile.cpp", "B*.c"); # # SCANFORMACROS(HeaderFile...); # # Scans the specified file(s) as if they were specified with # /scan:HeaderFile on the tracewpp command line. # # SEPARATE_TRACE_GUID_PER_FILE(Enabled); # # If enabled (1), a new trace GUID will be generated for each input file # scanned. This is useful for TMF-based WPP, as it means changes in one # source file will not affect the trace GUID or event IDs of other source # files. This is undesirable for manifest-based WPP, as it requires a # large number of providers to be registered. # # This is enabled (1) by default for TMF-based WPP. This is disabled (0) by # default for manifest-based WPP (when the /man parameter is specified). # # TRACERANGE(Min, Max); # # Configures the range of numbers that WPP will use when automatically # assigning event IDs. Default is 10..65535. If manually assigning Ids, you # will need to reduce this range to reserve Ids for manual assignment, e.g. # use TRACERANGE(1000, 65535) so that Ids 1..999 can be manually assigned. # # WPP_FLAGS(Option...); # # Processes the specified options as if they were specified on the tracewpp # command line. Example: WPP_FLAGS(noshrieks, p:MyProject); ################################ # Type definition commands ################################ # # The following commands can be used to define data types for use with WPP # trace functions. WPP type definitions may include the following settings: # # - Name: the WPP name of the type being defined. This name must be unique. # When reading the WPP format strings from source code, WPP matches the # requested type against this name. For example, "%d" will cause WPP to look # for a type named "d", and "%!HRESULT!" will cause WPP to look for a type # named "HRESULT". # - EquivType: the name of the type in C or C++, e.g. "int". This type will be # used for the parameter of the inline helper function in the generated # code. # - MofType: the MOF name of the type (shows up in the TMF file). # - FormatSpec: the format string to use for this type in the message string. # For example, if FormatSpec is "I64x" then a message string might look like: # "Value = %10!I64x!". # - Sig: the short name to use for this type when generating the names for # helper functions. Two different WPP types might use the same signature # because the types are compatible in terms of the helper functions (the # underlying C/C++ types are the same and the types serialize into ETW data # the same way). # - Priority: the priority to give the type during argument sorting (only # significant when the /reorder parameter is used). This value is typically # set to the type's alignment so that more-aligned values sort first and # remain aligned within the ETW data. # - ManifestType: describes the how the type should be treated in # manifest-based WPP. The ManifestType is a semicolon-separated list of type # parameters. The first parameter is required and specifies the winmeta input # type, e.g. "win:UInt32" (valid winmeta types are described in winmeta.xml). # Subsequent parameters specify options in the form of a name=value pair. The # supported options are: # - outType: Specifies the winmeta output type (i.e. a type formatting # qualifier), e.g. "xs:string". If not set, the type will not include an # outType attribute in the manifest and will receive default formatting by # the trace decoder. Example use of outType: win:Int32;outType=win:HResult # - adapter: Specifies a function or macro that should be applied to values # of this type before passing the value to the MC-generated EventWrite # macro. For example, if argument a10 has no adapter and argument a11 has # "ADAPT" as its adapter, the MC-generated EventWrite macro would be # invoked as EventWriteMyEvent(a10, ADAPT(a11)). The adapter might perform # a cast (e.g. cast ULONG_PTR to void*) or in the case of a Counted type # might convert a single value into a length+pointer pair. For example, the # adapter for a PUNICODE_STRING type might be the following macro: # #define ADAPT_PSTR(p) p->Length/2, p->Buffer # Example use of adapter: win:CountedUnicodeString;adapter=ADAPT_PSTR # # CUSTOM_TYPE(Name, BaseType(Extension), [FormatSpec]); # # Creates a new type by adding an extension to an existing type. Typically # used to define enumerations, e.g.: # ItemListByte(EnumValues...), ItemListShort(EnumValues...), # ItemListLong(EnumValues...), ItemSetByte(EnumValues...), # ItemSetShort(EnumValues...), ItemSetLong(EnumValues...), # ItemEnum(EnumName), or ItemFlagsEnum(EnumName). # # ItemList types are used for list enums, i.e. items counting up from 0. # ItemList types support skipping values via Value=number syntax. # # ItemSet types are used for bitset enums, i.e. the first item has value # 1, the second has value 2, the third has value 4, the fourth has value 8. # # ItemEnum and ItemFlagsEnum types reference the name of a C/C++ enum and # are resolved using symbol information from the PDB. (ItemEnum and # ItemFlagsEnum do not work for manifest-based WPP because the PDB is not # used for resolving enumerations.) # # TYPEMACRO(Name, BaseType(Extension), [FormatSpec]); # # Deprecated. Same as CUSTOM_TYPE. # # DEFINE_SIMPLE_TYPE(Name, EquivType, MofType, FormatSpec, Sig, Priority, # [ManifestType]); # # Creates a new fixed-length type that is passed to the helper function by # value (uses helper macro WPP_LOGTYPEVAL). Size in the event payload will # be sizeof(EquivType). # # DEFINE_SIMPLE_TYPE_PTR(Name, EquivType, MofType, FormatSpec, Sig, Priority, # [ManifestType]); # # Creates a new fixed-length type that is passed to the helper function by # address (uses helper macro WPP_LOGTYPEPTR). Size in the event payload will # be sizeof(*value). # # DEFINE_FLAVOR(Name, BaseType, [MofType, FormatSpec, ManifestType]); # # Defines a new type that is based on another similar type, potentially # overriding the base type's MofType, FormatSpec, and manifest type. Omitted # or blank settings will remain the same as the base type. # # DEFINE_CPLX_TYPE(Name, MacroName, EquivType, MofType, FormatSpec, Sig, # Priority, [ManifestType]); # # Defines a complex type, i.e. one that requires special handling via a # helper macro other than WPP_LOGTYPEVAL or WPP_LOGTYPEPTR. Any type with a # variable length (e.g. any string type) is complex. # # MacroName is the name of the helper macro that WPP should invoke when # passing this value to the helper function. The helper macro should itself # invoke the WPP_LOGPAIR macro with the data size and the data pointer. (Note # that helper macros are only used for TMF-based WPP, not for manifest-based # WPP.) ################################ # Manifest definition commands ################################ # # The following commands are used with manifest-based WPP. Many of these # commands accept a required Name, and allow for an optional Symbol. The item # defined by such a command can be referenced by either its name or its # symbol. If no symbol is defined, it can only be referenced by its name. The # symbol may be useful in cases where the desired name is not a C/C++-friendly # identifier. # # MANIFEST_CONFIGURATION(ManifestFile, [HeaderFile, Prefix]); # # For use with manifest-based WPP. Normally specified via the command-line # -man option, not in an INI file or via configuration blocks. # # MANIFEST_RESOURCES(ResourceFile, [MessageFile, Culture]); # # For use with manifest-based WPP. Specifies information about the installed # location of the DLL/EXE/SYS file that contains a manifest's resource data. # If not specified, Culture defaults to "en-us". Since the install location # is usually not known at build time, tracewpp defaults to using dummy paths # for the resource file and message file. The dummy paths are typically # overridden by the /rf and /mf parameters on the wevtutil command line # during manifest installation. Note that the ResourceFile and MessageFile # values must be absolute paths. # # DEFINE_CONTROL_GUID(Name, [Guid, Symbol]); # # For use with manifest-based WPP. Defines a control GUID (aka a provider). # If the Guid parameter is not specified, the GUID for the provider will be # computed by hashing the Name using the same name hashing algorithm as is # used by tracelog, xperf, EventSource, and other ETW tools. # # DEFINE_BIT(Name, [Mask, Symbol]); # # For use with manifest-based WPP. Adds a keyword to the most recently # defined control guid. The default mask of the keyword is the control # guid's lowest unused keyword bit. # # Mask may be specified as decimal or hexadecimal and must be a power of 2. # # DEFINE_KEYWORD(Name, ControlGuidId, Mask, [Symbol]); # # For use with manifest-based WPP. Defines a keyword associated with the # specified control GUID. Rarely used: DEFINE_BIT is usually simpler. # # DEFINE_LEVEL(Name, ControlGuidId, Value, [Symbol]); # # For use with manifest-based WPP. Defines a level associated with the # specified control GUID. The level value must not conflict with any # built-in levels (level values 0 through 15 are built-in levels). Rarely # used: the built-in levels are sufficient for most components. # # DEFINE_BUILTIN_KEYWORD(Name, Mask, [Symbol, Symbol...]); # # For use with manifest-based WPP. Normally used in the defaultwpp.ini file, # not in per-project INI files or configuration blocks. Defines a global # (Microsoft-defined) keyword value. These keywords can be used with any # control GUID. These keywords will not be defined in the manifest - they # are expected to match keyword definitions from winmeta.xml. # # DEFINE_BUILTIN_LEVEL(Name, Value, [Symbol, Symbol...]); # # For use with manifest-based WPP. Normally used in the defaultwpp.ini file, # not in per-project INI files or configuration blocks. Defines a global # (Microsoft-defined) level value. These levels can be used with any control # GUID. These levels will not be defined in the manifest - they are expected # to match level definitions from winmeta.xml. # # DEFAULT_FUNC_NAME_IN_EVENT(Expression, [TypeName]); # # For use with manifest-based WPP. When using manifest-based WPP, tracewpp is # unable to automatically set the event's function name during manifest # generation. The function name can be manually specified via the Func # parameter or it can be included in the event payload via # DEFAULT_FUNC_NAME_IN_EVENT or USE_FUNC_NAME_IN_EVENT. # The DEFAULT_FUNC_NAME_IN_EVENT command will add a hidden string property # named "!FUNC!" to every event (except when overridden by # USE_FUNC_NAME_IN_EVENT). The value of the property will be taken from the # specified Expression. The Expression will typically be set to # "__FUNCTION__". TypeName is the WPP name of the type to use for the hidden # argument. TypeName defaults to "hs" (i.e. nul-terminated char* string). # # USE_FUNC_NAME_IN_EVENT(FunctionName, Expression, [TypeName]); # # For use with manifest-based WPP. When using manifest-based WPP, tracewpp is # unable to automatically set the event's function name during manifest # generation. The function name can be manually specified via the Func # parameter or it can be included in the event payload via # DEFAULT_FUNC_NAME_IN_EVENT or USE_FUNC_NAME_IN_EVENT. # # The USE_FUNC_NAME_IN_EVENT command with a non-empty value for Expression # will add a hidden string property named "!FUNC!" to every event generated # by the specified trace function. The value of the property will be taken # from the specified Expression. The Expression will typically be set to # "__FUNCTION__". TypeName is the WPP name of the type to use for the hidden # argument. TypeName defaults to "hs" (i.e. nul-terminated char* string). # # If Expression is empty (i.e. ""), the "!FUNC!" property will not be added # to events generated by the specified trace function. A blank Expression # can be used to override a default set by DEFAULT_FUNC_NAME_IN_EVENT. # ################################ # Format string syntax ################################ # # The format string is parsed to determine the type and format of event # properties. Format string syntax is similar to printf, i.e. a '%' character # not immediately followed by another '%' character will be treated as the # start of a property reference. # # A property reference is parsed as one of the following: # # '%' [ '{' PropertyName '}' ] [Prefix] ShortTypeName # '%' [ '{' PropertyName '}' ] [ArgNum] '!' [Prefix] LongTypeName '!' # # {PropertyName} is optional. If specified, the name must contain only # identifier characters, i.e. a-z, 0-9, and '_'. # # Prefix includes flags ('-', '+', '#'), width digits, and/or '.' followed by # precision digits. Note that prefix does not support "*" or ".*". # # If prefix is specified, it will be included in the event's format string # along with the type's FormatSpec. For example, "%+02hX" would be parsed as # Prefix="+02", ShortTypeName="hX". Type "hX" has FormatSpec="X", so the final # WPP format string for the property would be "+02X". # # If the -NoShrieks command-line option is set and the prefix before a # ShortTypeName contains only digits, tracewpp will treat the number as an # ArgNum instead of a Width. # # The ArgNum before '!' is optional. It indicates the index of the argument to # use for this property reference. If not specified, ArgNum is determined from # the position of the property reference in the format string. # # By default, ShortTypeName is a length (one of "", "I", "I64", "h", "w", "l", # or "ll") followed by a specifier (any single character). However, if the # -NoShrieks command-line option is set, ShortTypeName is any number of # identifier characters (a-z, A-Z, 0-9, '_') and ends at the first # non-identifier character. # # LongTypeName is any non-empty sequence of characters ending at the '!'. # # ShortTypeName or LongTypeName must match the name of a defined WPP type (i.e. # the type names defined below or your own custom types). # ################################ # Default WPP configuration ################################ # our basic arithmetic types DEFINE_SIMPLE_TYPE( XINT64, signed __int64, ItemLongLongX, "I64x", i, 8, win:HexInt64); DEFINE_SIMPLE_TYPE( XXINT64,signed __int64, ItemLongLongXX,"I64X", i, 8, win:HexInt64); DEFINE_SIMPLE_TYPE( OINT64, signed __int64, ItemLongLongO, "I64o", i, 8, win:HexInt64); DEFINE_SIMPLE_TYPE( SBYTE, signed char, ItemChar, "c", c, 1, win:Int8); DEFINE_SIMPLE_TYPE( SSHORT, signed short, ItemShort, "hd", h, 2, win:Int16); DEFINE_SIMPLE_TYPE( SINT, signed int, ItemLong, "d", d, 4, win:Int32); DEFINE_SIMPLE_TYPE( SLONG, signed long, ItemLong, "ld", l, 4, win:Int32); DEFINE_SIMPLE_TYPE( SINT64, signed __int64, ItemLongLong, "I64d", i, 8, win:Int64); DEFINE_SIMPLE_TYPE( UBYTE, unsigned char, ItemChar, "c", C, 1, win:UInt8); DEFINE_SIMPLE_TYPE( USHORT, unsigned short, ItemShort, "hu", H, 2, win:UInt16); DEFINE_SIMPLE_TYPE( UINT, unsigned int, ItemLong, "u", D, 4, win:UInt32); DEFINE_SIMPLE_TYPE( ULONG, unsigned long, ItemLong, "lu", L, 4, win:UInt32); DEFINE_SIMPLE_TYPE( UINT64, unsigned __int64,ItemULongLong, "I64u", I, 8, win:UInt64); DEFINE_SIMPLE_TYPE( DOUBLE, double, ItemDouble, "s", g, 8, win:Double); DEFINE_FLAVOR( UCHAR, UBYTE, ItemUChar, "c", win:UInt8; outType=xs:string); DEFINE_FLAVOR( SCHAR, SBYTE, ItemChar, "c", win:Int8; outType=xs:string); # arch dependent types DEFINE_SIMPLE_TYPE( SLONGPTR, LONG_PTR, ItemPtr, "Id", p, 7, win:Pointer; adapter=WPP_ADAPTER_PVOID; outType=xs:long); DEFINE_SIMPLE_TYPE( ULONGPTR, ULONG_PTR, ItemPtr, "Iu", P, 7, win:Pointer; adapter=WPP_ADAPTER_PVOID; outType=xs:unsignedLong); DEFINE_SIMPLE_TYPE( PTR, const void*, ItemPtr, "p", q, 6, win:Pointer); DEFINE_SIMPLE_TYPE( HANDLE, const void*, ItemPtr, "p", q, 6, win:Pointer); DEFINE_SIMPLE_TYPE_PTR(GUID, LPCGUID, ItemGuid, "s", _guid_, 4, win:GUID); # Predefined constants. # Typically used in the function's prefix or suffix. DEFINE_SIMPLE_TYPE( COMPNAME,,, "__COMPNAME__",,); DEFINE_SIMPLE_TYPE( FILE,,, "__FILE__",,); DEFINE_SIMPLE_TYPE( LINE,,, "__LINE__",,); DEFINE_SIMPLE_TYPE( SPACE,,, " ",,); # The following can be used in the prefix or suffix. DEFINE_SIMPLE_TYPE( FUNC,,, "%!FUNC!",,); DEFINE_SIMPLE_TYPE( LEVEL,,, "%!LEVEL!",,); DEFINE_SIMPLE_TYPE( KEYWORDS,,, "%!FLAGS!",,); DEFINE_SIMPLE_TYPE( STDPREFIX,,, "%0",,); # Only works at start of prefix. Ignored for manifest-based WPP. DEFINE_SIMPLE_TYPE( MOD,,, "%1!s!",,); DEFINE_SIMPLE_TYPE( TYP,,, "%2!s!",,); DEFINE_SIMPLE_TYPE( TID,,, "%3!x!",,); DEFINE_SIMPLE_TYPE( NOW,,, "%4!s!",,); DEFINE_SIMPLE_TYPE( SEQ,,, "%7!u!",,); DEFINE_SIMPLE_TYPE( PID,,, "%8!x!",,); DEFINE_SIMPLE_TYPE( CPU,,, "%9!u!",,); # Complex types # Strings and SID require custom processing DEFINE_CPLX_TYPE(ASTR, WPP_LOGASTR, LPCSTR, ItemString, "s", s, 1, win:AnsiString); DEFINE_CPLX_TYPE(ARSTR, WPP_LOGASTR, LPCSTR, ItemRString, "s", s, 1, win:AnsiString); DEFINE_CPLX_TYPE(ARWSTR,WPP_LOGWSTR, LPCWSTR, ItemRWString,"s", S, 2, win:UnicodeString); DEFINE_CPLX_TYPE(WSTR, WPP_LOGWSTR, LPCWSTR, ItemWString, "s", S, 2, win:UnicodeString); DEFINE_CPLX_TYPE(CSTR, WPP_LOGPCSTR, const CSTRING*, ItemPString, "s", z, 1, win:CountedAnsiString; adapter=WPP_ADAPTER_PCSTR); DEFINE_CPLX_TYPE(USTR, WPP_LOGPUSTR, PCUNICODE_STRING, ItemPWString,"s", Z, 2, win:CountedUnicodeString; adapter=WPP_ADAPTER_PUSTR); DEFINE_CPLX_TYPE(ANSTR, WPP_LOGPCSTR, const ANSI_STRING*, ItemPString, "s", aZ, 1, win:CountedAnsiString; adapter=WPP_ADAPTER_PCSTR); DEFINE_CPLX_TYPE(sid, WPP_LOGPSID, PSID, ItemSid, "s", _sid_, 0, win:SID; adapter=WPP_ADAPTER_PSID); # Raw binary data. Usage: DoTraceMessage(FLAG, "%!BIN!", WppBinary(pointer, size)); DEFINE_CPLX_TYPE(BIN, WPP_LOGCSTR, WPP_BINARY, ItemHexDump, "s", _zb_, 1, win:CountedBinary; adapter=WPP_ADAPTER_BIN); # C++ string types DEFINE_CPLX_TYPE(str, WPP_LOGCPPSTR, const std::string&, ItemPString, "s", _str_, 0, win:CountedAnsiString; adapter=WPP_ADAPTER_CPPSTR); DEFINE_CPLX_TYPE(wstr, WPP_LOGCPPSTR, const std::wstring&, ItemPWString, "s", _wstr_, 0, win:CountedUnicodeString; adapter=WPP_ADAPTER_CPPSTR); DEFINE_CPLX_TYPE(sv, WPP_LOGCPPVEC, const std::string_view&, ItemPString, "s", _sv_, 0, win:CountedAnsiString; adapter=WPP_ADAPTER_CPPVEC); DEFINE_CPLX_TYPE(wsv, WPP_LOGCPPVEC, const std::wstring_view&,ItemPWString, "s", _wsv_, 0, win:CountedUnicodeString; adapter=WPP_ADAPTER_CPPVEC); # Define printf-compatible types DEFINE_FLAVOR(e, DOUBLE,,); DEFINE_FLAVOR(E, DOUBLE,,); DEFINE_FLAVOR(f, DOUBLE,,); DEFINE_FLAVOR(g, DOUBLE,,); DEFINE_FLAVOR(G, DOUBLE,,); DEFINE_FLAVOR(c, SCHAR,,); DEFINE_FLAVOR(hc, SCHAR,,); DEFINE_FLAVOR(lc, SSHORT,,); DEFINE_FLAVOR(wc, SSHORT,,); DEFINE_FLAVOR(C, SSHORT,,); DEFINE_FLAVOR(s, ASTR,,); DEFINE_FLAVOR(hs, ASTR,,); DEFINE_FLAVOR(S, WSTR,,); DEFINE_FLAVOR(ws, WSTR,,); DEFINE_FLAVOR(ls, WSTR,,); DEFINE_FLAVOR(hi, SSHORT,,); DEFINE_FLAVOR(hd, SSHORT,,); DEFINE_FLAVOR(hu, USHORT,,"u"); DEFINE_FLAVOR(hx, USHORT,,"x", win:UInt16; outType=win:HexInt16); DEFINE_FLAVOR(hX, USHORT,,"X", win:UInt16; outType=win:HexInt16); DEFINE_FLAVOR(ho, USHORT,,"o", win:UInt16; outType=win:HexInt16); DEFINE_FLAVOR(Id, ULONGPTR,,"Id"); DEFINE_FLAVOR(Iu, ULONGPTR,,"Iu"); DEFINE_FLAVOR(Ix, ULONGPTR,,"Ix", win:Pointer; adapter=WPP_ADAPTER_PVOID); DEFINE_FLAVOR(IX, ULONGPTR,,"IX", win:Pointer; adapter=WPP_ADAPTER_PVOID); DEFINE_FLAVOR(Io, ULONGPTR,,"Io", win:Pointer; adapter=WPP_ADAPTER_PVOID); DEFINE_FLAVOR(i, SINT,,); DEFINE_FLAVOR(d, SINT,,); DEFINE_FLAVOR(u, UINT,,"u"); DEFINE_FLAVOR(x, UINT,,"x", win:HexInt32); DEFINE_FLAVOR(X, UINT,,"X", win:HexInt32); DEFINE_FLAVOR(o, UINT,,"o", win:HexInt32); DEFINE_FLAVOR(cccc, SINT, ItemChar4, "s", win:AnsiString; length=4; adapter=WPP_ADAPTER_CCCC); DEFINE_FLAVOR(li, SLONG,,); DEFINE_FLAVOR(ld, SLONG,,); DEFINE_FLAVOR(lu, ULONG,,"u"); DEFINE_FLAVOR(lx, ULONG,,"x", win:HexInt32); DEFINE_FLAVOR(lX, ULONG,,"X", win:HexInt32); DEFINE_FLAVOR(lo, ULONG,,"o", win:HexInt32); DEFINE_FLAVOR(I64d, SINT64,,); DEFINE_FLAVOR(I64u, UINT64,,); DEFINE_FLAVOR(I64x, XINT64,,"I64x"); DEFINE_FLAVOR(I64X, XXINT64,,"I64X"); DEFINE_FLAVOR(I64o, OINT64,,"I64o"); DEFINE_FLAVOR(lld, SINT64,,); DEFINE_FLAVOR(llu, UINT64,,); DEFINE_FLAVOR(llx, XINT64,,"I64x"); DEFINE_FLAVOR(llX, XXINT64,,"I64X"); DEFINE_FLAVOR(llo, OINT64,,"I64o"); DEFINE_FLAVOR(p, PTR,,); DEFINE_FLAVOR(Z, ANSTR,,); DEFINE_FLAVOR(wZ, USTR,,); DEFINE_FLAVOR(z, CSTR,,); DEFINE_FLAVOR(hZ, CSTR,,); # default formats for those who don't care to provide their own strings DEFINE_FLAVOR(XBYTE, SBYTE,, "02x", win:UInt8; outType=win:HexInt8); DEFINE_FLAVOR(OBYTE, SBYTE,, "o", win:UInt8; outType=win:HexInt8); DEFINE_FLAVOR(XSHORT, SSHORT,, "04hX", win:UInt16; outType=win:HexInt16); DEFINE_FLAVOR(OSHORT, SSHORT,, "ho", win:UInt16; outType=win:HexInt16); DEFINE_FLAVOR(XINT, SINT,, "08x", win:HexInt32); DEFINE_FLAVOR(OINT, SINT,, "o", win:HexInt32); DEFINE_FLAVOR(XLONG, SLONG,, "08lX", win:HexInt32); DEFINE_FLAVOR(OLONG, SLONG,, "lo", win:HexInt32); DEFINE_FLAVOR(XLONGPTR, SLONGPTR,,"Ix", win:Pointer; adapter=WPP_ADAPTER_PVOID); DEFINE_FLAVOR(OLONGPTR, SLONGPTR,,"Io", win:Pointer; adapter=WPP_ADAPTER_PVOID); # special formats DEFINE_FLAVOR(IPADDR, UINT, ItemIPAddr, "s", win:UInt32; outType=win:IPv4); DEFINE_FLAVOR(PORT, USHORT, ItemPort, "s", win:UInt16; outType=win:Port); DEFINE_FLAVOR(STATUS, SINT, ItemNTSTATUS, "s", win:HexInt32; outType=win:NTSTATUS); DEFINE_FLAVOR(WINERROR, UINT, ItemWINERROR, "s", win:UInt32; outType=win:Win32Error); DEFINE_FLAVOR(HRESULT, SINT, ItemHRESULT, "s", win:Int32; outType=win:HResult); # Note: The %!NDIS_STATUS! and %!NDIS_OID! types work for for TMF-based WPP but # do not work well with manifest-based WPP. Manifest-based ETW decoders will # treat %!NDIS_STATUS! and %!NDIS_OID! items as HexInt32 items. DEFINE_FLAVOR(NDIS_STATUS, SINT, ItemNDIS_STATUS, "s", win:HexInt32); DEFINE_FLAVOR(NDIS_OID, UINT, ItemNDIS_OID, "s", win:HexInt32); DEFINE_FLAVOR(ipaddr,IPADDR,,); DEFINE_FLAVOR(port,PORT,,); DEFINE_FLAVOR(status,STATUS,,); DEFINE_FLAVOR(hresult,HRESULT,,); DEFINE_FLAVOR(winerr,WINERROR,,); DEFINE_FLAVOR(guid,GUID,,); # time related stuff DEFINE_FLAVOR(TIMESTAMP, SINT64, ItemTimestamp, "s", win:FILETIME; adapter=WPP_ADAPTER_PFILETIME); DEFINE_FLAVOR(TIME, SINT64, ItemTimestamp, "s", win:FILETIME; adapter=WPP_ADAPTER_PFILETIME); DEFINE_FLAVOR(DATE, SINT64, ItemTimestamp, "s", win:FILETIME; adapter=WPP_ADAPTER_PFILETIME); DEFINE_FLAVOR(WAITTIME, SINT64, ItemTimestamp, "s", win:FILETIME; adapter=WPP_ADAPTER_PFILETIME); DEFINE_FLAVOR(due, SINT64, ItemWaitTime, "s", win:FILETIME; adapter=WPP_ADAPTER_PFILETIME); DEFINE_FLAVOR(delta, SINT64, ItemTimeDelta, "s"); DEFINE_FLAVOR(datetime, SINT64, ItemTimestamp, "s", win:FILETIME; adapter=WPP_ADAPTER_PFILETIME); # enumeration types DEFINE_FLAVOR(ItemListByte, SBYTE, ItemListByte, "s", win:UInt8); DEFINE_FLAVOR(ItemListShort, SSHORT, ItemListShort, "s", win:UInt16); DEFINE_FLAVOR(ItemListLong, SLONG, ItemListLong, "s", win:UInt32); DEFINE_FLAVOR(ItemSetByte, UBYTE, ItemSetByte, "s", win:UInt8; outType=win:HexInt8); DEFINE_FLAVOR(ItemSetShort, USHORT, ItemSetShort, "s", win:UInt16; outType=win:HexInt16); DEFINE_FLAVOR(ItemSetLong, ULONG, ItemSetLong, "s", win:HexInt32); # Note: The "ItemEnum" and "ItemFlagsEnum" types work for for TMF-based WPP but # do not work well with manifest-based WPP. Manifest-based ETW decoders will # treat types based on "ItemEnum" as UInt32 and will treat types based on # "ItemFlagsEnum" as HexInt32. For better results, use ItemListLong, # ItemSetLong, or a "begin_wpp enum" block for your enumeration. DEFINE_FLAVOR(ItemEnum, ULONG, ItemEnum, "s"); DEFINE_FLAVOR(ItemFlagsEnum, ULONG, ItemFlagsEnum, "s", win:HexInt32); DEFINE_FLAVOR(CLSID, GUID, ItemCLSID, "s"); DEFINE_FLAVOR(LIBID, GUID, ItemLIBID, "s"); DEFINE_FLAVOR(IID, GUID, ItemIID, "s"); CUSTOM_TYPE(b1, ItemSetByte(1,2,3,4,5,6,7,8) ); CUSTOM_TYPE(b2, ItemSetShort(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) ); CUSTOM_TYPE(b4, ItemSetLong(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32) ); CUSTOM_TYPE(bool, ItemListLong(false,true) ); CUSTOM_TYPE(bool16, ItemListShort(false,true) ); CUSTOM_TYPE(bool8, ItemListByte(false,true) ); CUSTOM_TYPE(BOOLEAN, ItemListByte(FALSE,TRUE) ); CUSTOM_TYPE(irql, ItemListByte(Low,APC,DPC) ); CUSTOM_TYPE(pnpmn, ItemListByte(IRP_MN_START_DEVICE,IRP_MN_QUERY_REMOVE_DEVICE,IRP_MN_REMOVE_DEVICE,IRP_MN_CANCEL_REMOVE_DEVICE,IRP_MN_STOP_DEVICE,IRP_MN_QUERY_STOP_DEVICE,IRP_MN_CANCEL_STOP_DEVICE,IRP_MN_QUERY_DEVICE_RELATIONS,IRP_MN_QUERY_INTERFACE,IRP_MN_QUERY_CAPABILITIES,IRP_MN_QUERY_RESOURCES,IRP_MN_QUERY_RESOURCE_REQUIREMENTS,IRP_MN_QUERY_DEVICE_TEXT,IRP_MN_FILTER_RESOURCE_REQUIREMENTS,IRP_MN_PNP_14,IRP_MN_READ_CONFIG,IRP_MN_WRITE_CONFIG,IRP_MN_EJECT,IRP_MN_SET_LOCK,IRP_MN_QUERY_ID,IRP_MN_QUERY_PNP_DEVICE_STATE,IRP_MN_QUERY_BUS_INFORMATION,IRP_MN_DEVICE_USAGE_NOTIFICATION,IRP_MN_SURPRISE_REMOVAL) ); CUSTOM_TYPE(sysctrl, ItemListByte(IRP_MN_QUERY_ALL_DATA,IRP_MN_QUERY_SINGLE_INSTANCE, IRP_MN_CHANGE_SINGLE_INSTANCE, IRP_MN_CHANGE_SINGLE_ITEM, IRP_MN_ENABLE_EVENTS, IRP_MN_DISABLE_EVENTS, IRP_MN_ENABLE_COLLECTION, IRP_MN_DISABLE_COLLECTION, IRP_MN_REGINFO, IRP_MN_EXECUTE_METHOD, IRP_MN_Reserved_0a, IRP_MN_REGINFO_EX) ); CUSTOM_TYPE(pnpmj, ItemListByte(IRP_MJ_CREATE,IRP_MJ_CREATE_NAMED_PIPE,IRP_MJ_CLOSE,IRP_MJ_READ,IRP_MJ_WRITE,IRP_MJ_QUERY_INFORMATION,IRP_MJ_SET_INFORMATION,IRP_MJ_QUERY_EA,IRP_MJ_SET_EA,IRP_MJ_FLUSH_BUFFERS,IRP_MJ_QUERY_VOLUME_INFORMATION,IRP_MJ_SET_VOLUME_INFORMATION,IRP_MJ_DIRECTORY_CONTROL,IRP_MJ_FILE_SYSTEM_CONTROL,IRP_MJ_DEVICE_CONTROL,IRP_MJ_INTERNAL_DEVICE_CONTROL,IRP_MJ_SHUTDOWN,IRP_MJ_LOCK_CONTROL,IRP_MJ_CLEANUP,IRP_MJ_CREATE_MAILSLOT,IRP_MJ_QUERY_SECURITY,IRP_MJ_SET_SECURITY,IRP_MJ_POWER,IRP_MJ_SYSTEM_CONTROL,IRP_MJ_DEVICE_CHANGE,IRP_MJ_QUERY_QUOTA,IRP_MJ_SET_QUOTA,IRP_MJ_PNP) ); # Built-in levels (for use with manifests) DEFINE_BUILTIN_LEVEL(win:LogAlways, 0, WINEVENT_LEVEL_LOG_ALWAYS); DEFINE_BUILTIN_LEVEL(win:Critical, 1, WINEVENT_LEVEL_CRITICAL, TRACE_LEVEL_CRITICAL); DEFINE_BUILTIN_LEVEL(win:Error, 2, WINEVENT_LEVEL_ERROR, TRACE_LEVEL_ERROR); DEFINE_BUILTIN_LEVEL(win:Warning, 3, WINEVENT_LEVEL_WARNING, TRACE_LEVEL_WARNING); DEFINE_BUILTIN_LEVEL(win:Informational, 4, WINEVENT_LEVEL_INFO, TRACE_LEVEL_INFORMATION); DEFINE_BUILTIN_LEVEL(win:Verbose, 5, WINEVENT_LEVEL_VERBOSE, TRACE_LEVEL_VERBOSE); DEFINE_BUILTIN_LEVEL(win:ReservedLevel6, 6, WINEVENT_LEVEL_RESERVED_6); DEFINE_BUILTIN_LEVEL(win:ReservedLevel7, 7, WINEVENT_LEVEL_RESERVED_7); DEFINE_BUILTIN_LEVEL(win:ReservedLevel8, 8, WINEVENT_LEVEL_RESERVED_8); DEFINE_BUILTIN_LEVEL(win:ReservedLevel9, 9, WINEVENT_LEVEL_RESERVED_9); DEFINE_BUILTIN_LEVEL(win:ReservedLevel10, 10, WINEVENT_LEVEL_RESERVED_10); DEFINE_BUILTIN_LEVEL(win:ReservedLevel11, 11, WINEVENT_LEVEL_RESERVED_11); DEFINE_BUILTIN_LEVEL(win:ReservedLevel12, 12, WINEVENT_LEVEL_RESERVED_12); DEFINE_BUILTIN_LEVEL(win:ReservedLevel13, 13, WINEVENT_LEVEL_RESERVED_13); DEFINE_BUILTIN_LEVEL(win:ReservedLevel14, 14, WINEVENT_LEVEL_RESERVED_14); DEFINE_BUILTIN_LEVEL(win:ReservedLevel15, 15, WINEVENT_LEVEL_RESERVED_15); # Built-in keywords (for use with manifests) DEFINE_BUILTIN_KEYWORD(win:AnyKeyword, 0x0, WINEVT_KEYWORD_ANY); DEFINE_BUILTIN_KEYWORD(win:ResponseTime, 0x0001000000000000, WINEVENT_KEYWORD_RESPONSE_TIME); DEFINE_BUILTIN_KEYWORD(win:WDIContext, 0x0002000000000000, WINEVENT_KEYWORD_WDI_CONTEXT); DEFINE_BUILTIN_KEYWORD(win:WDIDiag, 0x0004000000000000, WINEVENT_KEYWORD_WDI_DIAG); DEFINE_BUILTIN_KEYWORD(win:SQM, 0x0008000000000000, WINEVENT_KEYWORD_SQM); DEFINE_BUILTIN_KEYWORD(win:AuditFailure, 0x0010000000000000, WINEVENT_KEYWORD_AUDIT_FAILURE); DEFINE_BUILTIN_KEYWORD(win:AuditSuccess, 0x0020000000000000, WINEVENT_KEYWORD_AUDIT_SUCCESS); DEFINE_BUILTIN_KEYWORD(win:CorrelationHint, 0x0040000000000000, WINEVENT_KEYWORD_CORRELATION_HINT); DEFINE_BUILTIN_KEYWORD(win:ReservedKeyword56, 0x0100000000000000, WINEVENT_KEYWORD_RESERVED_56); DEFINE_BUILTIN_KEYWORD(win:ReservedKeyword57, 0x0200000000000000, WINEVENT_KEYWORD_RESERVED_57); DEFINE_BUILTIN_KEYWORD(win:ReservedKeyword58, 0x0400000000000000, WINEVENT_KEYWORD_RESERVED_58); DEFINE_BUILTIN_KEYWORD(win:ReservedKeyword59, 0x0800000000000000, WINEVENT_KEYWORD_RESERVED_59); DEFINE_BUILTIN_KEYWORD(win:ReservedKeyword60, 0x1000000000000000, WINEVENT_KEYWORDE_RESERVED_60); DEFINE_BUILTIN_KEYWORD(win:ReservedKeyword61, 0x2000000000000000, WINEVENT_KEYWORD_RESERVED_61); DEFINE_BUILTIN_KEYWORD(win:ReservedKeyword62, 0x4000000000000000, WINEVENT_KEYWORD_RESERVED_62); DEFINE_BUILTIN_KEYWORD(win:ReservedKeyword63, 0x8000000000000000, WINEVENT_KEYWORD_RESERVED_63); # default tracing macros FUNC DoTraceMessage(LEVEL,MSG,...); # Uses WPP-provided ENABLED/LOGGER macros FUNC DoDebugTrace(TRACELEVEL,MSG,...); # Requires used-defined ENABLED/LOGGER macros # default prefix (use traceprt default) USEPREFIX(*,"%!STDPREFIX!"); # traceprt will add standard prefix # the source file that calls WPP_INIT_TRACING is given special treatment WPP_FLAGS(-lookfor:WPP_INIT_TRACING);