检测 ETW 何时丢弃事件

发布于 2024-12-28 14:22:44 字数 380 浏览 2 评论 0原文

如何确定 ETW 会话是否正在丢弃事件?

如果正在丢弃事件,如何配置跟踪会话以便不丢弃事件?

我已经写过自定义 ETW 提供程序可帮助进行一些调试工作。我目前正在使用 logman.exe 捕获跟踪数据。

在查看结果时,似乎某些事件正在被删除。基本上我正在寻找类似的东西:

事件A 事件 C

应该是中间事件 B,但它没有出现在跟踪文件中。这种情况应该是不可能发生的,这让我相信 ETW 正在丢弃事件。

当然,我想验证我看到的问题是由于事件丢失造成的,而不是由代码中的错误引起的。我尝试过谷歌,但无法想出任何东西。有谁知道我如何检查事件是否被删除?

How can I determine if an ETW session is dropping events?

If it is dropping events, how can I configure the tracing session so that events are not dropped?

I've written a custom ETW provider to help with some debugging efforts. I'm currently capturing the trace data using logman.exe.

In viewing the results, it appears that some of the events are being dropped. Basically I'm seeking something like:

Event A
Event C

where their should be an intervening Event B, but one does not appear in the trace file. It should be impossible for that to happen, which leads me to believe that ETW is dropping events.

Of course, I'd like to verify that the problem I'm seeing is due to dropped events, and not caused by a bug in my code. I've tried Google, but wasn't able to come up with anything. Does any one know how I can check to see if events are being dropped?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

画尸师 2025-01-04 14:22:44

它没有直接回答问题(如何检测掉落),但它可能会解释掉落:

EVENT_TRACE_NO_PER_PROCESSOR_BUFFERING

将不同处理器上记录的事件写入公共处理器
缓冲。使用此模式可以消除事件出现的问题
当事件在不同处理器上发布时乱序
使用系统时间。此模式还可以消除以下问题
循环日志似乎在多个处理器上丢弃事件
计算机。

如果您不使用此模式并且使用系统时间,则事件可能会
在多处理器计算机上出现乱序。这是因为
ETW 缓冲区与处理器而不是线程关联。作为一个
结果,如果线程从一个 CPU 切换到另一个 CPU,缓冲区
与后一个 CPU 关联的可以在前一个 CPU 之前刷新到磁盘
与以前的CPU相关联。

如果您预计会发生大量事件(例如,超过 1,000
每秒事件数),您不应该使用此模式。

请注意,事件中不包含处理器编号。不是
在 Windows 7 和 Windows Server 2008 R2 之前可用。

It doesn't answer the question directly (how to detect drops), but it might explain drops:

EVENT_TRACE_NO_PER_PROCESSOR_BUFFERING

Writes events that were logged on different processors to a common
buffer. Using this mode can eliminate the issue of events appearing
out of order when events are being published on different processors
using system time. This mode can also eliminate the issue with
circular logs appearing to drop events on multiple processor
computers.

If you do not use this mode and you use system time, the events may
appear out of order on multiple processor computers. This is because
ETW buffers are associated with a processor instead of a thread. As a
result, if a thread is switched from one CPU to another, the buffer
associated with the latter CPU can be flushed to disk before the one
associated with the former CPU.

If you expect a high volume of events (for example, more than 1,000
events per second), you should not use this mode.

Note that the processor number is not included with the event. Not
available prior to Windows 7 and Windows Server 2008 R2.

梦里°也失望 2025-01-04 14:22:44

我一直在使用 logman 来捕获结果。看起来跟踪日志将为我提供有关丢失事件的信息,并且我可以调整其缓冲区参数以减少事件丢失。

I've been using logman to capture the results. It looks like tracelog will give me info about lost events, and I can tweek its buffer parameters to reduce the event loss.

中二柚 2025-01-04 14:22:44

如果您使用 xperf 收集日志,它会在事件丢失时生成警告。使用 xperf,您还可以调整缓冲区大小,并将日志记录划分到多个记录器。

If you use xperf to collect the logs, it generates a warning when events are lost. With xperf you can also play with the buffer size and can divide the logging to several loggers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文