You can insert annotation macros in either user space code or kernel space code. There are a few important considerations when using them in kernel space code or in a module.
NoteAs the annotation macros might block, ARM recomments that you do not add them to kernel space code in an interrupt context. For more information, see gator_annotate.c in the gator driver source archive, gator-driver.tar.gz.
For string, visual, and marker annotations, and channels and groups, the
same macros are defined for both user space and kernel space using the
_KERNEL_ preprocessor conditional. Insert these macros in
kernel space code or in a module in the same way you would in user space code, with the
- Do not call
ANNOTATE_SETUPin kernel space code. This macro is a prerequisite for other annotation macros in user space code, but not in kernel space code.
- You do not need to include streamline_annotate.c in the project.
You can only use the custom counter macros and custom activity map macros in user space code. See the gator_events_mmapped.c example in gator-driver.tar.gz for an example of adding custom counters to kernel space code.