4 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef _SENSOR_LOGS_H_
21 #define _SENSOR_LOGS_H_
24 #include <sys/types.h>
26 #define EVENT_TYPE_SHIFT 16
27 #define SENSOR_TYPE_SHIFT 32
29 #define MICROSECONDS(tv) ((tv.tv_sec * 1000000ll) + tv.tv_usec)
34 #define LOG_TAG "SENSOR"
39 #define _D(...) do{} while(0)
51 # define warn_if(expr, fmt, arg...) do { \
53 _D("(%s) -> " fmt, #expr, ##arg); \
56 # define ret_if(expr) do { \
58 _D("(%s) -> %s() return", #expr, __FUNCTION__); \
62 # define retv_if(expr, val) do { \
64 _D("(%s) -> %s() return", #expr, __FUNCTION__); \
68 # define retm_if(expr, fmt, arg...) do { \
71 _D("(%s) -> %s() return", #expr, __FUNCTION__); \
75 # define retvm_if(expr, val, fmt, arg...) do { \
78 _D("(%s) -> %s() return", #expr, __FUNCTION__); \
84 # define warn_if(expr, fmt, arg...) do { \
89 # define ret_if(expr) do { \
94 # define retv_if(expr, val) do { \
99 # define retm_if(expr, fmt, arg...) do { \
105 # define retvm_if(expr, val, fmt, arg...) do { \
119 const char* get_client_name(void);
120 bool get_proc_name(pid_t pid, char *process_name);
126 #endif /* _SENSOR_LOGS_H_ */