Adding Streamline Annotate to your code
Streamline provides a set of macros that enable you to send customized output to your generated Analysis Reports. This feature, called Annotate, is much more versatile than
printf() statements, and you can use it to add overlays or automatic bookmarks to the Timeline view.
NoteIn version 5.20 and later, applications that use user space gator, in addition to those that use kernel space gator, can emit annotations. Applications built using the annotation implementation in earlier versions of DS-5 will continue to work in version 5.20 and later, but only with kernel space gator. If they use user space gator, you must re-build them using the new annotation implementation, following the steps described in this topic.
To start using the Annotate feature, follow these steps:
- Include the streamline_annotate.h header file 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.
ANNOTATE_SETUPmacro to your code. It must be called before any other annotate macros.
ANNOTATE_DEFINEmacro to your code.
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_ENDto clear the annotation message for the thread.
Compile and link your code using the