Adding string annotations to your code
String annotations work in a similar way to
printf() statements but instead of console output, they populate the Log view and place framing overlays directly in the Timeline view.
To add string annotations to your code, follow these steps:
Include streamline_annotate.h and streamline_annotate.c in your project.
If you are working in Java, StreamlineAnnotate.java provides the same functionality as the macros in streamline_annotate.h for string, visual, and marker annotations, and for groups and channels.
ANNOTATE_SETUPmacro to your code. You must call this before any other annotate macros.
Add annotations to your code using the macros defined in
streamline_annotate.h. For example,
write a null-terminated string from any thread and set its color using the
ANNOTATE_COLOR(color, string)macro. Either choose a color constant from those defined in streamline_annotate.h or send the ASCII escape code followed by a 3-byte RGB value.
ANNOTATE_END()to clear the annotation message for the thread.
- Run your application and exercise the area of the code that emits the annotations.
String annotations are displayed as text overlays inside the relevant channels in the details panel of the Timeline view, for example inside Channel 0 in the following screenshot. The letter A is displayed in the process list to indicate the presence of annotations. String annotations are also displayed in the Message column in the Log view.
Figure 8-2 String annotation overlays