Skip to content

Commit

Permalink
Use latest TraceLoggingDynamic.h (#1354)
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb authored Apr 27, 2022
1 parent 72360b4 commit 4008da5
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
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

1 comment on commit 4008da5

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp sdk Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 4008da5 Previous: 72360b4 Ratio
BM_BaselineBuffer/1 8448460.102081299 ns/iter 794114.1091487898 ns/iter 10.64
BM_LockFreeBuffer/1 3682804.822921753 ns/iter 313561.7491647321 ns/iter 11.75
BM_LockFreeBuffer/2 3845851.158218639 ns/iter 1294217.586517334 ns/iter 2.97

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.