The Language

whamm! enables tool implementers to express their instrumentation in terms of program events and corresponding predicated actions; "When this event occurs during program execution, do these actions if this predicate (or conditional) evaluates to true." This abstraction provides a high-level and intuitive syntax that can target events at various granularities in the instrumented program.

Read on for an overview of the syntax and semantics of the language.

Language Concepts

  • Variables are used to store data.
  • Logical operations can be used to combine boolean expressions.
  • Ternary Expressions can be used for succinct conditional variable assignments.
  • Primitive types are numbers, booleans, and strings.
  • Various arithmetic operations can be used with numbers.
  • Strings are key for dealing with text, etc.
  • Tuples allow using multiple values where one value is expected.
  • Maps are key for storing large amounts of data, but they're implemented quite differently in whamm!.
  • Function definitions can be used to reuse code snippets.
  • Conditionals are if/else/elif statements used for simple control flow
  • Whamm! also provides helpful features to enable instrumentation expressiveness
    • Report variables are key for flushing the dynamic data collected by instrumentation during an application's run
    • Unshared variables are used to create an instance of a variable per probe match-site whose value is retained across site visits
    • Shared variables are used to create an instance of a variable that is shared by every probe match-site
  • And finally, probes are used to express instrumentation.
  • All of this syntax is used to write whamm! scripts.