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 them add overlays or automatic bookmarks to the Timeline view.
NoteIf you use the
-pthreadoption when linking, you must also use it with gcc at compile time for Annotate to work correctly.
To start using the Annotate feature, follow these steps:
gatordcreates the /dev/gator/annotate file.
- Include the streamline_annotate.h header file by adding the following include statement to your code: #include "streamline_annotate.h" If are you 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 are called.
ANNOTATE_DEFINEmacro to your code.
Write null-terminated strings to the file from any thread using the
Optionally set the color of the annotation using the
ANNOTATE_COLORmacro and by either choosing a color constant from those defined in streamline_annotate.h or by sending the ASCII escape code followed by a 3-byte RGB value: ANNOTATE_COLOR(color, string)
- Optional: Write an empty string to clear the annotation message for the thread.