4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Hyunjun Ko <zzoon.ko@samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #ifndef _MEDIA_THUMB_DEBUG_H_
23 #define _MEDIA_THUMB_DEBUG_H_
30 #include <asm/unistd.h>
37 #define LOG_TAG "MEDIA_THUMBNAIL"
39 static pid_t gettid(void)
41 return syscall(__NR_gettid);
44 #define FONT_COLOR_RESET "\033[0m"
45 #define FONT_COLOR_RED "\033[31m"
46 #define FONT_COLOR_GREEN "\033[32m"
47 #define FONT_COLOR_YELLOW "\033[33m"
48 #define FONT_COLOR_BLUE "\033[34m"
49 #define FONT_COLOR_PURPLE "\033[35m"
50 #define FONT_COLOR_CYAN "\033[36m"
51 #define FONT_COLOR_GRAY "\033[37m"
53 #define thumb_dbg(fmt, arg...) do{ \
54 LOGD(FONT_COLOR_RESET"[%d] " fmt "\n", gettid(), ##arg); \
57 #define thumb_warn(fmt, arg...) do{ \
58 LOGW(FONT_COLOR_GREEN"[%d] " fmt "\n", gettid(), ##arg); \
61 #define thumb_err(fmt, arg...) do{ \
62 LOGE(FONT_COLOR_RED"[%d] " fmt "\n", gettid(), ##arg); \
65 #define thumb_dbg_slog(fmt, arg...) do{ \
66 SECURE_LOGD(FONT_COLOR_RESET"[%d] " fmt "\n", gettid(), ##arg); \
69 #define thumb_warn_slog(fmt, arg...) do{ \
70 SECURE_LOGW(FONT_COLOR_GREEN"[%d] " fmt "\n", gettid(), ##arg); \
74 #define ERR_BUF_LENGHT 256
75 #define thumb_stderror(fmt) do { \
76 char buf[ERR_BUF_LENGHT] = {0,}; \
77 strerror_r(errno, buf, ERR_BUF_LENGHT); \
78 LOGE(FONT_COLOR_RED fmt" : standard error [%s]", buf); \
82 void thumb_init_file_debug();
83 void thumb_close_file_debug();
85 #define thumb_file_dbg(fmt,arg...) fprintf( get_fp(), "[%s: %d] " fmt "\n", __FUNCTION__, __LINE__, ##arg)
90 #ifdef _PERFORMANCE_CHECK_
92 thumb_get_debug_time(void);
94 thumb_reset_debug_time(void);
96 thumb_print_debug_time(char* time_string);
98 thumb_print_debug_time_ex(long start, long end, const char* func_name, char* time_string);
101 #endif /*_MEDIA_THUMB_DEBUG_H_*/