line(str filename, str funcname, int lineno) This marker indicates a Python line is about to be executed. It is the equivalent of line-by-line tracing with a Python profiler. It is not triggered within C functions. gc__start(int generation) Fires when the Python interpreter starts a garbage collection cycle. arg0 is the generation to scan, like gc. collect() . gc__done(long collected) Fires when the Python interpreter finishes a garbage collection cycle.$_{arg0}$ is the number of collected objects. import__find__load__start(str modulename) Fires before importlib attempts to find and load the module. arg0 is the module name. import__find__load__done(str modulename, int found) Fires after $_{importlib}$’s find_and_load function is called. $_{arg0}$is the module name, $_{arg1}$indicates if module was successfully loaded. audit(str event, void *tuple) Fires when$_{sys.audit()}$ or$_{PySys_Audit()}$ is called. arg0 is the event name as C string,$_{arg1}$is a $_{PyObject}$pointer to a tuple object. 5 SystemTap Tapsets The arguments are the same as for function__entry() . New in version 3.7. New in version 3.7. New in version 3.8. The higher-level way to use the SystemTap integration is to use a “tapset”: SystemTap’s equivalent of a library, which hides some of the lower-level details of the static markers. Here is a tapset file, based on a non-shared build of CPython: If this file is installed in SystemTap’s tapset directory (e.g. /usr/share/systemtap/tapset ), then these additional probepoints become available: python.function.entry(str filename, str funcname, int lineno, frameptr) This probe point indicates that execution of a Python function has begun. It is only triggered for pure-Python (bytecode) functions. 6 /* Provide a higher-level wrapping around the function__entry and function__return markers: \*/ probe python.function.entry = process("python").mark("function__entry") { filename = user_string($arg1); funcname = user_string($arg2); lineno = $arg3; frameptr = $arg4 } probe python.function.return = process("python").mark("function__return") { filename = user_string($arg1); funcname = user_string($arg2); lineno = $arg3; frameptr = $arg4 }