2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
23 static struct timeval __g_base_time = {
28 #define INIT_PERF(kb) \
32 tmp = bundle_get_val(kb, AUL_K_STARTTIME); \
34 sscanf(tmp, "%ld/%ld", &tv.tv_sec, &tv.tv_usec); } \
36 gettimeofday(&tv, NULL); } \
37 __g_base_time.tv_sec = tv.tv_sec; \
38 __g_base_time.tv_usec = tv.tv_usec; \
41 #define PERF(fmt, arg ...) \
45 gettimeofday(&cur, NULL); \
46 if (__g_base_time.tv_sec != 0) { \
47 timersub(&cur, &__g_base_time, &res); \
48 printf("%c[1;31m[%s,%d] %ld sec %ld msec "fmt " %c[0m\n", \
49 27, __FUNCTION__, __LINE__, \
50 res.tv_sec, res.tv_usec / 1000,##arg, 27); \
57 #define PERF(fmt, arg ...)