Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use latest TraceLoggingDynamic.h #1354

Merged
merged 10 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions exporters/etw/include/opentelemetry/exporters/etw/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
TraceLogging Dynamic for Windows

Copyright (c) Microsoft Corporation. All rights reserved.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ namespace tld
}

void AddBytes(
_In_bytecount_(cb) void const* p,
_In_reads_bytes_(cb) void const* p,
unsigned cb)
{
auto pb = static_cast<UINT8 const*>(p);
Expand Down Expand Up @@ -2064,7 +2064,7 @@ namespace tld

void AddTrait(
ProviderTraitType type,
_In_bytecount_(cbData) void const* pData,
_In_reads_bytes_(cbData) void const* pData,
unsigned cbData)
{
this->AddU16(static_cast<UINT16>(cbData + 3));
Expand Down Expand Up @@ -2232,6 +2232,7 @@ namespace tld
return this->BaseEnd();
}

// Note: Do not create structs with 0 fields.
template<class CharTy>
EventMetadataBuilder AddStruct(
_In_z_ CharTy const* szUtfStructName,
Expand All @@ -2242,6 +2243,7 @@ namespace tld
return EventMetadataBuilder(this->GetBuffer(), bookmark);
}

// Note: Do not create structs with 0 fields.
template<class CharTy>
UINT32 AddStructRaw(
_In_z_ CharTy const* szUtfStructName,
Expand All @@ -2252,6 +2254,7 @@ namespace tld
return bookmark;
}

// Note: Do not create structs with 0 fields.
template<class CharTy>
EventMetadataBuilder AddStructArray(
_In_z_ CharTy const* szUtfStructName,
Expand All @@ -2262,6 +2265,8 @@ namespace tld
return EventMetadataBuilder(this->GetBuffer(), bookmark);
}

// Note: Do not use 0 for itemCount.
// Note: Do not create structs with 0 fields.
template<class CharTy>
EventMetadataBuilder AddStructFixedArray(
_In_z_ CharTy const* szUtfStructName,
Expand Down Expand Up @@ -2294,6 +2299,7 @@ namespace tld
AddFieldInfo(InMetaVcount, type, fieldTags);
}

// Note: Do not use 0 for itemCount.
template<class CharTy>
void AddFieldFixedArray(
_In_z_ CharTy const* szUtfFieldName,
Expand Down Expand Up @@ -2400,7 +2406,7 @@ namespace tld
Note: should only be used for blittable POD types with no padding.
*/
template<class T>
void AddValues(_In_count_(cValues) T const* pValues, unsigned cValues)
void AddValues(_In_reads_(cValues) T const* pValues, unsigned cValues)
{
AddBytes(pValues, sizeof(T) * cValues);
}
Expand Down Expand Up @@ -2917,6 +2923,7 @@ namespace tld
of the nested struct.
Note: do not call any Add methods on this builder object until you are
done calling Add methods on the nested builder object.
Note: Do not create structs with 0 fields.
*/
template<class CharTy>
EventBuilder AddStruct(
Expand All @@ -2933,6 +2940,7 @@ namespace tld
of the nested struct.
Note: do not call any Add methods on this builder object until you are
done calling Add methods on the nested builder object.
Note: Do not create structs with 0 fields.
*/
template<class CharTy>
EventBuilder AddStructArray(
Expand All @@ -2949,6 +2957,8 @@ namespace tld
of the nested struct.
Note: do not call any Add methods on this builder object until you are
done calling Add methods on the nested builder object.
Note: Do not use 0 for itemCount.
Note: Do not create structs with 0 fields.
*/
template<class CharTy>
EventBuilder AddStructFixedArray(
Expand Down Expand Up @@ -2992,6 +3002,7 @@ namespace tld
Adds a fixed-length array field to the event's metadata.
The length (item count) is encoded in the metadata, so it does not
need to be included in the event's payload.
Note: Do not use 0 for itemCount.
*/
template<class CharTy>
void AddFieldFixedArray(
Expand Down Expand Up @@ -3061,7 +3072,7 @@ namespace tld
e.g. INT32, FILETIME, GUID, not for strings or structs.
*/
template<class T>
void AddValues(_In_count_(cValues) T const* pValues, unsigned cValues)
void AddValues(_In_reads_(cValues) T const* pValues, unsigned cValues)
{
m_dataBuilder.AddValues(pValues, cValues);
}
Expand Down