Remove unused code of _USE_LOG_FILE_
[platform/core/multimedia/libmedia-service.git] / src / common / media-svc-debug.c
1 /*
2  * libmedia-service
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Hyunjun Ko <zzoon.ko@samsung.com>, Haejeong Kim <backto.kim@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #include <unistd.h>
23 #include <asm/unistd.h>
24 #include <time.h>
25 #include <sys/time.h>
26 #include "media-svc-debug.h"
27
28 #ifdef _PERFORMANCE_CHECK_
29 static long g_time_usec = 0L;
30 #endif
31
32 long mediainfo_get_debug_time(void)
33 {
34 #ifdef _PERFORMANCE_CHECK_
35         struct timeval time;
36         gettimeofday(&time, NULL);
37         return time.tv_sec * 1000000 + time.tv_usec;
38 #else
39         return 0L;
40 #endif
41 }
42
43 void mediainfo_reset_debug_time(void)
44 {
45 #ifdef _PERFORMANCE_CHECK_
46         struct timeval time;
47         gettimeofday(&time, NULL);
48         g_time_usec = time.tv_sec * 1000000 + time.tv_usec;
49 #endif
50 }
51
52 void mediainfo_print_debug_time(char *time_string)
53 {
54 #ifdef _PERFORMANCE_CHECK_
55         struct timeval time;
56         double totaltime = 0.0;
57
58         gettimeofday(&time, NULL);
59         totaltime = (double)(time.tv_sec * 1000000 + time.tv_usec - g_time_usec) / CLOCKS_PER_SEC;
60
61         media_svc_debug("time [%s] : %f", time_string, totaltime);
62 #endif
63 }
64
65 void
66 mediainfo_print_debug_time_ex(long start, long end, const char *func_name, char *time_string)
67 {
68 #ifdef _PERFORMANCE_CHECK_
69         double totaltime = 0.0;
70
71         totaltime = (double)(end - start) / CLOCKS_PER_SEC;
72
73         media_svc_debug("time [%s: %s] : %f", func_name, time_string, totaltime);
74 #endif
75 }