"Fossies" - the Fresh Open Source Software Archive 
Member "dbg-2.15.5/dbg_prof.h" (21 Apr 2007, 1922 Bytes) of package /linux/www/old/dbg-2.15.5.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "dbg_prof.h" see the
Fossies "Dox" file reference documentation.
1 /***************************************************************************
2 dbg_prof.h - description
3 --------------------
4 begin : Sun Sep 24 2000
5 copyright : (C) 2001 by Dmitri Dmitrienko
6 : (C) 2002, 2007 NuSphere Corp.
7 www : http://dd.cron.ru
8 : http://www.nusphere.com/
9 author : written by Dmitri Dmitrienko
10 license : This source file is subject to version 3.0 of
11 the License, that is bundled with this package
12 in the file LICENSE, and is available at through
13 the world-wide-web at http://www.nusphere.com/dbg
14 ***************************************************************************/
15
16 #ifndef _DBG_PROF_H_
17 #define _DBG_PROF_H_
18
19 #include "php.h"
20
21 #ifdef HAVE_DBG_PROFILER
22
23 #if PROF_TRACING
24 #define PROF_TRACE(a) DBG_TRACE(a)
25 #else
26 #define PROF_TRACE(a)
27 #endif
28
29 #define PROF_ENTER \
30 dbgint64 snapped_time = dbgTimeTicks(); \
31 PROF_TRACE(("snapped=%I64d\n",snapped_time));
32
33 #define PROF_LEAVE \
34 DBG(l_time) += dbgTimeTicks() - snapped_time; \
35 PROF_TRACE(("lost=%I64d\n",DBG(l_time)));
36
37
38 #define PROF_STORE_TIME(func) \
39 if (DBG(e_time)!=0) { \
40 func((snapped_time - DBG(e_time)) - DBG(l_time) TSRMLS_CC1(DBG)); \
41 PROF_TRACE(("save=%I64d\n",(snapped_time - DBG(e_time)) - DBG(l_time))); \
42 } \
43 DBG(e_time) = snapped_time; \
44 DBG(l_time) = 0;
45
46 #define PROF_DOUBLE_SNAP(a) { \
47 dbgint64 t = dbgTimeTicks(); \
48 a = dbgTimeTicks() - t; \
49 } \
50
51 #define PROF_PERF_FREQ(a) a=dbgTimeFreq()
52
53 inline dbgint64 dbgTimeTicks();
54 inline dbgint64 dbgTimeFreq();
55
56 #else
57
58 #define PROF_ENTER
59 #define PROF_LEAVE
60 #define PROF_STORE_TIME(func)
61 #define PROF_DOUBLE_SNAP(a) a=0
62 #define PROF_PERF_FREQ(a) a=1
63
64 #endif
65
66 #endif