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.
17 #ifndef __SIMPLE_UTIL__
18 #define __SIMPLE_UTIL__
26 #define LOG_TAG "AUL_PAD"
33 #define LOG_TAG "AUL_AMD"
36 #define MAX_LOCAL_BUFSZ 128
37 #define MAX_PID_STR_BUFSZ 20
39 #define _E(fmt, arg ...) LOGE(fmt,##arg)
40 #define _D(fmt, arg ...) LOGD(fmt,##arg)
42 #define retvm_if(expr, val, fmt, arg ...) do { \
45 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
50 #define retv_if(expr, val) do { \
52 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
57 int __proc_iter_cmdline(int (*iterfunc)
58 (const char *dname, const char *cmdline, void *priv),
60 int __proc_iter_pgid(int pgid, int (*iterfunc)(int pid, void *priv),
62 char *__proc_get_cmdline_bypid(int pid);
64 static inline const char *FILENAME(const char *filename)