dotnet / dotnet/diagnostics

dotnet trace with EtwSelfDescribingEventFormat produces unreadable events

Open
#2,367 2 comments 0 reactions 1 assignee Claimed by @josalem View on GitHub
bug dotnet-trace
Dominant language
C++
Stars
1.3k
Forks
404
Avg merge
2d 3h
Merged PRs (30d)
38

Description

When running `dotnet trace` to collect events emitted by an `EventSource` created with `EtwSelfDescribingEventFormat`, the trace file will contain unreadable data for some events.

Repro program: [TraceTest.cs](https://gist.github.com/MihaZupan/986f5cc60bf6b4d64e51de35f3f9a603)

The repro has two `EventSource`s.
`FooTelemetry` uses `EtwSelfDescribingEventFormat` and `BarTelemetry` uses `EtwManifestEventFormat`.

When using `EtwSelfDescribingEventFormat` the `bool` argument will be encoded in the payload as a single byte.
![image](https://user-images.githubusercontent.com/25307628/121968978-31a1b800-cd28-11eb-9e06-0c6e33813bab.png)
![image](https://user-images.githubusercontent.com/25307628/121969090-6f9edc00-cd28-11eb-8e52-7e63fdefdac6.png)

When using `EtwManifestEventFormat`, the `bool` will be encoded as 4 bytes.
![image](https://user-images.githubusercontent.com/25307628/121969039-5138e080-cd28-11eb-9500-011e4fb54713.png)
![image](https://user-images.githubusercontent.com/25307628/121969133-7fb6bb80-cd28-11eb-9bec-4a4419027358.png)

Screenshots above are from a trace collected by `dotnet trace` viewed in PerfView - it appears PerfView tries to interpret the bools in the payload as 4 bytes in both cases.

If the traces are instead collected from within PerfView, both formats work fine.

Attaching the traces collected by `dotnet trace` and `PerfView` if it's any help.
You can see `FooTelemetry` is broken for `dotnet trace` while all other configurations work.
[Traces.zip](https://github.com/dotnet/diagnostics/files/6651681/Traces.zip)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.