Skip to content

Profiling DAPHNE using PAPI

You can profile your DAPHNE script by using the --enable-profiling CLI switch. Note that profiling is only available if DAPHNE was built without the --no-papi flag.

DAPHNE supports profiling via the PAPI profiling library, specifically the high-level (HL) PAPI API.

When run with profiling enabled, the DAPHNE compiler will generate code that automatically starts and stops profiling (via PAPI) at the start and end of the DAPHNE script.

You can configure which events to profile via the PAPI_EVENTS environmental variable, e.g.:

$ PAPI_EVENTS="perf::CYCLES,perf::INSTRUCTIONS,perf::CACHE-REFERENCES,perf::CACHE MISSES,perf::BRANCHES,perf::BRANCH-MI SSES" PAPI_REPORT=1 ./daphne --enable-profiling script.daph

For more details about the supported events as well as other PAPI-HL configuration options you can check the PAPI HL API documentation. You can also get a list of the supported events on your machine via the papi_native_avail PAPI utility (included in the papi-tools package on Debian-based systems).