# TraceMarker Module

Trace marker module that adds trace marking capabilities to Trace Compass scripting.

With this module, a script can iterate through all the events of a trace and call the .addTraceMarker(ITmfTrace, long, long, String, String, String) method to apply highlighting markers on specific events that are visible on all views of Trace Compass.

The markers are completely configurable through the use of optional parameters, each of which has a default value if left untouched.

## Method Overview

Method | Description
--- | ---
addTraceMarker() | Adds a trace marker to the time graph view.

## Methods

### addTraceMarker

void addTraceMarker(ITmfTrace trace, long startTime, [long endTime], [String label], [String category], [String color]) throws NullPointerException, IllegalArgumentException

Adds a trace marker to the time graph view. Except the startTime, all the other parameters are optional and it's up to the user to decide which ones he wants to override. In case a parameter is left untouched, a default value will be assigned.

trace
  the trace to which the marker is added
startTime
  the starting time stamp of the marker in ns (required)
endTime
  the ending time stamp of the marker in ns (optional - default : startTime)Optional: defaults to <-1>.
label
  the marker's label to show (it's name) (optional - default : TraceMarker)Optional: defaults to <TraceMarker>.
category
  the marker's group category (can be anything and is used to group markers together in sets that can be enabled/disabled) (optional - default : General markers)Optional: defaults to <Generals markers>.
color
  the marker's highlighting color in X11 format (ex: "Red", "Green", "Cyan", "Gold", more at https://en.wikipedia.org/wiki/X11_color_names) (optional - default : Red)Optional: defaults to <Red>.

NullPointerException
  Exception thrown if the trace is null. Script developers can choose to catch this exception or let the script fail. This is present mostly for testing purposes.
IllegalArgumentException
  Exception thrown if the parameters for the start time or end time are incorrect. Script developers can choose to catch this exception or let the script fail.