TracelogTracelog

Tracelog (Tracelog)是在命令提示符窗口中运行的事件跟踪控制器。Tracelog (Tracelog.exe) is an event tracing controller that runs in a Command Prompt window. 本部分介绍 Tracelog、说明其命令语法,并提供其使用情况的实际示例。This section describes Tracelog, explains its command syntax, and provides practical examples for its use.

在哪里可以获得 Tracelog?Where can I get Tracelog?

安装 WDK、Visual Studio 和适用于桌面应用的 Windows SDK 时,将包含 Tracelog (Tracelog)。Tracelog (Tracelog.exe) is included when you install the WDK, Visual Studio, and the Windows SDK for desktop apps. 有关下载套件的信息,请参阅Windows 硬件下载For information about downloading the kits, see Windows Hardware Downloads.

Windows 驱动程序工具包(WDK) 8 (安装路径)Windows Driver Kit (WDK) 8 (installation path)

%WindowsSdkDir%\tools\x64\tracelog.exe%WindowsSdkDir%\tools\x64\tracelog.exe

%WindowsSdkDir%\tools\x86\tracelog.exe%WindowsSdkDir%\tools\x86\tracelog.exe

Windows 驱动程序工具包(WDK) 8.1 (安装路径)Windows Driver Kit (WDK) 8.1 (installation path)

%WindowsSdkDir%\bin\x64\tracelog.exe%WindowsSdkDir%\bin\x64\tracelog.exe

%WindowsSdkDir%\bin\x86\tracelog.exe%WindowsSdkDir%\bin\x86\tracelog.exe

注意   Visual Studio 环境变量% WindowsSdkDir% 表示安装包的 Windows 工具包目录的路径,例如,C:\Program Files (x86) \Windows Kits\8.1。 Note  The Visual Studio environment variable, %WindowsSdkDir%, represents the path to the Windows kits directory where the kits are installed, for example, C:\Program Files (x86)\Windows Kits\8.1.

可以通过 Tracelog 执行的操作What you can do with Tracelog

可以在命令提示符窗口中使用 Tracelog 作为事件跟踪控制器。You can use Tracelog in a Command Prompt window as an event tracing controller.

注意   若要控制跟踪会话,您必须是计算机上 "Performance Log Users" 组或 "Administrators" 组的成员(以管理员身份运行)。Note  To control a trace session you must be a member of the Performance Log Users group or the Administrators group on the computer (Run as administrator).

Tracelog 功能包括:Tracelog features include:

Tracelog 生成一个事件跟踪日志(.etl)文件,其中包含跟踪会话期间提供程序生成的跟踪消息。Tracelog produces an event trace log (.etl) file that contains the trace messages generated by the provider during the trace session. 消息以二进制格式存储在文件中。The messages are stored in binary format in the file. 若要以可读格式显示跟踪消息,请使用TraceViewTracefmtTo display the trace messages in a readable format, use TraceView or Tracefmt.

Tracelog 控制内核模式和专用(用户模式)跟踪会话,以及特殊会话(如NT 内核记录器跟踪会话全局记录器跟踪会话)。Tracelog controls kernel-mode and private (user-mode) trace sessions, and special sessions such as the NT Kernel Logger trace session and the Global Logger trace session.

Tracelog 在 windows 7 和更高版本的 Windows 上运行。Tracelog runs on Windows 7 and later versions of Windows.

TraceView中还提供了 Tracelog 的许多功能,包括在 Windows 驱动程序工具包(WDK)中的一种工具,该工具具有一个图形用户界面以及一个命令行界面。Many of the features of Tracelog are also available in TraceView, a tool included in the Windows Driver Kit (WDK) that has a graphical user interface in addition to a command-line interface.

本部分内容In this section