-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathTraceLoggingProvider.h
2188 lines (1892 loc) · 204 KB
/
TraceLoggingProvider.h
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
/*
This is an implementation of TraceLoggingProvider.h that writes data to
Linux tracepoints via the UserEvents system.
Prerequisites:
- If prerequisites are not met then register/write/unregister will be no-ops.
- Kernel must be built with tracefs and UserEvents (CONFIG_USER_EVENTS=y).
- tracefs mounted (e.g. /sys/kernel/tracing or /sys/kernel/debug/tracing).
- Caller must have appropriate permissions: x on tracefs mount point,
rw on tracefs/user_events_data.
Quick start:
#include <eventheader/TraceLoggingProvider.h>
TRACELOGGING_DEFINE_PROVIDER( // defines the MyProvider symbol
MyProvider, // Name of the provider symbol to define
"MyCompany_MyComponent_MyProvider", // Human-readable provider name, no ' ' or ':' chars.
// {d5b90669-1aad-5db8-16c9-6286a7fcfe33} // Provider guid (not used on Linux)
(0xd5b90669,0x1aad,0x5db8,0x16,0xc9,0x62,0x86,0xa7,0xfc,0xfe,0x33));
int main(int argc, char* argv[])
{
TraceLoggingRegister(MyProvider);
TraceLoggingWrite(MyProvider, "MyEventName",
TraceLoggingString(argv[0], "arg0"), // field name is "arg0"
TraceLoggingInt32(argc)); // field name is implicitly "argc"
TraceLoggingUnregister(MyProvider);
return 0;
}
Usage note:
Symbols starting with "TRACELOGGING" or "TraceLogging" are part of the public
interface of this header. Symbols starting with "_tlg" are private internal
implementation details that are not supported for use outside this header and
may be changed or removed in future versions of this header.
TraceLoggingProvider.h for Linux UserEvents behaves differently from the ETW
(Windows) version:
- TraceLoggingWrite, TraceLoggingWriteActivity, and TraceLoggingProviderEnabled
may cause compile or link errors if used in inline functions.
- TraceLoggingProviderEnabled requires compile-time constant parameters, i.e.
the level and keyword must be compile-time constants.
- TRACELOGGING_DEFINE_PROVIDER requires a provider name that is less than
EVENTHEADER_NAME_MAX (256) characters in length and contains no ' '
or ':' characters. (Decoding tools may impose additional restrictions; for
best compatibility, use only [A-Za-z0-9_] chars.)
- TRACELOGGING_DEFINE_PROVIDER ignores the provider GUID.
- TraceLoggingHProvider is not provided. In the UserEvents implementation of
TraceLoggingProvider.h, providers are referenced by symbol (token), not by
handle (pointer). You cannot store a provider symbol in a variable, pass it
as a parameter or return it from a function. The provider symbol used as the
first parameter to TraceLoggingWrite must be the same symbol as was used in
TRACELOGGING_DEFINE_PROVIDER.
- TRACELOGGING_DEFINE_PROVIDER_STORAGE is not provided.
- TraceLoggingOptionGroup is not provided. Instead, use
TraceLoggingOptionGroupName.
- TraceLoggingRegisterEx is not provided. No support for notification
callbacks.
- TraceLoggingProviderId is not provided. Instead, use
TraceLoggingProviderName.
- TraceLoggingSetInformation is not provided.
- TraceLoggingWriteEx is not provided.
- TraceLoggingChannel is not provided.
- TraceLoggingEventTag supports 16-bit tag. (ETW supports a 28-bit tag.)
- TraceLoggingDescription is ignored.
- TraceLoggingCustomAttribute is not provided.
- TraceLoggingValue will not accept GUID, FILETIME, SYSTEMTIME, or SID values.
- TraceLoggingCodePointer is not provided.
- TraceLoggingFileTime, TraceLoggingFileTimeUtc, TraceLoggingSystemTime, and
TraceLoggingSystemTimeUtc are not provided. Instead, use Linux-only
TraceLoggingTime32 or TraceLoggingTime64.
- TraceLoggingTid is not provided. Instead, use TraceLoggingPid.
- TraceLoggingWinError, TraceLoggingNTStatus, TraceLoggingHResult are not
provided. Instead, use Linux-only TraceLoggingErrno.
- TraceLoggingAnsiString and TraceLoggingUnicodeString are not provided. On
Windows, these are used for Windows-specific ANSI_STRING and UNICODE_STRING
structures.
- TraceLoggingSid is not provided.
- TraceLoggingBinaryBuffer is not provided.
- TraceLoggingCustom is not provided.
- TraceLoggingPackedDataEx is not provided.
- TraceLoggingGuid expects a uint8_t[16] value in RFC 4122 (big-endian) byte
order. In Windows, TraceLoggingGuid expects a GUID (struct) and the data is
stored as little-endian.
- Field tag is a 16-bit value. (ETW supports a 28-bit tag.)
The following features are specific to Linux UserEvents (not present for ETW):
- Use TraceLoggingIdVersion to specify a stable id and version for an event.
- Use TraceLoggingProviderName instead of TraceLoggingProviderId.
- Use TraceLoggingOptionGroupName instead of TraceLoggingOptionGroup.
- Use TraceLoggingErrno for logging errno values.
- Use TraceLoggingTime32 and TraceLoggingTime64 for logging time_t values.
- Use TraceLoggingChar32 and TraceLoggingString32 for logging char32_t
characters and strings.
*/
#pragma once
#ifndef _included_TraceLoggingProvider_h
#define _included_TraceLoggingProvider_h 1
#if defined(__cplusplus) && __cplusplus < 201100L
#error TraceLoggingProvider.h for C++ requires C++11 or later.
#endif
#include "eventheader-tracepoint.h"
#include <assert.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#ifdef __EDG__
#pragma region Public_interface
#endif
/*
This structure is left undefined to ensure a compile error for any attempt to
copy or dereference the provider symbol. The provider symbol is a token, not a
variable or a handle.
*/
struct TraceLoggingProviderSymbol;
/*
Macro TRACELOGGING_DECLARE_PROVIDER(providerSymbol):
Invoke this macro to forward-declare a provider symbol.
TRACELOGGING_DECLARE_PROVIDER is typically used in a header.
An invocation of
TRACELOGGING_DECLARE_PROVIDER(MyProvider);
can be thought of as expanding to something like this:
extern "C" TraceLoggingProviderSymbol MyProvider;
A symbol declared by TRACELOGGING_DECLARE_PROVIDER must later be defined in a
.c or .cpp file using the TRACELOGGING_DEFINE_PROVIDER macro.
*/
#define TRACELOGGING_DECLARE_PROVIDER(providerSymbol) \
_tlg_EXTERN_C eventheader_tracepoint const* _tlg_PASTE2(__start__tlgEventPtrs_, providerSymbol)[] __attribute__((weak, visibility("hidden"))); \
_tlg_EXTERN_C eventheader_tracepoint const* _tlg_PASTE2(__stop__tlgEventPtrs_, providerSymbol)[] __attribute__((weak, visibility("hidden"))); \
_tlg_EXTERN_C struct TraceLoggingProviderSymbol providerSymbol __attribute__((visibility("hidden"))); /* Empty provider variable to help with code navigation. */ \
_tlg_EXTERN_C eventheader_provider const _tlg_PASTE2(_tlgProv_, providerSymbol) __attribute__((visibility("hidden"))) /* Actual provider variable is hidden behind prefix. */
/*
Macro TRACELOGGING_DEFINE_PROVIDER(providerSymbol, "ProviderName", (providerId), [option]):
Invoke this macro to create the global storage for a provider.
An invocation of
TRACELOGGING_DEFINE_PROVIDER(MyProvider, "MyProviderName",
(0xb3864c38, 0x4273, 0x58c5, 0x54, 0x5b, 0x8b, 0x36, 0x08, 0x34, 0x34, 0x71));
can be thought of as expanding to something like this:
extern "C" TraceLoggingProviderSymbol MyProvider = { ... };
The "ProviderName" specifies a unique name that identifies the provider in the
logged events. It must be a char string literal (not a variable), must be less
than EVENTHEADER_NAME_MAX (256) characters long, and may not contain
' ' or ':' characters. Some versions of libtracefs impose additional
restrictions; for best compatibility, use only [A-Za-z0-9_] characters.
The providerId specifies a unique GUID that identifies the provider. The
providerId parameter must be a parenthesized list of 11 integers e.g.
(n1, n2, n3, ... n11). Typically the GUID is generated as a hash of the name.
Established convention for GUID generation, expressed as a Python function:
def providerid_from_name(providername : str) -> uuid.UUID:
sha1 = hashlib.sha1(usedforsecurity = False)
sha1.update(b'\x48\x2C\x2D\xB2\xC3\x90\x47\xC8\x87\xF8\x1A\x15\xBF\xC1\x30\xFB')
sha1.update(providername.upper().encode('utf_16_be'))
arr = bytearray(sha1.digest()[0:16])
arr[7] = (arr[7] & 0x0F) | 0x50
return uuid.UUID(bytes_le = bytes(arr))
After the providerId GUID, you may optionally specify a
TraceLoggingOptionGroupName("...") macro to set the provider group name, e.g.
TRACELOGGING_DEFINE_PROVIDER(MyProvider, "MyProviderName",
(0xb3864c38, 0x4273, 0x58c5, 0x54, 0x5b, 0x8b, 0x36, 0x08, 0x34, 0x34, 0x71),
TraceLoggingOptionGroupName("mygroupname"));
Note that the provider symbol is created in the "unregistered" state. A call
to TraceLoggingWrite with an unregistered provider is a no-op. Call
TraceLoggingRegister to register the provider.
*/
#define TRACELOGGING_DEFINE_PROVIDER(providerSymbol, providerName, providerId, ...) \
TRACELOGGING_DECLARE_PROVIDER(providerSymbol); \
_tlg_STATIC_ASSERT( \
EVENTHEADER_NAME_MAX >= sizeof("" providerName "_LnnKnnnnnnnnnnnnnnnn" _tlgProviderOptions(__VA_ARGS__)), \
"TRACELOGGING_DEFINE_PROVIDER providerName + options is too long"); \
_tlgParseProviderId(providerId) \
static tracepoint_provider_state _tlg_PASTE2(_tlgProvState_, providerSymbol) = TRACEPOINT_PROVIDER_STATE_INIT; \
_tlg_EXTERN_C_CONST eventheader_provider _tlg_PASTE2(_tlgProv_, providerSymbol) = { \
&_tlg_PASTE2(_tlgProvState_, providerSymbol), \
_tlgProviderOptions(__VA_ARGS__), \
"" providerName \
}
/*
Macro TraceLoggingOptionGroupName("groupname"):
Wrapper macro for use in TRACELOGGING_DEFINE_PROVIDER that declares the
provider's membership in a provider group.
The "groupname" specifies a string that can be used to identify a group of
related providers. This must be a char string literal containing only ASCII
digits and lowercase letters, [a-z0-9]. The total
strlen(ProviderName + groupname) must be less than
EVENTHEADER_NAME_MAX (256).
*/
#define TraceLoggingOptionGroupName(groupName) \
TraceLoggingOptionGroupName(groupName)
/*
Macro TraceLoggingUnregister(providerSymbol):
Call this function to unregister your provider. Normally you will register at
component initialization (program startup or shared object load) and unregister
at component shutdown (program exit or shared object unload).
Thread safety: It is NOT safe to call TraceLoggingUnregister while a
TraceLoggingRegister, TraceLoggingUnregister, TraceLoggingWrite, or
TraceLoggingProviderEnabled for the same provider could be in progress on
another thread.
It is ok to call TraceLoggingUnregister on a provider that has not been
registered (e.g. if the call to TraceLoggingRegister failed). Unregistering an
unregistered provider is a safe no-op.
After unregistering a provider, it is ok to register it again. In other words,
the following sequence is ok:
TraceLoggingRegister(MyProvider);
...
TraceLoggingUnregister(MyProvider);
...
TraceLoggingRegister(MyProvider);
...
TraceLoggingUnregister(MyProvider);
Re-registering a provider should only happen because a component has been
uninitialized and then reinitialized. You should not register and unregister a
provider each time you need to write a few events.
Note that unregistration is important, especially in the case of a shared
object that might be dynamically unloaded before the process ends. Failure to
unregister may cause process memory corruption as the kernel tries to update
the enabled/disabled states of tracepoint variables that no longer exist.
*/
#define TraceLoggingUnregister(providerSymbol) \
(eventheader_close_provider( \
&_tlg_PASTE2(_tlgProv_, providerSymbol) ))
/*
Macro TraceLoggingRegister(providerSymbol):
Call this function to register your provider. Normally you will register at
component initialization (program startup or shared object load) and unregister
at component shutdown (program exit or shared object unload).
Returns 0 for success, errno otherwise. Result is primarily for
debugging/diagnostics and is usually ignored for production code. If
registration fails, subsequent TraceLoggingWrite and TraceLoggingUnregister
will be safe no-ops.
Thread safety: It is NOT safe to call TraceLoggingRegister while a
TraceLoggingRegister or TraceLoggingUnregister for the same provider might be
in progress on another thread.
The provider must be in the "unregistered" state. It is an error to call
TraceLoggingRegister on a provider that is already registered.
*/
#define TraceLoggingRegister(providerSymbol) \
(eventheader_open_provider_with_events( \
&_tlg_PASTE2(_tlgProv_, providerSymbol), \
_tlg_PASTE2(__start__tlgEventPtrs_, providerSymbol), \
_tlg_PASTE2(__stop__tlgEventPtrs_, providerSymbol) ))
/*
Macro TraceLoggingProviderEnabled(providerSymbol, eventLevel, eventKeyword):
Returns true (non-zero) if a TraceLoggingWrite using the specified
providerSymbol, eventLevel, and eventKeyword would be enabled, false if it
would be disabled.
Example:
if (TraceLoggingProviderEnabled(MyProvider, event_level_warning, 0x1f))
{
// Prepare complex data needed for event.
int myIntVar;
wchar_t const* myString;
ExpensiveGetIntVar(&myIntVar);
ExpensiveGetString(&myString);
TraceLoggingWrite(MyProvider, "MyEventName",
TraceLoggingLevel(event_level_warning),
TraceLoggingKeyword(0x1f),
TraceLoggingInt32(myIntVar),
TraceLoggingWideString(myString));
CleanupString(myString);
}
Note that the TraceLoggingWrite macro already checks whether the tracepoint is
enabled -- it skips evaluating the field value expressions and skips sending
the event if the tracepoint is not enabled. You only need to make your own
call to TraceLoggingProviderEnabled if you want to control something other
than TraceLoggingWrite.
Implementation details: This macro registers an inert tracepoint with the
specified provider, level, and keyword, and returns true if that tracepoint is
enabled.
*/
#define TraceLoggingProviderEnabled(providerSymbol, eventLevel, eventKeyword) ({ \
enum { \
_tlgKeywordEnum = (uint64_t)(eventKeyword), \
_tlgLevelEnum = (uint64_t)(eventLevel) \
}; \
static tracepoint_state _tlgEvtState = TRACEPOINT_STATE_INIT; \
static eventheader_tracepoint const _tlgEvt = { \
&_tlgEvtState, \
(eventheader_extension*)0, \
{ \
eventheader_flag_default, \
0, \
0, \
0, \
0, \
_tlgLevelEnum \
}, \
_tlgKeywordEnum \
}; \
static eventheader_tracepoint const* const _tlgEvtPtr \
__attribute__((section("_tlgEventPtrs_" _tlg_STRINGIZE(providerSymbol)), used)) \
= &_tlgEvt; \
TRACEPOINT_ENABLED(&_tlgEvtState); })
/*
Macro TraceLoggingProviderName(providerSymbol):
Returns the provider's name as a nul-terminated const char*.
*/
#define TraceLoggingProviderName(providerSymbol) \
(&_tlg_PASTE2(_tlgProv_, providerSymbol).name[0])
/*
Macro TraceLoggingProviderOptions(providerSymbol):
Returns the provider's options as a nul-terminated const char*.
*/
#define TraceLoggingProviderOptions(providerSymbol) \
(&_tlg_PASTE2(_tlgProv_, providerSymbol).options[0])
/*
Macro TraceLoggingWrite(providerSymbol, "EventName", args...):
Invoke this macro to log an event.
Example:
TraceLoggingWrite(MyProvider, "MyEventName",
TraceLoggingInt32(myIntVar),
TraceLoggingWideString(myString));
The eventName parameter must be a char string literal (not a variable) and must
not contain any ';' or '\0' characters. The name will be treated as utf-8.
Supports up to 99 args (subject to compiler limitations). Each arg must be a
wrapper macro such as TraceLoggingLevel, TraceLoggingKeyword, TraceLoggingInt32,
TraceLoggingString, etc.
Returns:
- 0 for success.
- EBADF if the tracepoint is unregistered or if nobody is listening for this
tracepoint.
- Other errno value for failure.
Note that the return value is primarily for debugging and diagnostics. Most
users will ignore the return value in production code since most components
should continue to operate normally even if the logging is not hooked-up.
*/
#define TraceLoggingWrite(providerSymbol, eventName, ...) \
_tlgWriteImp(providerSymbol, eventName, _tlg_NULL, _tlg_NULL, ##__VA_ARGS__)
/*
Macro TraceLoggingWriteActivity(providerSymbol, "EventName", pActivityId, pRelatedActivityId, args...):
Invoke this macro to log an event with ActivityId and optional RelatedActivityId data.
Example:
TraceLoggingWriteActivity(MyProvider, "MyEventName",
pActivityGuid, // 128-bit ID, i.e. uint8_t[16].
pRelatedActivityGuid, // 128-bit ID, or NULL. Usually NULL (non-NULL only when used with opcode START).
TraceLoggingOpcode(WINEVENT_OPCODE_START),
TraceLoggingInt32(myIntVar),
TraceLoggingWideString(myString));
The event name must be a char string literal (not a variable) and must not
contain any ';' or '\0' characters. The name will be treated as utf-8.
Supports up to 99 args (subject to compiler limitations). Each arg must be a
wrapper macro such as TraceLoggingLevel, TraceLoggingKeyword, TraceLoggingInt32,
TraceLoggingString, etc.
Returns:
- 0 for success.
- EBADF if the tracepoint is unregistered or if nobody is listening for this
tracepoint.
- Other errno value for failure.
Note that the return value is primarily for debugging and diagnostics. Most
users will ignore the return value in production code since most components
should continue to operate normally even if the logging is not hooked-up.
*/
#define TraceLoggingWriteActivity(providerSymbol, eventName, pActivityId, pRelatedActivityId, ...) \
_tlgWriteImp(providerSymbol, eventName, pActivityId, pRelatedActivityId, ##__VA_ARGS__)
/*
Macro TraceLoggingLevel(eventLevel)
Wrapper macro for setting the event's level.
Example:
TraceLoggingWrite(MyProvider, "MyEventName",
TraceLoggingLevel(event_level_warning),
TraceLoggingWideString(myString));
The eventLevel parameter must be a compile-time constant 1 to 255, typically
an event_level_??? constant from eventheader.h. If no TraceLoggingLevel(n) arg
is set on an event, the event will default to level 5 (Verbose). If multiple
TraceLoggingLevel(n) args are provided, the level from the last
TraceLoggingLevel(n) will be used.
*/
#define TraceLoggingLevel(eventLevel) _tlgArgLevel(eventLevel)
/*
Macro TraceLoggingKeyword(eventKeyword):
Wrapper macro for setting the event's keyword(s).
Example:
TraceLoggingWrite(MyProvider, "MyEventName",
TraceLoggingKeyword(MyNetworkingKeyword),
TraceLoggingWideString(myString));
The eventKeyword parameter must be a compile-time constant 0 to UINT64_MAX.
Each bit in the parameter corresponds to a user-defined event category. If an
event belongs to multiple categories, the bits for each category should be
OR'd together to create the event's keyword value. If no
TraceLoggingKeyword(n) arg is provided, the default keyword is 0. If multiple
TraceLoggingKeyword(n) args are provided, they are OR'd together.
*/
#define TraceLoggingKeyword(eventKeyword) _tlgArgKeyword(eventKeyword)
/*
Macro TraceLoggingIdVersion(eventId, eventVersion):
Wrapper macro for setting the stable id and/or version for an event.
Example:
TraceLoggingWrite(MyProvider, "MyEventName",
TraceLoggingIdVersion(123, 0),
TraceLoggingWideString(myString));
By default, TraceLogging events have event id = 0 and version = 0, indicating
that they have not been assigned a stable numeric event id. The events are
identified by ProviderName+EventName which is usually sufficient.
In some cases, it is useful to manually assign a stable numeric event id to an
event. This can help with event routing and filtering. Use
TraceLoggingIdVersion to specify the id and version of an event.
- The id should be a manually-assigned value from 1 to 65535.
- The version must be a value from 0 to 255. It should start at 0 and should
be incremented each time the event is changed (e.g. when a field is added,
removed, renamed, or the field type is changed, or if event semantics change
in some other way).
If multiple TraceLoggingIdVersion args are provided, the values from the last
TraceLoggingIdVersion are used.
*/
#define TraceLoggingIdVersion(eventId, eventVersion) _tlgArgIdVersion(eventId, eventVersion)
/*
Macro TraceLoggingOpcode(eventOpcode):
Wrapper macro for setting the event's opcode.
Example:
TraceLoggingWrite(MyProvider, "MyEventName",
TraceLoggingOpcode(event_opcode_activity_start),
TraceLoggingWideString(myString));
The eventOpcode parameter must be a compile-time constant 0 to 255 (typically
an event_opcode_??? constant from eventheader.h). If multiple
TraceLoggingOpcode(n) args are provided, the value from the last
TraceLoggingOpcode(n) is used.
*/
#define TraceLoggingOpcode(eventOpcode) _tlgArgOpcode(eventOpcode)
/*
Macro TraceLoggingEventTag(eventTag):
Wrapper macro for setting the event's tag.
Example:
TraceLoggingWrite(MyProvider, "MyEventName",
TraceLoggingEventTag(0x200),
TraceLoggingWideString(myString));
Tag is a 16-bit integer. The semantics of the tag are defined by the event
provider.
*/
#define TraceLoggingEventTag(eventTag) _tlgArgEventTag(eventTag)
/*
Macro TraceLoggingDescription(description):
Wrapper macro for setting a description for an event.
UserEvents semantics: TraceLoggingDescription has no effect and functions as a
comment.
Example:
TraceLoggingWrite(MyProvider, "MyEventName",
TraceLoggingDescription("My event's detailed description"),
TraceLoggingWideString(myString));
*/
#define TraceLoggingDescription(description) _tlgArgIgnored()
/*
Macro TraceLoggingStruct(fieldCount, "structName", "description", tag):
Wrapper macro for defining a group of related fields in an event.
The description and tag parameters are optional.
The fieldCount parameter must be a compile-time constant 1 to 127. It indicates
the number of fields that will be considered to be part of the struct. A struct
and all of its contained fields count as a single field in any parent structs.
The name parameter must be a char string literal (not a variable) and must not
contain any ';' or '\0' characters.
If provided, the description parameter must be a char string literal.
If provided, the tag parameter must be a 16-bit integer value.
Example:
TraceLoggingWrite(MyProvider, "MyEventName",
TraceLoggingStruct(2, "PersonName"),
TraceLoggingWideString(Last),
TraceLoggingWideString(First));
*/
#define TraceLoggingStruct(fieldCount, name, ...) \
_tlgArgStruct(fieldCount, event_field_encoding_struct, _tlgNdt(TraceLoggingStruct, value, name, ##__VA_ARGS__))
#ifdef __cplusplus
/*
Macro TraceLoggingValue(value, "name", "description", tag):
Wrapper macro for event fields. Automatically deduces value type. C++ only.
The name, description, and tag parameters are optional.
If provided, the name parameter must be a char string literal (not a variable)
and must not contain any ';' or '\0' characters. If the name is not provided,
the value parameter is used to generate a name. Name is treated as utf-8.
If provided, the description parameter must be a string literal.
Field description has no effect and functions as a comment.
If provided, the tag parameter must be a 16-bit integer value.
Examples:
- TraceLoggingValue(val1) // field name = "val1", description = unset, tag = 0.
- TraceLoggingValue(val1, "name") // field name = "name", description = unset, tag = 0.
- TraceLoggingValue(val1, "name", "desc" // field name = "name", description = "desc", tag = 0.
- TraceLoggingValue(val1, "name", "desc", 0x4) // field name = "name", description = "desc", tag = 0x4.
Based on the type of val, TraceLoggingValue(val, ...) is equivalent to one of
the following:
- bool --> TraceLoggingBoolean(val, ...)
- char --> TraceLoggingChar(val, ...)
- char16_t --> TraceLoggingChar16(val, ...)
- char32_t --> TraceLoggingChar32(val, ...)
- wchar_t --> TraceLoggingWChar(val, ...)
- intNN_t --> TraceLoggingIntNN(val, ...)
- uintNN_t --> TraceLoggingUIntNN(val, ...)
- float --> TraceLoggingFloat32(val, ...)
- double --> TraceLoggingFloat64(val, ...)
- const void* --> TraceLoggingPointer(val, ...) // Logs the pointer's value, not the data at which it points.
- const char* --> TraceLoggingString(val, ...) // Assumes nul-terminated latin1 string. NULL is the same as "".
- const char16_t* --> TraceLoggingString16(val, ...) // Assumes nul-terminated utf-16 string. NULL is the same as u"".
- const char32_t* --> TraceLoggingString32(val, ...) // Assumes nul-terminated utf-32 string. NULL is the same as U"".
- const wchar_t* --> TraceLoggingWideString(val, ...) // Assumes nul-terminated utf-16/32 string (based on size of wchar_t). NULL is the same as L"".
*/
#define TraceLoggingValue(value, ...) _tlgArgAuto(value, _tlgNdt(TraceLoggingValue, value, ##__VA_ARGS__))
#endif // __cplusplus
/*
Wrapper macros for event fields with simple scalar values.
Usage: TraceLoggingInt32(value, "name", "description", tag).
The name, description, and tag parameters are optional.
If provided, the name parameter must be a char string literal (not a variable)
and must not contain any ';' or '\0' characters. If the name is not provided,
the value parameter is used to generate a name. Name is treated as utf-8.
If provided, the description parameter must be a string literal.
Field description has no effect and functions as a comment.
If provided, the tag parameter must be a 16-bit integer value.
Notes:
- TraceLoggingBool is for 32-bit boolean values (e.g. int).
- TraceLoggingBoolean is for 8-bit boolean values (e.g. bool or char).
Examples:
- TraceLoggingInt32(val1) // field name = "val1", description = unset, tag = 0.
- TraceLoggingInt32(val1, "name") // field name = "name", description = unset, tag = 0.
- TraceLoggingInt32(val1, "name", "desc") // field name = "name", description = "desc", tag = 0.
- TraceLoggingInt32(val1, "name", "desc", 0x4) // field name = "name", description = "desc", tag = 0x4.
*/
#define TraceLoggingInt8(value, ...) _tlgArgValue(int8_t, value, event_field_encoding_value8, (event_field_format_signed_int), _tlgNdt(TraceLoggingInt8, value, ##__VA_ARGS__))
#define TraceLoggingUInt8(value, ...) _tlgArgValue(uint8_t, value, event_field_encoding_value8, (), _tlgNdt(TraceLoggingUInt8, value, ##__VA_ARGS__))
#define TraceLoggingInt16(value, ...) _tlgArgValue(int16_t, value, event_field_encoding_value16, (event_field_format_signed_int), _tlgNdt(TraceLoggingInt16, value, ##__VA_ARGS__))
#define TraceLoggingUInt16(value, ...) _tlgArgValue(uint16_t, value, event_field_encoding_value16, (), _tlgNdt(TraceLoggingUInt16, value, ##__VA_ARGS__))
#define TraceLoggingInt32(value, ...) _tlgArgValue(int32_t, value, event_field_encoding_value32, (event_field_format_signed_int), _tlgNdt(TraceLoggingInt32, value, ##__VA_ARGS__))
#define TraceLoggingUInt32(value, ...) _tlgArgValue(uint32_t, value, event_field_encoding_value32, (), _tlgNdt(TraceLoggingUInt32, value, ##__VA_ARGS__))
#define TraceLoggingInt64(value, ...) _tlgArgValue(int64_t, value, event_field_encoding_value64, (event_field_format_signed_int), _tlgNdt(TraceLoggingInt64, value, ##__VA_ARGS__))
#define TraceLoggingUInt64(value, ...) _tlgArgValue(uint64_t, value, event_field_encoding_value64, (), _tlgNdt(TraceLoggingUInt64, value, ##__VA_ARGS__))
#define TraceLoggingIntPtr(value, ...) _tlgArgValue(intptr_t, value, event_field_encoding_value_ptr, (event_field_format_signed_int), _tlgNdt(TraceLoggingIntPtr, value, ##__VA_ARGS__))
#define TraceLoggingUIntPtr(value, ...) _tlgArgValue(uintptr_t, value, event_field_encoding_value_ptr, (), _tlgNdt(TraceLoggingUIntPtr, value, ##__VA_ARGS__))
#define TraceLoggingLong(value, ...) _tlgArgValue(signed long, value, event_field_encoding_value_long,(event_field_format_signed_int), _tlgNdt(TraceLoggingLong, value, ##__VA_ARGS__))
#define TraceLoggingULong(value, ...) _tlgArgValue(unsigned long,value, event_field_encoding_value_long,(), _tlgNdt(TraceLoggingULong, value, ##__VA_ARGS__))
#define TraceLoggingHexInt8(value, ...) _tlgArgValue(int8_t, value, event_field_encoding_value8, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexInt8, value, ##__VA_ARGS__))
#define TraceLoggingHexUInt8(value, ...) _tlgArgValue(uint8_t, value, event_field_encoding_value8, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexUInt8, value, ##__VA_ARGS__))
#define TraceLoggingHexInt16(value, ...) _tlgArgValue(int16_t, value, event_field_encoding_value16, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexInt16, value, ##__VA_ARGS__))
#define TraceLoggingHexUInt16(value, ...) _tlgArgValue(uint16_t, value, event_field_encoding_value16, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexUInt16, value, ##__VA_ARGS__))
#define TraceLoggingHexInt32(value, ...) _tlgArgValue(int32_t, value, event_field_encoding_value32, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexInt32, value, ##__VA_ARGS__))
#define TraceLoggingHexUInt32(value, ...) _tlgArgValue(uint32_t, value, event_field_encoding_value32, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexUInt32, value, ##__VA_ARGS__))
#define TraceLoggingHexInt64(value, ...) _tlgArgValue(int64_t, value, event_field_encoding_value64, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexInt64, value, ##__VA_ARGS__))
#define TraceLoggingHexUInt64(value, ...) _tlgArgValue(uint64_t, value, event_field_encoding_value64, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexUInt64, value, ##__VA_ARGS__))
#define TraceLoggingHexIntPtr(value, ...) _tlgArgValue(intptr_t, value, event_field_encoding_value_ptr, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexIntPtr, value, ##__VA_ARGS__))
#define TraceLoggingHexUIntPtr(value, ...) _tlgArgValue(uintptr_t, value, event_field_encoding_value_ptr, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexUIntPtr, value, ##__VA_ARGS__))
#define TraceLoggingHexLong(value, ...) _tlgArgValue(signed long, value, event_field_encoding_value_long,(event_field_format_hex_int), _tlgNdt(TraceLoggingHexLong, value, ##__VA_ARGS__))
#define TraceLoggingHexULong(value, ...) _tlgArgValue(unsigned long,value, event_field_encoding_value_long,(event_field_format_hex_int), _tlgNdt(TraceLoggingHexULong, value, ##__VA_ARGS__))
#define TraceLoggingFloat32(value, ...) _tlgArgValue(float, value, event_field_encoding_value_float,(event_field_format_float), _tlgNdt(TraceLoggingFloat32, value, ##__VA_ARGS__))
#define TraceLoggingFloat64(value, ...) _tlgArgValue(double, value, event_field_encoding_value_double,(event_field_format_float), _tlgNdt(TraceLoggingFloat64, value, ##__VA_ARGS__))
#define TraceLoggingBoolean(value, ...) _tlgArgValue(uint8_t, value, event_field_encoding_value8, (event_field_format_boolean), _tlgNdt(TraceLoggingBoolean, value, ##__VA_ARGS__))
#define TraceLoggingBool(value, ...) _tlgArgValue(int32_t, value, event_field_encoding_value32, (event_field_format_boolean), _tlgNdt(TraceLoggingBool, value, ##__VA_ARGS__))
#define TraceLoggingChar(value, ...) _tlgArgValue(char, value, event_field_encoding_value8, (event_field_format_string8), _tlgNdt(TraceLoggingChar, value, ##__VA_ARGS__))
#define TraceLoggingChar16(value, ...) _tlgArgValue(char16_t, value, event_field_encoding_value16, (event_field_format_string_utf), _tlgNdt(TraceLoggingChar16, value, ##__VA_ARGS__))
#define TraceLoggingChar32(value, ...) _tlgArgValue(char32_t, value, event_field_encoding_value32, (event_field_format_string_utf), _tlgNdt(TraceLoggingChar32, value, ##__VA_ARGS__))
#define TraceLoggingWChar(value, ...) _tlgArgValue(wchar_t, value, event_field_encoding_value_wchar,(event_field_format_string_utf),_tlgNdt(TraceLoggingWChar, value, ##__VA_ARGS__))
#define TraceLoggingPointer(value, ...) _tlgArgValue(void const*, value, event_field_encoding_value_ptr, (event_field_format_hex_int), _tlgNdt(TraceLoggingPointer, value, ##__VA_ARGS__))
#define TraceLoggingPid(value, ...) _tlgArgValue(int32_t, value, event_field_encoding_value32, (event_field_format_pid), _tlgNdt(TraceLoggingPid, value, ##__VA_ARGS__))
#define TraceLoggingPort(value, ...) _tlgArgValue(uint16_t, value, event_field_encoding_value16, (event_field_format_port), _tlgNdt(TraceLoggingPort, value, ##__VA_ARGS__))
#define TraceLoggingErrno(value, ...) _tlgArgValue(int32_t, value, event_field_encoding_value32, (event_field_format_errno), _tlgNdt(TraceLoggingErrno, value, ##__VA_ARGS__))
#define TraceLoggingTime32(value, ...) _tlgArgValue(int32_t, value, event_field_encoding_value32, (event_field_format_time), _tlgNdt(TraceLoggingTime32, value, ##__VA_ARGS__))
#define TraceLoggingTime64(value, ...) _tlgArgValue(int64_t, value, event_field_encoding_value64, (event_field_format_time), _tlgNdt(TraceLoggingTime64, value, ##__VA_ARGS__))
/*
Wrapper macros for GUID/UUID values in big-endian (RFC 4122) byte order.
Usage: TraceLoggingGuid(pValue, "name", "description", tag).
The pValue is expected to be a const uint8_t[16] in big-endian byte order to
match the definition of uuid_t in libuuid.
The name, description, and tag parameters are optional.
If provided, the name parameter must be a char string literal (not a variable)
and must not contain any ';' or '\0' characters. If the name is not provided,
the value parameter is used to generate a name. Name is treated as utf-8.
If provided, the description parameter must be a string literal.
Field description has no effect and functions as a comment.
If provided, the tag parameter must be a 16-bit integer value.
Examples:
- TraceLoggingGuid(val1) // field name = "val1", description = unset, tag = 0.
- TraceLoggingGuid(val1, "name") // field name = "name", description = unset, tag = 0.
- TraceLoggingGuid(val1, "name", "desc") // field name = "name", description = "desc", tag = 0.
- TraceLoggingGuid(val1, "name", "desc", 0x4) // field name = "name", description = "desc", tag = 0x4.
*/
#define TraceLoggingGuid(pValue, ...) _tlgArgPackedField(uint8_t, pValue, 16, event_field_encoding_value128, (event_field_format_uuid), _tlgNdt(TraceLoggingGuid, pValue, ##__VA_ARGS__))
/*
Wrapper macros for event fields with string values.
Usage: TraceLoggingString(pszVal, "name", "description", tag), where pszVal is const char*.
Usage: TraceLoggingUtf8String(pszVal, "name", "description", tag), where pszVal is const char*.
Usage: TraceLoggingString16(pszVal, "name", "description", tag), where pszVal is const char16_t*.
Usage: TraceLoggingString32(pszVal, "name", "description", tag), where pszVal is const char32_t*.
Usage: TraceLoggingWideString(pszVal, "name", "description", tag), where pszVal is const wchar_t*.
Usage: TraceLoggingCountedString(pchVal, cchVal, "name", "description", tag), where pchVal is const char*.
Usage: TraceLoggingCountedUtf8String(pchVal, cbVal, "name", "description", tag), where pchVal is const char*.
Usage: TraceLoggingCountedString16(pchVal, cchVal, "name", "description", tag), where pchVal is const char16_t*.
Usage: TraceLoggingCountedString32(pchVal, cchVal, "name", "description", tag), where pchVal is const char32_t*.
Usage: TraceLoggingCountedWideString(pchVal, cchVal, "name", "description", tag), where pchVal is const wchar_t*.
The name, description, and tag parameters are optional.
For TraceLoggingString, TraceLoggingUtf8String, TraceLoggingString16,
TraceLoggingString32, and TraceLoggingWideString, the pszValue parameter is
treated as a nul-terminated string. If pszValue is NULL, it is treated as an
empty (zero-length) string.
For TraceLoggingCountedString, TraceLoggingCountedUtf8String,
TraceLoggingCountedString16, TraceLoggingCountedString32, and
TraceLoggingCountedWideString, the pchValue parameter is treated as a counted
string, with cchValue specifying an array element count (0 to 65535).
The pchValue parameter may be NULL only if cchValue is 0.
The name, description, and tag parameters are optional.
If provided, the name parameter must be a char string literal (not a variable)
and must not contain any ';' or '\0' characters. If the name is not provided,
the value parameter is used to generate a name. Name is treated as utf-8.
If provided, the description parameter must be a string literal.
Field description has no effect and functions as a comment.
If provided, the tag parameter must be a 16-bit integer value.
Notes:
- TraceLoggingString and TraceLoggingCountedString use unspecified charset but
are usually treated as latin1 (ISO-8859-1) or CP-1252 text.
- The other macros expect UTF-8, UTF-16 or UTF-32 data.
Examples:
- TraceLoggingString(psz1) // field name = "psz1", description = unset, tag = 0.
- TraceLoggingString(psz1, "name") // field name = "name", description = unset, tag = 0.
- TraceLoggingString(psz1, "name", "desc") // field name = "name", description = "desc", tag = 0.
- TraceLoggingString(psz1, "name", "desc", 0x4) // field name = "name", description = "desc", tag = 0x4.
*/
#define TraceLoggingString(pszValue, ...) _tlgArgStrNul(char, pszValue, event_field_encoding_zstring_char8, (event_field_format_string8),_tlgNdt(TraceLoggingString, pszValue, ##__VA_ARGS__))
#define TraceLoggingUtf8String(pszValue, ...) _tlgArgStrNul(char, pszValue, event_field_encoding_zstring_char8, (), _tlgNdt(TraceLoggingUtf8String, pszValue, ##__VA_ARGS__))
#define TraceLoggingWideString(pszValue, ...) _tlgArgStrNul(wchar_t, pszValue, event_field_encoding_zstring_wchar, (), _tlgNdt(TraceLoggingWideString, pszValue, ##__VA_ARGS__))
#define TraceLoggingString16(pszValue, ...) _tlgArgStrNul(char16_t, pszValue, event_field_encoding_zstring_char16, (), _tlgNdt(TraceLoggingString16, pszValue, ##__VA_ARGS__))
#define TraceLoggingString32(pszValue, ...) _tlgArgStrNul(char32_t, pszValue, event_field_encoding_zstring_char32, (), _tlgNdt(TraceLoggingString32, pszValue, ##__VA_ARGS__))
#define TraceLoggingCountedString(pchValue, cchValue, ...) _tlgArgStrCch(char, pchValue, cchValue, event_field_encoding_string_length16_char8, (event_field_format_string8),_tlgNdt(TraceLoggingCountedString, pchValue, ##__VA_ARGS__))
#define TraceLoggingCountedUtf8String(pchValue, cbValue, ...) _tlgArgStrCch(char, pchValue, cbValue, event_field_encoding_string_length16_char8, (), _tlgNdt(TraceLoggingCountedUtf8String, pchValue, ##__VA_ARGS__))
#define TraceLoggingCountedWideString(pchValue, cchValue, ...) _tlgArgStrCch(wchar_t, pchValue, cchValue, event_field_encoding_string_length16_wchar, (), _tlgNdt(TraceLoggingCountedWideString, pchValue, ##__VA_ARGS__))
#define TraceLoggingCountedString16(pchValue, cchValue, ...) _tlgArgStrCch(char16_t, pchValue, cchValue, event_field_encoding_string_length16_char16,(), _tlgNdt(TraceLoggingCountedString16, pchValue, ##__VA_ARGS__))
#define TraceLoggingCountedString32(pchValue, cchValue, ...) _tlgArgStrCch(char32_t, pchValue, cchValue, event_field_encoding_string_length16_char32,(), _tlgNdt(TraceLoggingCountedString32, pchValue, ##__VA_ARGS__))
/*
Wrapper macro for raw binary data.
Usage: TraceLoggingBinary(pValue, cbValue, "name", "description", tag).
Usage: TraceLoggingBinaryEx(pValue, cbValue, format, "name", "description", tag).
Use TraceLoggingBinary for normal binary data (event_field_format_hex_bytes).
Use TraceLoggingBinaryEx to specify a custom format.
The pValue parameter is treated as a const void* so that any kind of data can
be provided. The cbValue parameter is the data size in bytes (0 to 65535).
The name, description, and tag parameters are optional.
If provided, the name parameter must be a char string literal (not a variable)
and must not contain any ';' or '\0' characters. If the name is not provided,
the value parameter is used to generate a name. Name is treated as utf-8.
If provided, the description parameter must be a string literal.
Field description has no effect and functions as a comment.
If provided, the tag parameter must be a 16-bit integer value.
Examples:
- TraceLoggingBinary(pObj, sizeof(*pObj)) // field name = "pObj", description = unset, tag = 0.
- TraceLoggingBinary(pObj, sizeof(*pObj), "name") // field name = "name", description = unset, tag = 0.
- TraceLoggingBinary(pObj, sizeof(*pObj), "name", "desc") // field name = "name", description = "desc", tag = 0.
- TraceLoggingBinary(pObj, sizeof(*pObj), "name", "desc", 0x4) // field name = "name", description = "desc", tag = 0x4.
*/
#define TraceLoggingBinary(pValue, cbValue, ...) _tlgArgBin(void, pValue, cbValue, event_field_encoding_string_length16_char8, (event_field_format_hex_bytes), _tlgNdt(TraceLoggingBinary, pValue, ##__VA_ARGS__))
#define TraceLoggingBinaryEx(pValue, cbValue, format, ...) _tlgArgBin(void, pValue, cbValue, event_field_encoding_string_length16_char8, (format), _tlgNdt(TraceLoggingBinaryEx, pValue, ##__VA_ARGS__))
/*
Wrapper macro for event fields with IPv4 address values.
Usage: TraceLoggingIPv4Address(value, "name", "description", tag).
The value parameter must be a UINT32-encoded IPv4 address in
network byte order (e.g. pSock->sin_addr.s_addr).
The name, description, and tag parameters are optional.
If provided, the name parameter must be a char string literal (not a variable)
and must not contain any ';' or '\0' characters. If the name is not provided,
the value parameter is used to generate a name. Name is treated as utf-8.
If provided, the description parameter must be a string literal.
Field description has no effect and functions as a comment.
If provided, the tag parameter must be a 16-bit integer value.
Example:
- TraceLoggingIPv4Address(pSockAddr->sin_addr.s_addr, "name").
*/
#define TraceLoggingIPv4Address(value, ...) _tlgArgValue(uint32_t, value, event_field_encoding_value32, (event_field_format_ipv4), _tlgNdt(TraceLoggingIPv4Address, value, ##__VA_ARGS__))
/*
Wrapper macro for event fields with IPv6 address values.
Usage: TraceLoggingIPv6Address(pValue, "name", "description", tag).
The pValue parameter must not be NULL and must point at a 16-byte buffer
(e.g. use &pSock->sin6_addr).
The name, description, and tag parameters are optional.
If provided, the name parameter must be a char string literal (not a variable)
and must not contain any ';' or '\0' characters. If the name is not provided,
the value parameter is used to generate a name. Name is treated as utf-8.
If provided, the description parameter must be a string literal.
Field description has no effect and functions as a comment.
If provided, the tag parameter must be a 16-bit integer value.
Example:
- TraceLoggingIPv6Address(&pSockAddr->sin6_addr, "name").
*/
#define TraceLoggingIPv6Address(pValue, ...) _tlgArgPackedField(void, pValue, 16, event_field_encoding_value128, (event_field_format_ipv6), _tlgNdt(TraceLoggingIPv6Address, pValue, ##__VA_ARGS__))
/*
Wrapper macros for event fields with values that are fixed-length arrays.
Usage: TraceLoggingInt32FixedArray(pVals, cVals, "name", "description", tag).
The pVals parameter must be a pointer to cVals items of the specified type.
The cVals parameter must be a compile-time constant element count 1..65535.
The name, description, and tag parameters are optional.
If provided, the name parameter must be a char string literal (not a variable)
and must not contain any ';' or '\0' characters. If the name is not provided,
the value parameter is used to generate a name. Name is treated as utf-8.
If provided, the description parameter must be a string literal.
Field description has no effect and functions as a comment.
If provided, the tag parameter must be a 16-bit integer value.
Examples:
- TraceLoggingUInt8FixedArray(pbX1, 32) // field name = "pbX1", description = unset, tag = 0.
- TraceLoggingUInt8FixedArray(pbX1, 32, "name") // field name = "name", description = unset, tag = 0.
- TraceLoggingUInt8FixedArray(pbX1, 32, "name", "desc") // field name = "name", description = "desc", tag = 0.
- TraceLoggingUInt8FixedArray(pbX1, 32, "name", "desc", 0x4) // field name = "name", description = "desc", tag = 0x4.
*/
#define TraceLoggingInt8FixedArray(pValues, cValues, ...) _tlgArgCArray(int8_t, pValues, cValues, event_field_encoding_value8, (event_field_format_signed_int), _tlgNdt(TraceLoggingInt8FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingUInt8FixedArray(pValues, cValues, ...) _tlgArgCArray(uint8_t, pValues, cValues, event_field_encoding_value8, (), _tlgNdt(TraceLoggingUInt8FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingInt16FixedArray(pValues, cValues, ...) _tlgArgCArray(int16_t, pValues, cValues, event_field_encoding_value16, (event_field_format_signed_int), _tlgNdt(TraceLoggingInt16FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingUInt16FixedArray(pValues, cValues, ...) _tlgArgCArray(uint16_t, pValues, cValues, event_field_encoding_value16, (), _tlgNdt(TraceLoggingUInt16FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingInt32FixedArray(pValues, cValues, ...) _tlgArgCArray(int32_t, pValues, cValues, event_field_encoding_value32, (event_field_format_signed_int), _tlgNdt(TraceLoggingInt32FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingUInt32FixedArray(pValues, cValues, ...) _tlgArgCArray(uint32_t, pValues, cValues, event_field_encoding_value32, (), _tlgNdt(TraceLoggingUInt32FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingInt64FixedArray(pValues, cValues, ...) _tlgArgCArray(int64_t, pValues, cValues, event_field_encoding_value64, (event_field_format_signed_int), _tlgNdt(TraceLoggingInt64FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingUInt64FixedArray(pValues, cValues, ...) _tlgArgCArray(uint64_t, pValues, cValues, event_field_encoding_value64, (), _tlgNdt(TraceLoggingUInt64FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingIntPtrFixedArray(pValues, cValues, ...) _tlgArgCArray(intptr_t, pValues, cValues, event_field_encoding_value_ptr,(event_field_format_signed_int), _tlgNdt(TraceLoggingIntPtrFixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingUIntPtrFixedArray(pValues, cValues, ...) _tlgArgCArray(uintptr_t, pValues, cValues, event_field_encoding_value_ptr,(), _tlgNdt(TraceLoggingUIntPtrFixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingLongFixedArray(pValues, cValues, ...) _tlgArgCArray(signed long, pValues, cValues, event_field_encoding_value_long,(event_field_format_signed_int),_tlgNdt(TraceLoggingLongFixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingULongFixedArray(pValues, cValues, ...) _tlgArgCArray(unsigned long,pValues,cValues, event_field_encoding_value_long,(), _tlgNdt(TraceLoggingULongFixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingHexInt8FixedArray(pValues, cValues, ...) _tlgArgCArray(int8_t, pValues, cValues, event_field_encoding_value8, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexInt8FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingHexUInt8FixedArray(pValues, cValues, ...) _tlgArgCArray(uint8_t, pValues, cValues, event_field_encoding_value8, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexUInt8FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingHexInt16FixedArray(pValues, cValues, ...) _tlgArgCArray(int16_t, pValues, cValues, event_field_encoding_value16, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexInt16FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingHexUInt16FixedArray(pValues, cValues, ...) _tlgArgCArray(uint16_t, pValues, cValues, event_field_encoding_value16, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexUInt16FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingHexInt32FixedArray(pValues, cValues, ...) _tlgArgCArray(int32_t, pValues, cValues, event_field_encoding_value32, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexInt32FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingHexUInt32FixedArray(pValues, cValues, ...) _tlgArgCArray(uint32_t, pValues, cValues, event_field_encoding_value32, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexUInt32FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingHexInt64FixedArray(pValues, cValues, ...) _tlgArgCArray(int64_t, pValues, cValues, event_field_encoding_value64, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexInt64FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingHexUInt64FixedArray(pValues, cValues, ...) _tlgArgCArray(uint64_t, pValues, cValues, event_field_encoding_value64, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexUInt64FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingHexIntPtrFixedArray(pValues, cValues, ...) _tlgArgCArray(intptr_t, pValues, cValues, event_field_encoding_value_ptr, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexIntPtrFixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingHexUIntPtrFixedArray(pValues, cValues, ...) _tlgArgCArray(uintptr_t, pValues, cValues, event_field_encoding_value_ptr, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexUIntPtrFixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingHexLongFixedArray(pValues, cValues, ...) _tlgArgCArray(signed long, pValues, cValues, event_field_encoding_value_long,(event_field_format_hex_int), _tlgNdt(TraceLoggingHexLongFixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingHexULongFixedArray(pValues, cValues, ...) _tlgArgCArray(unsigned long,pValues,cValues, event_field_encoding_value_long,(event_field_format_hex_int), _tlgNdt(TraceLoggingHexULongFixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingFloat32FixedArray(pValues, cValues, ...) _tlgArgCArray(float, pValues, cValues, event_field_encoding_value_float,(event_field_format_float), _tlgNdt(TraceLoggingFloat32FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingFloat64FixedArray(pValues, cValues, ...) _tlgArgCArray(double, pValues, cValues, event_field_encoding_value_double,(event_field_format_float), _tlgNdt(TraceLoggingFloat64FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingBooleanFixedArray(pValues, cValues, ...) _tlgArgCArray(uint8_t, pValues, cValues, event_field_encoding_value8, (event_field_format_boolean), _tlgNdt(TraceLoggingBooleanFixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingBoolFixedArray(pValues, cValues, ...) _tlgArgCArray(int32_t, pValues, cValues, event_field_encoding_value32, (event_field_format_boolean), _tlgNdt(TraceLoggingBoolFixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingCharFixedArray(pValues, cValues, ...) _tlgArgCArray(char, pValues, cValues, event_field_encoding_value8, (event_field_format_string8), _tlgNdt(TraceLoggingCharFixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingChar16FixedArray(pValues, cValues, ...) _tlgArgCArray(char16_t, pValues, cValues, event_field_encoding_value16, (event_field_format_string_utf), _tlgNdt(TraceLoggingChar16FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingChar32FixedArray(pValues, cValues, ...) _tlgArgCArray(char32_t, pValues, cValues, event_field_encoding_value32, (event_field_format_string_utf), _tlgNdt(TraceLoggingChar32FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingWCharFixedArray(pValues, cValues, ...) _tlgArgCArray(wchar_t, pValues, cValues, event_field_encoding_value_wchar,(event_field_format_string_utf),_tlgNdt(TraceLoggingWCharFixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingPointerFixedArray(pValues, cValues, ...) _tlgArgCArray(void const*, pValues, cValues, event_field_encoding_value_ptr, (event_field_format_hex_int), _tlgNdt(TraceLoggingPointerFixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingPidFixedArray(pValues, cValues, ...) _tlgArgCArray(int32_t, pValues, cValues, event_field_encoding_value32, (event_field_format_pid), _tlgNdt(TraceLoggingPidFixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingPortFixedArray(pValues, cValues, ...) _tlgArgCArray(uint16_t, pValues, cValues, event_field_encoding_value16, (event_field_format_port), _tlgNdt(TraceLoggingPortFixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingErrnoFixedArray(pValues, cValues, ...) _tlgArgCArray(int32_t, pValues, cValues, event_field_encoding_value32, (event_field_format_errno), _tlgNdt(TraceLoggingErrnoFixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingTime32FixedArray(pValues, cValues, ...) _tlgArgCArray(int32_t, pValues, cValues, event_field_encoding_value32, (event_field_format_time), _tlgNdt(TraceLoggingTime32FixedArray, pValues, ##__VA_ARGS__))
#define TraceLoggingTime64FixedArray(pValues, cValues, ...) _tlgArgCArray(int64_t, pValues, cValues, event_field_encoding_value64, (event_field_format_time), _tlgNdt(TraceLoggingTime64FixedArray, pValues, ##__VA_ARGS__))
/*
Wrapper macros for event fields with values that are variable-length arrays.
Usage: TraceLoggingInt32Array(pVals, cVals, "name", "description", tag).
The pVals parameter must be a pointer to cVals items of the specified type.
The cVals parameter must be an element count 0..65535.
The name, description, and tag parameters are optional.
If provided, the name parameter must be a char string literal (not a variable)
and must not contain any ';' or '\0' characters. If the name is not provided,
the value parameter is used to generate a name. Name is treated as utf-8.
If provided, the description parameter must be a string literal.
Field description has no effect and functions as a comment.
If provided, the tag parameter must be a 16-bit integer value.
Examples:
- TraceLoggingUInt8Array(pbX1, cbX1) // field name = "pbX1", description = unset, tag = 0.
- TraceLoggingUInt8Array(pbX1, cbX1, "name") // field name = "name", description = unset, tag = 0.
- TraceLoggingUInt8Array(pbX1, cbX1, "name", "desc") // field name = "name", description = "desc", tag = 0.
- TraceLoggingUInt8Array(pbX1, cbX1, "name", "desc", 0x4) // field name = "name", description = "desc", tag = 0x4.
*/
#define TraceLoggingInt8Array(pValues, cValues, ...) _tlgArgVArray(int8_t, pValues, cValues, event_field_encoding_value8, (event_field_format_signed_int), _tlgNdt(TraceLoggingInt8Array, pValues, ##__VA_ARGS__))
#define TraceLoggingUInt8Array(pValues, cValues, ...) _tlgArgVArray(uint8_t, pValues, cValues, event_field_encoding_value8, (), _tlgNdt(TraceLoggingUInt8Array, pValues, ##__VA_ARGS__))
#define TraceLoggingInt16Array(pValues, cValues, ...) _tlgArgVArray(int16_t, pValues, cValues, event_field_encoding_value16, (event_field_format_signed_int), _tlgNdt(TraceLoggingInt16Array, pValues, ##__VA_ARGS__))
#define TraceLoggingUInt16Array(pValues, cValues, ...) _tlgArgVArray(uint16_t, pValues, cValues, event_field_encoding_value16, (), _tlgNdt(TraceLoggingUInt16Array, pValues, ##__VA_ARGS__))
#define TraceLoggingInt32Array(pValues, cValues, ...) _tlgArgVArray(int32_t, pValues, cValues, event_field_encoding_value32, (event_field_format_signed_int), _tlgNdt(TraceLoggingInt32Array, pValues, ##__VA_ARGS__))
#define TraceLoggingUInt32Array(pValues, cValues, ...) _tlgArgVArray(uint32_t, pValues, cValues, event_field_encoding_value32, (), _tlgNdt(TraceLoggingUInt32Array, pValues, ##__VA_ARGS__))
#define TraceLoggingInt64Array(pValues, cValues, ...) _tlgArgVArray(int64_t, pValues, cValues, event_field_encoding_value64, (event_field_format_signed_int), _tlgNdt(TraceLoggingInt64Array, pValues, ##__VA_ARGS__))
#define TraceLoggingUInt64Array(pValues, cValues, ...) _tlgArgVArray(uint64_t, pValues, cValues, event_field_encoding_value64, (), _tlgNdt(TraceLoggingUInt64Array, pValues, ##__VA_ARGS__))
#define TraceLoggingIntPtrArray(pValues, cValues, ...) _tlgArgVArray(intptr_t, pValues, cValues, event_field_encoding_value_ptr,(event_field_format_signed_int), _tlgNdt(TraceLoggingIntPtrArray, pValues, ##__VA_ARGS__))
#define TraceLoggingUIntPtrArray(pValues, cValues, ...) _tlgArgVArray(uintptr_t, pValues, cValues, event_field_encoding_value_ptr,(), _tlgNdt(TraceLoggingUIntPtrArray, pValues, ##__VA_ARGS__))
#define TraceLoggingLongArray(pValues, cValues, ...) _tlgArgVArray(signed long, pValues, cValues, event_field_encoding_value_long,(event_field_format_signed_int),_tlgNdt(TraceLoggingLongArray, pValues, ##__VA_ARGS__))
#define TraceLoggingULongArray(pValues, cValues, ...) _tlgArgVArray(unsigned long,pValues,cValues, event_field_encoding_value_long,(), _tlgNdt(TraceLoggingULongArray, pValues, ##__VA_ARGS__))
#define TraceLoggingHexInt8Array(pValues, cValues, ...) _tlgArgVArray(int8_t, pValues, cValues, event_field_encoding_value8, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexInt8Array, pValues, ##__VA_ARGS__))
#define TraceLoggingHexUInt8Array(pValues, cValues, ...) _tlgArgVArray(uint8_t, pValues, cValues, event_field_encoding_value8, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexUInt8Array, pValues, ##__VA_ARGS__))
#define TraceLoggingHexInt16Array(pValues, cValues, ...) _tlgArgVArray(int16_t, pValues, cValues, event_field_encoding_value16, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexInt16Array, pValues, ##__VA_ARGS__))
#define TraceLoggingHexUInt16Array(pValues, cValues, ...) _tlgArgVArray(uint16_t, pValues, cValues, event_field_encoding_value16, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexUInt16Array, pValues, ##__VA_ARGS__))
#define TraceLoggingHexInt32Array(pValues, cValues, ...) _tlgArgVArray(int32_t, pValues, cValues, event_field_encoding_value32, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexInt32Array, pValues, ##__VA_ARGS__))
#define TraceLoggingHexUInt32Array(pValues, cValues, ...) _tlgArgVArray(uint32_t, pValues, cValues, event_field_encoding_value32, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexUInt32Array, pValues, ##__VA_ARGS__))
#define TraceLoggingHexInt64Array(pValues, cValues, ...) _tlgArgVArray(int64_t, pValues, cValues, event_field_encoding_value64, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexInt64Array, pValues, ##__VA_ARGS__))
#define TraceLoggingHexUInt64Array(pValues, cValues, ...) _tlgArgVArray(uint64_t, pValues, cValues, event_field_encoding_value64, (event_field_format_hex_int), _tlgNdt(TraceLoggingHexUInt64Array, pValues, ##__VA_ARGS__))
#define TraceLoggingHexIntPtrArray(pValues, cValues, ...) _tlgArgVArray(intptr_t, pValues, cValues, event_field_encoding_value_ptr,(event_field_format_hex_int), _tlgNdt(TraceLoggingHexIntPtrArray, pValues, ##__VA_ARGS__))
#define TraceLoggingHexUIntPtrArray(pValues, cValues, ...) _tlgArgVArray(uintptr_t, pValues, cValues, event_field_encoding_value_ptr,(event_field_format_hex_int), _tlgNdt(TraceLoggingHexUIntPtrArray, pValues, ##__VA_ARGS__))
#define TraceLoggingHexLongArray(pValues, cValues, ...) _tlgArgVArray(signed long, pValues, cValues, event_field_encoding_value_long,(event_field_format_hex_int), _tlgNdt(TraceLoggingHexLongArray, pValues, ##__VA_ARGS__))
#define TraceLoggingHexULongArray(pValues, cValues, ...) _tlgArgVArray(unsigned long,pValues,cValues, event_field_encoding_value_long,(event_field_format_hex_int), _tlgNdt(TraceLoggingHexULongArray, pValues, ##__VA_ARGS__))
#define TraceLoggingFloat32Array(pValues, cValues, ...) _tlgArgVArray(float, pValues, cValues, event_field_encoding_value_float,(event_field_format_float), _tlgNdt(TraceLoggingFloat32Array, pValues, ##__VA_ARGS__))
#define TraceLoggingFloat64Array(pValues, cValues, ...) _tlgArgVArray(double, pValues, cValues, event_field_encoding_value_double,(event_field_format_float), _tlgNdt(TraceLoggingFloat64Array, pValues, ##__VA_ARGS__))
#define TraceLoggingBooleanArray(pValues, cValues, ...) _tlgArgVArray(uint8_t, pValues, cValues, event_field_encoding_value8, (event_field_format_boolean), _tlgNdt(TraceLoggingBooleanArray, pValues, ##__VA_ARGS__))
#define TraceLoggingBoolArray(pValues, cValues, ...) _tlgArgVArray(int32_t, pValues, cValues, event_field_encoding_value32, (event_field_format_boolean), _tlgNdt(TraceLoggingBoolArray, pValues, ##__VA_ARGS__))
#define TraceLoggingCharArray(pValues, cValues, ...) _tlgArgVArray(char, pValues, cValues, event_field_encoding_value8, (event_field_format_string8), _tlgNdt(TraceLoggingCharArray, pValues, ##__VA_ARGS__))
#define TraceLoggingChar16Array(pValues, cValues, ...) _tlgArgVArray(char16_t, pValues, cValues, event_field_encoding_value16, (event_field_format_string_utf), _tlgNdt(TraceLoggingChar16Array, pValues, ##__VA_ARGS__))
#define TraceLoggingChar32Array(pValues, cValues, ...) _tlgArgVArray(char32_t, pValues, cValues, event_field_encoding_value32, (event_field_format_string_utf), _tlgNdt(TraceLoggingChar32Array, pValues, ##__VA_ARGS__))
#define TraceLoggingWCharArray(pValues, cValues, ...) _tlgArgVArray(wchar_t, pValues, cValues, event_field_encoding_value_wchar,(event_field_format_string_utf),_tlgNdt(TraceLoggingWCharArray, pValues, ##__VA_ARGS__))
#define TraceLoggingPointerArray(pValues, cValues, ...) _tlgArgVArray(void const*, pValues, cValues, event_field_encoding_value_ptr,(event_field_format_hex_int), _tlgNdt(TraceLoggingPointerArray, pValues, ##__VA_ARGS__))
#define TraceLoggingPidArray(pValues, cValues, ...) _tlgArgVArray(int32_t, pValues, cValues, event_field_encoding_value32, (event_field_format_pid), _tlgNdt(TraceLoggingPidArray, pValues, ##__VA_ARGS__))
#define TraceLoggingPortArray(pValues, cValues, ...) _tlgArgVArray(uint16_t, pValues, cValues, event_field_encoding_value16, (event_field_format_port), _tlgNdt(TraceLoggingPortArray, pValues, ##__VA_ARGS__))
#define TraceLoggingErrnoArray(pValues, cValues, ...) _tlgArgVArray(int32_t, pValues, cValues, event_field_encoding_value32, (event_field_format_errno), _tlgNdt(TraceLoggingErrnoArray, pValues, ##__VA_ARGS__))
#define TraceLoggingTime32Array(pValues, cValues, ...) _tlgArgVArray(int32_t, pValues, cValues, event_field_encoding_value32, (event_field_format_time), _tlgNdt(TraceLoggingTime32Array, pValues, ##__VA_ARGS__))
#define TraceLoggingTime64Array(pValues, cValues, ...) _tlgArgVArray(int64_t, pValues, cValues, event_field_encoding_value64, (event_field_format_time), _tlgNdt(TraceLoggingTime64Array, pValues, ##__VA_ARGS__))
/*
Wrapper macros for manually-packed fields (advanced scenarios).
These macros support custom serialization of fields for use in creating events
that would otherwise be inexpressible through TraceLoggingProvider.h. For
example, these macros can be used to write fields containing arrays of strings
or arrays of structures. That the correct use of these macros requires an
understanding of how TraceLogging encodes events. If used incorrectly, these
macros will generate events that do not decode correctly. Note that to write
arrays of strings or arrays of structures, you will usually need to do
additional work such as manually marshaling the data into a buffer before
invoking TraceLoggingWrite.
TraceLoggingPackedField(pValue, cbValue, encoding, "name", "description", tag)
TraceLoggingPackedFieldEx(pValue, cbValue, encoding, format, "name", "description", tag)
TraceLoggingPackedMetadata(encoding, "name", "description", tag)
TraceLoggingPackedMetadataEx(encoding, format, "name", "description", tag)
TraceLoggingPackedStruct(fieldCount, "name", "description", tag)
TraceLoggingPackedStructArray(fieldCount, "name", "description", tag)
TraceLoggingPackedData(pValue, cbValue)
The name parameter must be a char string literal (not a variable) and must not
contain any ';' or '\0' characters. Name is treated as utf-8. For
TraceLoggingPackedField and TraceLoggingPackedFieldEx, the name parameter is
optional. If the name is not provided, the TraceLoggingPackedField and
TraceLoggingPackedFieldEx macros will use the pValue parameter to automatically
generate a field name.
If provided, the description parameter must be a string literal.
Field description has no effect and functions as a comment.
If provided, the tag parameter must be a 16-bit integer value.
A TraceLogging event contains metadata and data. The metadata is the list of
fields, each with a name and a type. The data is the payload - an array of
raw bytes that contains the values of the event fields. The metadata is
composed of compile-time-constant data, while the data can be different each
time the event is generated. The metadata is used to decode the data, so the
metadata and the data need to be coordinated. The other wrapper macros
(TraceLoggingInt32, TraceLoggingString, etc.) automatically keep the metadata
and data coordinated, but the TraceLoggingPacked macros allow direct control