Lua comes with debugger interface, so that users can write their own monitoring code (e.g., for a debugger, tracer, or profiler) through the Lua Debug library [1]. Some examples are below.