Command Line Kernel Trace Tool Tutorial

This document explains how to use the BTrace.exe

Purpose

This document explains how to use the command line kernel trace tool to extract trace data from a device.

Intended Audience

Developers who need to debug a device using the command line kernel trace tool.

Required Background

An understanding of the trace macros in EUser.

Introduction

The command line kernel trace tool is a command line tool which displays trace data produced by the BTrace framework.

Setup and Configuration Requirements

The command line kernel trace tool is included in all Base Text-Shell ROMs but must be manually added to other kinds of ROM.

Using Command Line Kernel Trace Tool

The following tasks will be covered in this tutorial:

  • Using the command line kernel trace tool to extract trace data.

Basic Procedure

The high level steps to setting a trace are shown here:

  1. Determine the name of the executable to be traced.

  2. Determine the category to be filtered.

  3. Select a capture mode.

  4. Choose a file to write to.

  5. Enter the appropriate commands into the command line.

Command syntax

The syntax for the commands is this:

BTRACE [-fLIST] [-mN] [-bN] [-d] [filename]

where

  • LIST stands for a list of comma separated category numbers,

  • -mN stands for -m followed by an integer as defined in RBTrace::TMode,

    • 0 trace disabled and new traces are discarded on overflow,

    • 1 trace enabled and new traces are discarded on overflow,

    • 2 trace disabled and old traces are discarded on overflow,

    • 3 trace enabled and old traces are discarded on overflow,

  • -bN stands for the size in bytes of the capture buffer,

  • -d causes the contents of the trace buffer to be dumped to the debug port, and

  • filename is the file to which the trace data is to be written.

Here is an example command:

BTRACE -f1,2,3 -m3 -b1024
MyTestProgram.exe
BTRACE d:\MyLog.txt