-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathcore_profiler.h
More file actions
executable file
·32 lines (25 loc) · 1.29 KB
/
core_profiler.h
File metadata and controls
executable file
·32 lines (25 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
** LuaProfiler
** Copyright Kepler Project 2005-2007 (http://www.keplerproject.org/luaprofiler)
** $Id: core_profiler.h,v 1.6 2007-08-22 19:23:53 carregal Exp $
*/
/*****************************************************************************
core_profiler.h:
Lua version independent profiler interface.
Responsible for handling the "enter function" and "leave function" events
and for writing the log file.
Design (using the Lua callhook mechanism) :
'lprofP_init_core_profiler' set up the profile service
'lprofP_callhookIN' called whenever Lua enters a function
'lprofP_callhookOUT' called whenever Lua leaves a function
*****************************************************************************/
#include "stack.h"
/* computes new stack and new timer */
void lprofP_callhookIN(lprofP_STATE* S, char *func_name, char *file, int linedefined, int currentline);
/* pauses all timers to write a log line and computes the new stack */
/* returns if there is another function in the stack */
int lprofP_callhookOUT(lprofP_STATE* S);
/* opens the log file */
/* returns true if the file could be opened */
lprofP_STATE* lprofP_init_core_profiler(const char *_out_filename, int isto_printheader, float _function_call_time);
void lprofP_close_core_profiler(lprofP_STATE* S);