4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>
7 * Contact: Seokkyu Jang <seokkyu.jang@samsung.com>
8 * Contact: Sangil Yoon <si83.yoon@samsung.com>
10 * This library is free software; you can redistribute it and/or modify it under
11 * the terms of the GNU Lesser General Public License as published by the
12 * Free Software Foundation; either version 2.1 of the License, or (at your option)
15 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
16 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this library; if not, write to the Free Software Foundation, Inc., 51
22 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
32 static struct timeval __g_base_time = {
37 #define INIT_PERF(kb)\
40 gettimeofday(&tv, NULL);\
41 __g_base_time.tv_sec = tv.tv_sec;\
42 __g_base_time.tv_usec = tv.tv_usec;\
45 #define PERF(fmt,arg...)\
49 gettimeofday(&cur,NULL);\
50 if(__g_base_time.tv_sec != 0){\
51 timersub(&cur, &__g_base_time, &res);\
52 printf("%c[1;31m[%s,%d] %u sec %u msec "fmt" %c[0m\n",\
53 27,__FUNCTION__,__LINE__,\
54 res.tv_sec,res.tv_usec/1000,##arg,27);\
61 #define PERF(fmt,arg...)