| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
auto trace_packet = trace_writer_->NewTracePacket();
trace_packet->set_sequence_flags(
perfetto::protos::pbzero::TracePacket::SEQ_INCREMENTAL_STATE_CLEARED);Can we reuse this packet in EtwConsumer::StartNewPacket instead of creating a new one? (maybe this can be achieved simply by early exit below)
It seems like ResetEmittedState() can also be called from HandleStackWalkEvent, in which case we don't set top level timestamp.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
auto trace_packet = trace_writer_->NewTracePacket();
trace_packet->set_sequence_flags(
perfetto::protos::pbzero::TracePacket::SEQ_INCREMENTAL_STATE_CLEARED);Can we reuse this packet in EtwConsumer::StartNewPacket instead of creating a new one? (maybe this can be achieved simply by early exit below)
It seems like ResetEmittedState() can also be called from HandleStackWalkEvent, in which case we don't set top level timestamp.
Done - thanks for the guidance, fixing this made it a lot simpler and also fixed the trybots : ) Now `NewTracePacket` is only called from `StartNewPacket`, which makes a lot more sense.
Please feel free to let me know if anything else seems off.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
ResetEmittedState();This will clear `reset_emitted_state_`, which means the following call to StartNewPacket (below `interned_callstack.was_emitted` will always be false following ResetEmittedState) would incorrectly use SEQ_NEEDS_INCREMENTAL_STATE?
Maybe we make ResetEmittedState() *not* update reset_emitted_state_ (and only clear the cache), and we do in StartNewPacket something like:
```
if (reset_emitted_state_.exchange(false, std::memory_order_relaxed)) {
ResetEmittedState();
sequence_flags =
perfetto::protos::pbzero::TracePacket::SEQ_INCREMENTAL_STATE_CLEARED;
}
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
This will clear `reset_emitted_state_`, which means the following call to StartNewPacket (below `interned_callstack.was_emitted` will always be false following ResetEmittedState) would incorrectly use SEQ_NEEDS_INCREMENTAL_STATE?
Maybe we make ResetEmittedState() *not* update reset_emitted_state_ (and only clear the cache), and we do in StartNewPacket something like:
```
if (reset_emitted_state_.exchange(false, std::memory_order_relaxed)) {
ResetEmittedState();
sequence_flags =
perfetto::protos::pbzero::TracePacket::SEQ_INCREMENTAL_STATE_CLEARED;
}
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
Thanks for the thorough review!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
etw-stackwalk: clear initial incremental state
https://crrev.com/c/7794326 added flags SEQ_NEEDS_INCREMENTAL_STATE and
SEQ_INCREMENTAL_STATE_CLEARED to trace packets emitted by EtwConsumer.
However, that seems to cause an error when opening traces with
EtwConsumer events [1].
According to trace_packet.proto, packets with the
SEQ_NEEDS_INCREMENTAL_STATE flag must be preceded by packets with the
SEQ_INCREMENTAL_STATE_CLEARED flag. This change ensures that the first
trace packet and those after incremental state is reset are preceded by
a packet with the SEQ_INCREMENTAL_STATE_CLEARED flag.
[1] Error:
traced_buf_incremental_sequences_dropped
For a given buffer, indicates the number of sequences where all the
packets on that sequence were dropped due to lack of a valid incremental
state (i.e. interned data). This is usually a strong sign that either:
1) incremental state invalidation is disabled. 2) the incremental state
invalidation interval is too low. In either case, see
https://perfetto.dev/docs/concepts/buffers#incremental-state-in-trace-packets
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |