Source code formating unification
[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 #ifdef __cplusplus
29 extern "C"
30 void AddProfilingMeasurment(const char* name,
31                             const char* prefix = 0,
32                             const char* description = 0);
33 #define ADD_PROFILING_POINT(name, ...) AddProfilingMeasurment(name, \
34                                                               ##__VA_ARGS__)
35 #else //__cplusplus
36 void AddProfilingMeasurment(const char* name,
37                             const char* prefix,
38                             const char* description);
39 #define ADD_PROFILING_POINT(name, prefix, desc) AddProfilingMeasurment(name, \
40                                                                        prefix, \
41                                                                        desc)
42 #endif //__cplusplus
43
44 void AddStdoutProfilingMeasurment(const char* name, bool start);
45 // profiling script additional proceeds stdout output
46 #define LOG_PROFILE_START(x) AddStdoutProfilingMeasurment(x, true)
47 #define LOG_PROFILE_STOP(x) AddStdoutProfilingMeasurment(x, false)
48 #else //PROFILING_ENABLED
49
50 #define ADD_PROFILING_POINT(name, ...) (void)1
51 #define LOG_PROFILE_START(x) (void)1
52 #define LOG_PROFILE_STOP(x) (void)1
53
54 #endif //PROFILING_ENABLED
55
56 #endif /* WRT_ENGINE_SRC_PROFILING_PROFILING_UTIL_H */
57