Setting Trace Filters Tutorial

Explains how to use the kernel trace tool API to filter trace data.

Purpose

Trace data is written to kernel side chunks. The kernel trace tool API can specify which trace data should be made available for further processing by setting filters.

Intended audience

This document is intended for third party developers writing a trace tool using the kernel trace tool component.

Required background

The trace filters defined in EUser. The kernel trace tool component in general.

Introduction

Setting trace filters is a short task which is performed in combination with related tasks as explained in Kernel Trace Tool Tutorial.

Using Kernel Trace tool to set trace filters

The following tasks will be covered in this tutorial:

  • Setting trace filters.

Basic procedure

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

  1. Set a primary filter specifying a category of data and whether it is to be output or not.

  2. Set a secondary filter if necessary.

Using the API

These are the function calls required to

  1. Call the SetFilter() function of the RBTrace object. This function takes two arguments:

    • An integer representing the trace category taken from the enumeration BTrace::TCategories, and

    • A boolean, True if the trace category is to be output and False if it is not.

  2. If you need a secondary trace filter, call the SetFilter2() function of the RBTrace object.