什么原因导致大量锁定的 .etl 文件堆积?

什么原因导致大量锁定的 .etl 文件堆积?

C:\Users\Me\AppData\Local\Temp文件夹不断被填满

Report.{some guid}.number

打开文件夹后会显示一个文件

{some guid}.number.m.etl

这些文件在我使用电脑工作(主要是 Visual Studio 开发)时不断积累,直到我的 C: 盘空间用完。大多数文件都被锁定了,所以我无法删除它们,除非重新启动。几个小时的工作就让我损失了 15GB 的磁盘空间。

这是最近发生的事情(可能是上个月或两个月),在此期间我安装的软件并没有发生值得注意的变化。

是什么以如此疯狂的速度创建这些文件?我该如何阻止这种情况发生?

这是 tracerpt 针对其中一个小问题提供的 report.txt

Files Processed:
    18A9D359-FA3E-4411-A1F5-5BEC2ED7ED51.91.m.etl
Total Buffers Processed 509
Total Events  Processed 106391
Total Events  Lost      0
Start Time              Thursday, November 9, 2017
End Time                Thursday, November 9, 2017
Elapsed Time            2 sec
+-------------------------------------------------------------------------------------------------------------------------+
|Event Count   Event Name           Task            Opcode          Version         Guid                                  |
+-------------------------------------------------------------------------------------------------------------------------+
|          3   EventTrace           0               RDComplete      2               {68fdd900-4a3e-11d1-84f4-0000f80464e3}|
|          3   EventTrace           0               Extension       2               {68fdd900-4a3e-11d1-84f4-0000f80464e3}|
|          3   EventTrace           0               EndExtension    2               {68fdd900-4a3e-11d1-84f4-0000f80464e3}|
|          1   EventTrace           0               Header          2               {68fdd900-4a3e-11d1-84f4-0000f80464e3}|
|          1                        0               37              0               {9b79ee91-b5fd-41c0-a243-4248e266e9d0}|
|          1                        0               32              0               {9b79ee91-b5fd-41c0-a243-4248e266e9d0}|
|         14                        0               35              0               {9b79ee91-b5fd-41c0-a243-4248e266e9d0}|
|          2                        0               34              0               {9b79ee91-b5fd-41c0-a243-4248e266e9d0}|
|          1                        0               33              0               {9b79ee91-b5fd-41c0-a243-4248e266e9d0}|
|        336   Process              0               DCStart         4               {3d6fa8d0-fe05-11d0-9dda-00c04fd7ba7c}|
|          1   Thread               0               End             3               {3d6fa8d1-fe05-11d0-9dda-00c04fd7ba7c}|
|         58   Thread               0               Start           3               {3d6fa8d1-fe05-11d0-9dda-00c04fd7ba7c}|
|       4331   Thread               0               DCStart         3               {3d6fa8d1-fe05-11d0-9dda-00c04fd7ba7c}|
|          1                        0               33              2               {b3e675d7-2554-4f18-830b-2762732560de}|
|         44                        0               37              2               {b3e675d7-2554-4f18-830b-2762732560de}|
|        323                        0               36              2               {b3e675d7-2554-4f18-830b-2762732560de}|
|        345                        0               0               2               {b3e675d7-2554-4f18-830b-2762732560de}|
|        342                        0               64              0               {b3e675d7-2554-4f18-830b-2762732560de}|
|          1   Image                0               KernelBase      2               {2cb15d1d-5fc1-11d2-abe1-00a0c911f518}|
|        351   Image                0               DCStart         3               {2cb15d1d-5fc1-11d2-abe1-00a0c911f518}|
|       6576   PerfInfo             0               SampleProf      2               {ce1dbfb4-137e-4da6-87b0-3f59aa102cbc}|
|          7                        0               33              0               {bbccf6c1-6cd1-48c4-80ff-839482e37671}|
|          9                        0               32              0               {bbccf6c1-6cd1-48c4-80ff-839482e37671}|
|          3   Microsoft-Windows-DotNETRuntimeRundown 1               DCStartComplete  1               {a669021c-c450-4609-a035-5af59af4df18}|
|      45189   Microsoft-Windows-DotNETRuntimeRundown 1               MethodDCStartILToNativeMap  0               {a669021c-c450-4609-a035-5af59af4df18}|
|      46641   Microsoft-Windows-DotNETRuntimeRundown 1               DCStartVerbose  1               {a669021c-c450-4609-a035-5af59af4df18}|
|        135   Microsoft-Windows-DotNETRuntimeRundown 2               ModuleDCStart   2               {a669021c-c450-4609-a035-5af59af4df18}|
|        132   Microsoft-Windows-DotNETRuntimeRundown 2               DomainModuleDCStart  1               {a669021c-c450-4609-a035-5af59af4df18}|
|        132   Microsoft-Windows-DotNETRuntimeRundown 2               AssemblyDCStart  1               {a669021c-c450-4609-a035-5af59af4df18}|
|          6   Microsoft-Windows-DotNETRuntimeRundown 2               AppDomainDCStart  1               {a669021c-c450-4609-a035-5af59af4df18}|
|          3   Microsoft-Windows-DotNETRuntimeRundown 1               DCStartInit     1               {a669021c-c450-4609-a035-5af59af4df18}|
|          3   Microsoft-Windows-DotNETRuntimeRundown 19              Start           0               {a669021c-c450-4609-a035-5af59af4df18}|
|        831   StackWalk            0               Stack           2               {def2fe46-7bd6-4b80-bd94-f57fe20d0ce3}|
|          1                        0               0               0               {9e5f9046-43c6-4f62-ba13-7b19896253ff}|
|         16                        0               0               1               {9e5f9046-43c6-4f62-ba13-7b19896253ff}|
|          1   SystemConfig         0               TelemetryConfiguration 2               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|          1   SystemConfig         0               CodeIntegrity   2               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|          1   SystemConfig         0               FlightIds       2               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|          1   SystemConfig         0               DeviceFamily    2               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|          1   SystemConfig         0               Platform        2               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|          1   SystemConfig         0               Power           2               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|          1   SystemConfig         0               CPU             3               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|        314   SystemConfig         0               Services        3               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|         18   SystemConfig         0               IRQ             3               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|        174   SystemConfig         0               PnP             5               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|          1   SystemConfig         0               OpticalDisk     2               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|          5   SystemConfig         0               Defragmentation 2               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|          3   SystemConfig         0               LogDisk         2               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|          7   SystemConfig         0               PhyDisk         2               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|          5   SystemConfig         0               NIC             2               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|          1   SystemConfig         0               DPI             2               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|          7   SystemConfig         0               Video           2               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|          1                        0               37              0               {ed54dff8-c409-4cf6-bf83-05e1e61a09c4}|
|          1                        0               35              0               {ed54dff8-c409-4cf6-bf83-05e1e61a09c4}|
|          1                        0               33              0               {ed54dff8-c409-4cf6-bf83-05e1e61a09c4}|
+-------------------------------------------------------------------------------------------------------------------------+
+---------------------------------------------------------------------------------------------------------+
|Event Count   Event Name           Event ID        Version         Guid                                  |
+---------------------------------------------------------------------------------------------------------+
|         10   EventTrace           0               2               {68fdd900-4a3e-11d1-84f4-0000f80464e3}|
|         19                        0               0               {9b79ee91-b5fd-41c0-a243-4248e266e9d0}|
|        336   Process              0               4               {3d6fa8d0-fe05-11d0-9dda-00c04fd7ba7c}|
|       4390   Thread               0               3               {3d6fa8d1-fe05-11d0-9dda-00c04fd7ba7c}|
|        342                        0               0               {b3e675d7-2554-4f18-830b-2762732560de}|
|        713                        0               2               {b3e675d7-2554-4f18-830b-2762732560de}|
|          1   Image                0               2               {2cb15d1d-5fc1-11d2-abe1-00a0c911f518}|
|        351   Image                0               3               {2cb15d1d-5fc1-11d2-abe1-00a0c911f518}|
|       6576   PerfInfo             0               2               {ce1dbfb4-137e-4da6-87b0-3f59aa102cbc}|
|         16                        0               0               {bbccf6c1-6cd1-48c4-80ff-839482e37671}|
|      46641   Microsoft-Windows-DotNETRuntimeRundown 143             1               {a669021c-c450-4609-a035-5af59af4df18}|
|          3   Microsoft-Windows-DotNETRuntimeRundown 145             1               {a669021c-c450-4609-a035-5af59af4df18}|
|          3   Microsoft-Windows-DotNETRuntimeRundown 147             1               {a669021c-c450-4609-a035-5af59af4df18}|
|      45189   Microsoft-Windows-DotNETRuntimeRundown 149             0               {a669021c-c450-4609-a035-5af59af4df18}|
|        132   Microsoft-Windows-DotNETRuntimeRundown 151             1               {a669021c-c450-4609-a035-5af59af4df18}|
|        135   Microsoft-Windows-DotNETRuntimeRundown 153             2               {a669021c-c450-4609-a035-5af59af4df18}|
|        132   Microsoft-Windows-DotNETRuntimeRundown 155             1               {a669021c-c450-4609-a035-5af59af4df18}|
|          6   Microsoft-Windows-DotNETRuntimeRundown 157             1               {a669021c-c450-4609-a035-5af59af4df18}|
|          3   Microsoft-Windows-DotNETRuntimeRundown 187             0               {a669021c-c450-4609-a035-5af59af4df18}|
|        831   StackWalk            0               2               {def2fe46-7bd6-4b80-bd94-f57fe20d0ce3}|
|          1                        5               0               {9e5f9046-43c6-4f62-ba13-7b19896253ff}|
|          6                        7               1               {9e5f9046-43c6-4f62-ba13-7b19896253ff}|
|          6                        8               1               {9e5f9046-43c6-4f62-ba13-7b19896253ff}|
|          2                        9               1               {9e5f9046-43c6-4f62-ba13-7b19896253ff}|
|          2                        10              1               {9e5f9046-43c6-4f62-ba13-7b19896253ff}|
|         35   SystemConfig         0               2               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|        333   SystemConfig         0               3               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|        174   SystemConfig         0               5               {01853a65-418f-4f36-aefc-dc0f1d2fd235}|
|          3                        0               0               {ed54dff8-c409-4cf6-bf83-05e1e61a09c4}|
+---------------------------------------------------------------------------------------------------------+

答案1

造成这一现象的线索是:

|      45189   Microsoft-Windows-DotNETRuntimeRundown 1               MethodDCStartILToNativeMap  0               {a669021c-c450-4609-a035-5af59af4df18}|
|      46641   Microsoft-Windows-DotNETRuntimeRundown 1               DCStartVerbose  1               {a669021c-c450-4609-a035-5af59af4df18}|

这里我们发现每个事件发生了 45,000 多次。

我不熟悉这种特定类型的日志记录,但这似乎是来自 .Net 框架中的公共语言运行时提供程序的事件。所以你说得对,这很可能发生在你使用 Visual Studio 时。我相信这可能是“应用程序域资源监控”的一部分。我们可以看到提供程序和 GUID。在本例中,我们可以使用 GUID 来具体查看“Microsoft-Windows-DotNETRuntimeRundown” {a669021c-c450-4609-a035-5af59af4df18}

https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/app-domain-resource-monitoring

https://docs.microsoft.com/en-us/dotnet/framework/performance/clr-etw-providers

看来您已经在代码中或其他地方启用了第 5 级日志记录,并且正在生成大量事件。

我们需要降低此提供商的日志记录级别。默认值为 0。

https://docs.microsoft.com/en-us/dotnet/framework/performance/controlling-logging

从管理命令提示符下,我们可以使用:

logman stop clrevents -ets

这应该会停止日志记录,但我不确定这是否是持久的或是唯一可以执行此操作的地方。您必须查看我提供的一些链接,以找出启用此功能的位置以及如何降低详细程度。

该命令logman query providers "{a669021c-c450-4609-a035-5af59af4df18}"将列出提供程序可以登录的关键字。每个关键字的跟踪级别都可以调整。

相关内容