next up previous contents
Next: Exercises Up: Tapsets Previous: Embedded C   Contents

Naming conventions

Using the tapset search mechanism just described, potentially many script files can become selected for inclusion in a single session. This raises the problem of name collisions, where different tapsets accidentally use the same names for functions/globals. This can result in errors at translate or run time.

To control this problem, systemtap tapset developers are advised to follow naming conventions. Here is some of the guidance.

  1. Pick a unique name for your tapset, and substitute it for TAPSET below.
  2. Separate identifiers meant to be used by tapset users from those that are internal implementation artifacts.
  3. Document the first set in the appropriate man pages.
  4. Prefix the names of external identifiers with TAPSET_ if there is any likelihood of collision with other tapsets or end-user scripts.
  5. Prefix any probe point aliases with an appropriate prefix.
  6. Prefix the names of internal identifiers with __TAPSET_.