Fix build break in Profiling build type.
[platform/framework/web/wrt.git] / src / profiling / profiling_util.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16 /*
17  * @file
18  * @author      Lukasz Wrzosek (l.wrzosek@samsung.com)
19  * @version     1.0
20  * @brief       This is header file for profiling function.
21  */
22
23 #ifndef WRT_ENGINE_SRC_PROFILING_PROFILING_UTIL_H
24 #define WRT_ENGINE_SRC_PROFILING_PROFILING_UTIL_H
25
26 #ifdef PROFILING_ENABLED
27
28 #ifndef __cplusplus
29 #include <stdbool.h>
30 #endif //__cplusplus
31
32 #ifdef __cplusplus
33 extern "C"
34 void AddProfilingMeasurment(const char* name,
35                             const char* prefix = 0,
36                             const char* description = 0);
37 #define ADD_PROFILING_POINT(name, ...) AddProfilingMeasurment(name, \
38                                                               ##__VA_ARGS__)
39 #else //__cplusplus
40 void AddProfilingMeasurment(const char* name,
41                             const char* prefix,
42                             const char* description);
43 #define ADD_PROFILING_POINT(name, prefix, desc) AddProfilingMeasurment(name, \
44                                                                        prefix, \
45                                                                        desc)
46 #endif //__cplusplus
47
48 void AddStdoutProfilingMeasurment(const char* name, bool start);
49 // profiling script additional proceeds stdout output
50 #define LOG_PROFILE_START(x) AddStdoutProfilingMeasurment(x, true)
51 #define LOG_PROFILE_STOP(x) AddStdoutProfilingMeasurment(x, false)
52 #else //PROFILING_ENABLED
53
54 #define ADD_PROFILING_POINT(name, ...) (void)1
55 #define LOG_PROFILE_START(x) (void)1
56 #define LOG_PROFILE_STOP(x) (void)1
57
58 #endif //PROFILING_ENABLED
59
60 #endif /* WRT_ENGINE_SRC_PROFILING_PROFILING_UTIL_H */
61