beta-0.89.2
[luatex.git] / source / texk / web2c / luatexdir / luaprofiler / core_profiler.h
blobcae18792f19b2277d874a5533435f6d489152c04
1 /*
2 ** LuaProfiler
3 ** Copyright Kepler Project 2005-2007 (http://www.keplerproject.org/luaprofiler)
4 ** $Id: core_profiler.h,v 1.6 2007/08/22 19:23:53 carregal Exp $
5 */
7 /*****************************************************************************
8 core_profiler.h:
9 Lua version independent profiler interface.
10 Responsible for handling the "enter function" and "leave function" events
11 and for writing the log file.
13 Design (using the Lua callhook mechanism) :
14 'lprofP_init_core_profiler' set up the profile service
15 'lprofP_callhookIN' called whenever Lua enters a function
16 'lprofP_callhookOUT' called whenever Lua leaves a function
17 *****************************************************************************/
19 #include "stack.h"
21 /* computes new stack and new timer */
22 void lprofP_callhookIN(lprofP_STATE* S, char *func_name, char *file, int linedefined, int currentline);
24 /* pauses all timers to write a log line and computes the new stack */
25 /* returns if there is another function in the stack */
26 int lprofP_callhookOUT(lprofP_STATE* S);
28 /* opens the log file */
29 /* returns true if the file could be opened */
30 lprofP_STATE* lprofP_init_core_profiler(const char *_out_filename, int isto_printheader, float _function_call_time);
32 void lprofP_close_core_profiler(lprofP_STATE* S);