2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
6 | Copyright (c) 1997-2010 The PHP Group |
7 +----------------------------------------------------------------------+
8 | This source file is subject to version 3.01 of the PHP license, |
9 | that is bundled with this package in the file LICENSE, and is |
10 | available through the world-wide-web at the following url: |
11 | http://www.php.net/license/3_01.txt |
12 | If you did not receive a copy of the PHP license and are unable to |
13 | obtain it through the world-wide-web, please send a note to |
14 | license@php.net so we can mail you a copy immediately. |
15 +----------------------------------------------------------------------+
18 #ifndef incl_HPHP_SYSTEM_PROFILER_H_
19 #define incl_HPHP_SYSTEM_PROFILER_H_
23 #include "hphp/runtime/base/exceptions.h"
24 #include "hphp/runtime/ext/hotprofiler/ext_hotprofiler.h"
28 ///////////////////////////////////////////////////////////////////////////////
32 * Events interesting to a system profiler.
34 * A system profiler should instantiate one instance of this class,
35 * and bind the global g_system_profiler to point to that instance.
36 * That binding can be done in a dynamic shared object.
39 struct SystemProfiler
{
41 virtual ~SystemProfiler() { }
44 * Called when a PHP execution error is handled.
46 virtual void errorCallBack(const ExtendedException
&ee
,
48 const std::string
&msg
) = 0;
50 * Called when PHP loads a file.
52 virtual void fileLoadCallBack(const std::string
&name
) = 0;
55 * Called once to get the hotprofiler. The profiler should have
56 * been allocated with req::make_raw<T>; ProfilerFactory will
57 * destroy it with req::destroy_raw().
59 virtual Profiler
*getHotProfiler() = 0;
62 extern SystemProfiler
*g_system_profiler
;
66 #endif // incl_HPHP_SYSTEM_PROFILER_H_