You copied the Doc URL to your clipboard.

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.

Note

If you use the -pthread option 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:

Procedure

  1. Ensure gatord is running. gatord creates the /dev/gator/annotate file.
  2. 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.
  3. Add the ANNOTATE_SETUP macro to your code. It must be called before any other annotate macros are called.
  4. Add one ANNOTATE_DEFINE macro to your code.
  5. Write null-terminated strings to the file from any thread using the ANNOTATE macro: ANNOTATE(string)
  6. Optionally set the color of the annotation using the ANNOTATE_COLOR macro 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)
  7. Optional: Write an empty string to clear the annotation message for the thread.

Related concepts

Related reference

Was this page helpful? Yes No