*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
DECLARE(int, execl , const char *path, const char *arg, ...);
DECLARE(int, execlp, const char *file, const char *arg, ...);
-DECLARE(int, execle, const char *path, const char *arg, ...
- /*, char * const envp[] */);
+DECLARE(int, execle, const char *path, const char *arg, ...);
+ /*, char * const envp[]); */
DECLARE(int, execv, const char *path, char *const argv[]);
DECLARE(int, execve, const char *filename, char *const argv[],
char *const envp[]);
DECLARE(int, execvp, const char *file, char *const argv[]);
-DECLARE(int, execvpe, const char *file, char *const argv[],char *const envp[]);
+DECLARE(int, execvpe, const char *file, char *const argv[], char *const envp[]);
DECLARE(pid_t, fork, void);
void init_exec_fork()
INIT_FUNC_EXEC(execvpe);
}
-#define prepare_params( FUNCTION , p1, p2) \
+#define prepare_params(FUNCTION , p1, p2) \
va_list ap; \
int args_count = 0; \
int i; \
\
- INIT_FUNC_EXEC( FUNCTION ); \
+ INIT_FUNC_EXEC(FUNCTION); \
\
va_start(ap, p2); \
do \
p += sprintf(p, " \"%s\",", p1); \
p += sprintf(p, " \"%s\",", p2); \
va_start(par, p2); \
- while ( (pp = va_arg(par, char *)) != NULL) \
+ while ((pp = va_arg(par, char *)) != NULL) \
p += sprintf(p, " \"%s\",", pp); \
va_end(par); \
p += sprintf(p, ">");
return res;
}
-int PROBE_NAME(execve)(const char *filename, char *const argv[],char *const envp[])
+int PROBE_NAME(execve)(const char *filename, char *const argv[],
+ char *const envp[])
{
int res;
PRINTMSG("%s [%d] ", __FUNCTION__, getpid());
return res;
}
-int PROBE_NAME(execvpe)(const char *file, char *const argv[],char *const envp[])
+int PROBE_NAME(execvpe)(const char *file, char *const argv[],
+ char *const envp[])
{
int res;
PRINTMSG("%s [%d] ", __FUNCTION__, getpid());
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
int PROBE_NAME(execle)(const char *path, const char *arg, ...);
int PROBE_NAME(execv)(const char *path, char *const argv[]);
int PROBE_NAME(execvp)(const char *file, char *const argv[]);
-int PROBE_NAME(execve)(const char *filename, char *const argv[],char *const envp[]);
-int PROBE_NAME(execvpe)(const char *file, char *const argv[],char *const envp[]);
+int PROBE_NAME(execve)(const char *filename, char *const argv[],
+ char *const envp[]);
+int PROBE_NAME(execvpe)(const char *file, char *const argv[],
+ char *const envp[]);
pid_t PROBE_NAME(fork)(void);
#endif /* __DAFORKEXEC_PROBES_H__ */
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
DIR *dir;
struct dirent *entry;
char path[MAX_PATH_LENGTH];
- static char dirent_buffer[ sizeof(struct dirent) + PATH_MAX + 1 ] = {0,};
+ static char dirent_buffer[sizeof(struct dirent) + PATH_MAX + 1] = {0,};
static struct dirent *dirent_r = (struct dirent *)dirent_buffer;
dir = opendir(dirname);
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
{
#ifdef STDTOFILE
char STDOUT[MAX_PATH_LENGTH];
- snprintf(STDOUT,sizeof(STDOUT), "/run/swap/tmp/da_preloaded_%d_%d.log", getppid(), getpid());
+ snprintf(STDOUT, sizeof(STDOUT), "/run/swap/tmp/da_preloaded_%d_%d.log",
+ getppid(), getpid());
#else
#define STDOUT "/dev/null"
#endif
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
/* Features list, defined in probe_* headers */
#define FEATURES_LIST \
- X(FL_MEMORY_ALLOC_PROBING, 0, memory_feature, probelib_main) \
- X(FL_MEMORY_ALLOC_ALWAYS_PROBING, 0, memory_feature_always, probelib_main) \
- X(FL_ALWAYS_ON, 0, helper_feature, probelib_main) \
- X(FL_ALWAYS_ON, 0, multiprobe_helper_feature, probelib_main) \
- X(FL_ALWAYS_ON, 0, capi_feature, probelib_capi) \
- X(FL_USER_EVENT, 0, event_feature, probelib_event) \
- X(FL_FILE_API_PROBING, 0, file_feature, probelib_main) \
- X(FL_FILE_API_ALWAYS_PROBING, 0, file_feature_always, probelib_main) \
- X(FL_OPENGL_API_PROBING, 0, graphics_feature, probelib_graphics) \
- X(FL_OPENGL_API_ALWAYS_PROBING, 0, graphics_feature_always, probelib_graphics) \
- X(FL_NETWORK_API_PROBING, 0, network_feature, probelib_main) \
- X(FL_NETWORK_API_ALWAYS_PROBING, 0, network_feature_always, probelib_main) \
- X(FL_THREAD_API_PROBING, 0, thread_feature, probelib_main) \
- X(FL_THREAD_API_ALWAYS_PROBING, 0, thread_feature_always, probelib_main) \
- X(FL_UI_VIEWER_PROFILING, 0, ui_feature, probelib_uihv) \
- X(FL_SCREENSHOT, 0, screenshot_feature, probelib_screenshot)
+ X(FL_MEMORY_ALLOC_PROBING, 0, \
+ memory_feature, probelib_main) \
+ X(FL_MEMORY_ALLOC_ALWAYS_PROBING, 0, \
+ memory_feature_always, probelib_main) \
+ X(FL_ALWAYS_ON, 0, \
+ helper_feature, probelib_main) \
+ X(FL_ALWAYS_ON, 0, \
+ multiprobe_helper_feature, probelib_main) \
+ X(FL_ALWAYS_ON, 0, \
+ capi_feature, probelib_capi) \
+ X(FL_USER_EVENT, 0, \
+ event_feature, probelib_event) \
+ X(FL_FILE_API_PROBING, 0, \
+ file_feature, probelib_main) \
+ X(FL_FILE_API_ALWAYS_PROBING, 0, \
+ file_feature_always, probelib_main) \
+ X(FL_OPENGL_API_PROBING, 0, \
+ graphics_feature, probelib_graphics) \
+ X(FL_OPENGL_API_ALWAYS_PROBING, 0, \
+ graphics_feature_always, probelib_graphics) \
+ X(FL_NETWORK_API_PROBING, 0, \
+ network_feature, probelib_main) \
+ X(FL_NETWORK_API_ALWAYS_PROBING, 0, \
+ network_feature_always, probelib_main) \
+ X(FL_THREAD_API_PROBING, 0, \
+ thread_feature, probelib_main) \
+ X(FL_THREAD_API_ALWAYS_PROBING, 0, \
+ thread_feature_always, probelib_main) \
+ X(FL_UI_VIEWER_PROFILING, 0, \
+ ui_feature, probelib_uihv) \
+ X(FL_SCREENSHOT, 0, \
+ screenshot_feature, probelib_screenshot)
#endif /* __FEATURES_LIST_H__ */
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
#endif
-#define ELFW(type) _ElfW (ELF, __ELF_NATIVE_CLASS, type)
-#define _ElfW(e,w,t) _ElfW_1 (e, w, _##t)
-#define _ElfW_1(e,w,t) e##w##t
+#define ELFW(type) _ELFW(ELF, __ELF_NATIVE_CLASS, type)
+#define _ELFW(e, w, t) _ELFW_1(e, w, _##t)
+#define _ELFW_1(e, w, t) e##w##t
typedef long int Lmid_t;
const char *lmap_get_name(const struct link_map *map, unsigned long offset);
/* Pass name - get .got.plt entry address */
-unsigned long lmap_reladdr_by_name(const struct link_map *map, const char *name);
+unsigned long lmap_reladdr_by_name(const struct link_map *map,
+ const char *name);
/* Pass name - get .got entry address */
-unsigned long lmap_gotaddr_by_name(const struct link_map *map, const char *name);
+unsigned long lmap_gotaddr_by_name(const struct link_map *map,
+ const char *name);
/* Pass offset - get GOT entry address */
unsigned long lmap_reladdr_by_offset(const struct link_map *map,
return NULL;
}
-static int _patch_bin(struct dl_phdr_info *info, size_t __unused size, void *data)
+static int _patch_bin(struct dl_phdr_info *info, size_t __unused size,
+ void *data)
{
struct link_map *map;
struct phdr_info pi;
#elif (defined __i386__)
# define DL_FIXUP_VALUE_TYPE ElfW(Addr)
-# define ARCH_FIXUP_ATTRIBUTE __attribute__ ((regparm (3), stdcall, unused))
+# define ARCH_FIXUP_ATTRIBUTE __attribute__((regparm(3), stdcall, unused))
#else
# error "This arch is not supported"
* each of which contains an enormous amount of another data absolutely useless
* here.*/
-DL_FIXUP_VALUE_TYPE __attribute ((noinline)) ARCH_FIXUP_ATTRIBUTE
-__dl_fixup_wrapper (
+DL_FIXUP_VALUE_TYPE __attribute((noinline)) ARCH_FIXUP_ATTRIBUTE
+__dl_fixup_wrapper(
# ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
ELF_MACHINE_RUNTIME_FIXUP_ARGS,
# endif
unsigned int i, j;
unsigned long got_addr;
ElfW(Addr) exec_addr;
+ struct probe_desc_t *probe;
func_name = lmap_get_name(l, reloc_arg);
if (func_name == NULL)
continue;
for (j = 0; j < features[i]->cnt; j++) {
+ probe = &features[i]->probes[j];
/* Check binary */
- if ((features[i]->probes[j].flags != GT_ALWAYS_PROBE) &&
- ((features[i]->probes[j].flags != GT_TARGET_PROBE) &&
+ if ((probe->flags != GT_ALWAYS_PROBE) &&
+ ((probe->flags != GT_TARGET_PROBE) &&
target_bin))
continue;
/* Using strcmp() cause orig_name is predefined */
- if (strcmp(features[i]->probes[j].orig_name, func_name) == 0) {
- /* FIXME Possible race condition, cause GOT entry already
- * patched by linker and points to an original handler, but not
- * our handler. Ideas:
+ if (strcmp(probe->orig_name,
+ func_name) == 0) {
+ /* FIXME Possible race condition, cause GOT
+ * entry already patched by linker and points
+ * to an original handler, but not our handler.
+ * Ideas:
* - set probe right after _dl_fixup() exec
* and patch all entries by it;
* - check where are treads when we starting. */
- features[i]->probes[j].orig_ptr = exec_addr;
- *(ElfW(Addr) *)got_addr = features[i]->probes[j].handler_ptr;
- exec_addr = (unsigned long)features[i]->probes[j].handler_ptr;
+ probe->orig_ptr = exec_addr;
+ *(ElfW(Addr) *)got_addr =
+ probe->handler_ptr;
+ exec_addr = (unsigned long)probe->handler_ptr;
}
}
}
- /* TODO generate header at compile time with linker _dl_fixup() address to
- * use here. Let it be called dl_fixup_p */
+ /* TODO generate header at compile time with linker _dl_fixup() address
+ * to use here. Let it be called dl_fixup_p */
- /* TODO Think of several handlers at the same time (malloc()/free() can be
- * gathered always and profiled for a special binary, for example): which
- * of them should be executed? */
+ /* TODO Think of several handlers at the same time (malloc()/free() can
+ * be gathered always and profiled for a special binary, for example):
+ * which of them should be executed? */
return exec_addr;
}
bool is_for_all;
struct gp_sym_patch gsp;
int err;
+ struct probe_desc_t *probe;
target_bin = _check_if_patch(path, NULL);
}
for (j = 0; j < features[i]->cnt; j++) {
+ probe = &features[i]->probes[j];
/* If feature is not always and flags doesn't satisfy
* binary's status - continue */
- if ((features[i]->probes[j].flags != GT_ALWAYS_PROBE) &&
- ((features[i]->probes[j].flags != GT_TARGET_PROBE) &&
+ if ((probe->flags != GT_ALWAYS_PROBE) &&
+ ((probe->flags != GT_TARGET_PROBE) &&
target_bin))
continue;
gsp.map = l;
gsp.info = π
- gsp.probe = &features[i]->probes[j];
+ gsp.probe = probe;
gsp.gpi = GP_PATCHING;
_patch_sym(&gsp);
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
#include <stdlib.h> /* for getenv */
#include <string.h> /* for strstr */
#include <stdbool.h> /* for bool */
-#include <stdint.h> /* for uint32_t,uint64_t */
+#include <stdint.h> /* for uint32_t, uint64_t */
#include <stdarg.h> /* for va_list, va_arg(__appendTypeLog) */
#include <execinfo.h> /* for backtrace, backtrace_symbols */
#include <unistd.h> /* for write, alarm function, syscall */
static inline void _parse_config(char *configstr)
{
gTraceInfo.features.feature_0 = *(uint64_t *)configstr;
- gTraceInfo.features.feature_1 = *(uint64_t *)(configstr + sizeof(uint64_t));
+ gTraceInfo.features.feature_1 = *(uint64_t *)(configstr
+ + sizeof(uint64_t));
}
/* runtime configure the probe option */
/* return current thread id */
pid_t _gettid()
{
- if(gTid == -1)
+ if (gTid == -1)
gTid = syscall(__NR_gettid); /* syscall is very expensive */
return gTid;
thread_handle_del_all();
for (i = 0; i < NUM_ORIGINAL_LIBRARY; i++)
- if(lib_handle[i] != NULL)
+ if (lib_handle[i] != NULL)
dlclose(lib_handle[i]);
}
const char *msg_code_to_srt(enum AppMessageType type)
{
switch (type) {
- case APP_MSG_MSG:
- return "[INF]";
- case APP_MSG_ERROR:
- return "[ERR]";
- case APP_MSG_WARNING:
- return "[WRN]";
- default:
- return "[???]";
+ case APP_MSG_MSG:
+ return "[INF]";
+ case APP_MSG_ERROR:
+ return "[ERR]";
+ case APP_MSG_WARNING:
+ return "[WRN]";
+ default:
+ return "[???]";
}
}
*************************************************************************/
int preBlockBegin(void)
{
- if(gTraceInfo.init_complete <= 0)
+ if (gTraceInfo.init_complete <= 0)
return 0;
return 1;
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
#define LOAD_FEATURES_LIST \
- X(0, FL_MEMORY_ALLOC_PROBING_PRELOAD, preload_mem, probelib_main) \
- X(0, FL_FILE_API_PROBING_PRELOAD, preload_file, probelib_main) \
- X(0, FL_THREAD_API_PROBING_PRELOAD, preload_thread, probelib_main) \
- X(0, FL_NETWORK_API_PROBING_PRELOAD, preload_net, probelib_main) \
- X(0, FL_OPENGL_API_PROBING_PRELOAD, preload_gl, probelib_graphics) \
- X(0, FL_MEMORY_ALLOC_ALWAYS_PROBING_PRELOAD, preload_mem_always, probelib_main) \
- X(0, FL_FILE_API_ALWAYS_PROBING_PRELOAD, preload_file_always, probelib_main) \
- X(0, FL_THREAD_API_ALWAYS_PROBING_PRELOAD, preload_thread_always, probelib_main) \
- X(0, FL_NETWORK_API_ALWAYS_PROBING_PRELOAD, preload_net_always, probelib_main) \
- X(0, FL_OPENGL_API_ALWAYS_PROBING_PRELOAD, preload_gl_always, probelib_graphics)
+ X(0, FL_MEMORY_ALLOC_PROBING_PRELOAD, \
+ preload_mem, probelib_main) \
+ X(0, FL_FILE_API_PROBING_PRELOAD, \
+ preload_file, probelib_main) \
+ X(0, FL_THREAD_API_PROBING_PRELOAD, \
+ preload_thread, probelib_main) \
+ X(0, FL_NETWORK_API_PROBING_PRELOAD, \
+ preload_net, probelib_main) \
+ X(0, FL_OPENGL_API_PROBING_PRELOAD, \
+ preload_gl, probelib_graphics) \
+ X(0, FL_MEMORY_ALLOC_ALWAYS_PROBING_PRELOAD, \
+ preload_mem_always, probelib_main) \
+ X(0, FL_FILE_API_ALWAYS_PROBING_PRELOAD, \
+ preload_file_always, probelib_main) \
+ X(0, FL_THREAD_API_ALWAYS_PROBING_PRELOAD, \
+ preload_thread_always, probelib_main) \
+ X(0, FL_NETWORK_API_ALWAYS_PROBING_PRELOAD, \
+ preload_net_always, probelib_main) \
+ X(0, FL_OPENGL_API_ALWAYS_PROBING_PRELOAD, \
+ preload_gl_always, probelib_graphics)
#define FULL_FEATURES_LIST \
FEATURES_LIST \
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributed by Maxim Ostapenko <m.ostapenko@samsung.com>
*
free(report_msg);
}
-static char *get_report_file_name() {
+static char *get_report_file_name()
+{
const char report_file_name_base[] = "/run/swap/tmp/lsan.log";
static char report_file_name[MAX_PATH_LENGTH];
snprintf(report_file_name, MAX_PATH_LENGTH, "%s.%d",
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
#undef la_objopen
struct link_map;
-extern unsigned int la_objopen (struct link_map *__map, Lmid_t __lmid, uintptr_t *__cookie);
+extern unsigned int la_objopen (struct link_map *__map, Lmid_t __lmid,
+ uintptr_t *__cookie);
-#include <stddef.h> // for ptrdiff_t
-//#include <tls.h>
-//#include <bits/libc-lock.h>
+#include <stddef.h> /* for ptrdiff_t */
/* Number of extra dynamic section entries for this architecture.
By default there are none. */
// The type of the return value of fixup/profile_fixup.
#define DL_FIXUP_VALUE_TYPE ElfW(Addr)
-// Construct a value of type DL_FIXUP_VALUE_TYPE from a code address and a link map.
+/* Construct a value of type DL_FIXUP_VALUE_TYPE from a code address and a
+ * link map. */
#define DL_FIXUP_MAKE_VALUE(map, addr) (addr)
-// Extract the code address from a value of type DL_FIXUP_MAKE_VALUE.
+/* Extract the code address from a value of type DL_FIXUP_MAKE_VALUE. */
#define DL_FIXUP_VALUE_CODE_ADDR(value) (value)
#define DL_FIXUP_VALUE_ADDR(value) (value)
#define DL_FIXUP_ADDR_VALUE(addr) (addr)
struct link_map_machine
{
- // empty by default
+ /* empty by default */
};
/* Some internal data structures of the dynamic linker used in the
struct r_search_path_elem
{
- /* This link is only used in the `all_dirs' member of `r_search_path'. */
+ /* This link is only used in the `all_dirs' member of
+ * `r_search_path'. */
struct r_search_path_elem *next;
/* Strings saying where the definition came from. */
const char *what;
const char *where;
- /* Basename for this search path element. The string must end with a slash character. */
+ /* Basename for this search path element. The string must end with
+ * a slash character. */
const char *dirname;
size_t dirnamelen;
const char *name; /* Name requested (before search). */
struct libname_list *next; /* Link to next name for this object. */
int dont_free; /* Flag whether this element should be freed
- if the object is not entirely unloaded. */
+ *if the object is not entirely unloaded. */
};
/* Forward declaration. */
ElfW(Dyn) *l_info[DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM
+ DT_EXTRANUM + DT_VALNUM + DT_ADDRNUM];
- const ElfW(Phdr) *l_phdr; /* Pointer to program header table in core. */
+ const ElfW(Phdr) *l_phdr; /* Pointer to program header table in core. */
ElfW(Addr) l_entry; /* Entry point location. */
ElfW(Half) l_phnum; /* Number of program header entries. */
ElfW(Half) l_ldnum; /* Number of dynamic segment entries. */
lt_library, /* Library needed by main executable. */
lt_loaded /* Extra run-time loaded shared object. */
} l_type:2;
- unsigned int l_relocated:1; /* Nonzero if object's relocations done. */
- unsigned int l_init_called:1; /* Nonzero if DT_INIT function called. */
- unsigned int l_global:1; /* Nonzero if object in _dl_global_scope. */
- unsigned int l_reserved:2; /* Reserved for internal use. */
+ unsigned int l_relocated:1; /* Nonzero if object's relocations done. */
+ unsigned int l_init_called:1; /* Nonzero if DT_INIT function called. */
+ unsigned int l_global:1; /* Nonzero if object in _dl_global_scope. */
+ unsigned int l_reserved:2; /* Reserved for internal use. */
unsigned int l_phdr_allocated:1; /* Nonzero if the data structure pointed
to by `l_phdr' is allocated. */
unsigned int l_soname_added:1; /* Nonzero if the SONAME is for sure in
unsigned int l_need_tls_init:1; /* Nonzero if GL(dl_init_static_tls)
should be called on this link map
when relocation finishes. */
- unsigned int l_used:1; /* Nonzero if the DSO is used. */
- unsigned int l_auditing:1; /* Nonzero if the DSO is used in auditing. */
+ unsigned int l_used:1; /* Nonzero if the DSO is used. */
+ unsigned int l_auditing:1; /* Nonzero if the DSO is used in auditing. */
unsigned int l_audit_any_plt:1; /* Nonzero if at least one audit module
is interested in the PLT interception.*/
- unsigned int l_removed:1; /* Nozero if the object cannot be used anymore
+ unsigned int l_removed:1; /* Nozero if the object cannot be used anymore
since it is removed. */
unsigned int l_contiguous:1; /* Nonzero if inter-segment holes are
mprotected or if no holes are present at
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
#ifndef __API_NAMES_GLOBAL_H__
#define __API_NAMES_GLOBAL_H__
-#define GET_VALUE_2(x,y) x##y
-#define GET_VALUE_1(x,y) GET_VALUE_2(x, y)
+#define GET_VALUE_2(x, y) x##y
+#define GET_VALUE_1(x, y) GET_VALUE_2(x, y)
#define PROBE_NAME(func) GET_VALUE_1(PROBE_NAME_PREFIX, func)
#define PROBE_NAME_PREFIX __PROBE__
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
CONCAT(FUNC_ARGS_VA, N_ARG(__VA_ARGS__, C_SEQ_N())(__VA_ARGS__))
#define N_ARG(...) ARG_N(__VA_ARGS__)
#define ARG_N(_1n, _1t, _2n, _2t, _3n, _3t, _4n, _4t, _5n, _5t, _6n, _6t, _7n, \
- _7t, _8n, _8t, _9n, _9t, _10n, _10t, _11n, _11t, _12n, _12t, N, ...) N
-#define C_SEQ_N() 12, 11, 11, 10, 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0
-#define C_SEQ_NV() 12, 12, 11, 11, 10, 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 0
+ _7t, _8n, _8t, _9n, _9t, _10n, _10t, _11n, _11t, _12n, _12t, \
+ N, ...) N
+#define C_SEQ_N() 12, 11, 11, 10, 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3,\
+ 2, 2, 1, 1, 0
+#define C_SEQ_NV() 12, 12, 11, 11, 10, 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, \
+ 3, 3, 2, 2, 1, 0
#define DEF_H(_ret_type, _func_name, ...) \
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
start_nsec = get_current_nsec();
/* FIXME fixed arguments num. increase if neccessary */
-#define PP_RSEQ_N() 10,9,8,7,6,5,4,3,2,1,0
+#define PP_RSEQ_N() 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
#define PP_ARG_N( _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N,...) N
#define PP_NARG_(...) PP_ARG_N(__VA_ARGS__)
#define GET_ARGS_NUM(...) PP_NARG_(__VA_ARGS__, PP_RSEQ_N())
#define NUM(...) GET_ARGS_NUM(__VA_ARGS__)
-#define GET2(a,b) a ## b
-#define GET1(a,b) GET2(a,b)
-#define GET0(a,b) GET1(a,b)
+#define GET2(a, b) a ## b
+#define GET1(a, b) GET2(a, b)
+#define GET0(a, b) GET1(a, b)
#define GET_FIRST_(...) GET0(GET_FIRST_, NUM(__VA_ARGS__))
#endif
#endif /* DA_GLES20_H_ */
-
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
#endif
#ifndef likely
-#define likely(x) __builtin_expect((x),1)
-#define unlikely(x) __builtin_expect((x),0)
+#define likely(x) __builtin_expect((x), 1)
+#define unlikely(x) __builtin_expect((x), 0)
#endif
#define __unused __attribute__((unused))
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
#endif
#ifndef kcalloc
-#define kcalloc(N,Z) calloc(N,Z)
+#define kcalloc(N, Z) calloc(N, Z)
#endif
#ifndef kmalloc
#define kmalloc(Z) malloc(Z)
#endif
#ifndef krealloc
-#define krealloc(P,Z) realloc(P,Z)
+#define krealloc(P, Z) realloc(P, Z)
#endif
#ifndef kfree
#define kfree(P) free(P)
*/
#define kh_foreach(h, kvar, vvar, code) { khint_t __i; \
for (__i = kh_begin(h); __i != kh_end(h); ++__i) { \
- if (!kh_exist(h,__i)) continue; \
- (kvar) = kh_key(h,__i); \
- (vvar) = kh_val(h,__i); \
+ if (!kh_exist(h, __i)) continue; \
+ (kvar) = kh_key(h, __i); \
+ (vvar) = kh_val(h, __i); \
code; \
} }
*/
#define kh_foreach_value(h, vvar, code) { khint_t __i; \
for (__i = kh_begin(h); __i != kh_end(h); ++__i) { \
- if (!kh_exist(h,__i)) continue; \
- (vvar) = kh_val(h,__i); \
+ if (!kh_exist(h, __i)) continue; \
+ (vvar) = kh_val(h, __i); \
code; \
} }
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
#define SYNC_API_NOTIFY_ALL 8
#define SYNC_API_OTHER 9
-enum feature_code_0
-{
- FL_MEMORY_ALLOC_PROBING = 0x000000000008ULL, // memory allocation API (glibc)
- FL_FILE_API_PROBING = 0x000000000010ULL, // file API (glibc, OSP)
- FL_THREAD_API_PROBING = 0x000000000020ULL, // thread API (glibc, OSP)
- FL_OSP_UI_API_PROBING = 0x000000000040ULL, // UI API (OSP)
- FL_SCREENSHOT = 0x000000000080ULL, // Screenshot
- FL_USER_EVENT = 0x000000000100ULL, // events of Touch, Gesture, Orientation, Key
- FL_RECORDING = 0x000000000200ULL, // recording the user event
- FL_NETWORK_API_PROBING = 0x000000020000ULL, // network API (glibc, OSP, libsoap, openssl)
- FL_OPENGL_API_PROBING = 0x000000040000ULL, // openGL API
-
- FL_MEMORY_ALLOC_ALWAYS_PROBING = 0x000010000000ULL, // all (include external) memory allocation API (glibc) always
- FL_FILE_API_ALWAYS_PROBING = 0x000020000000ULL, // all (include external) file API (glibc, OSP) always
- FL_THREAD_API_ALWAYS_PROBING = 0x000040000000ULL, // all (include external) thread API (glibc, OSP) always
- FL_OSP_UI_API_ALWAYS_PROBING = 0x000080000000ULL, // all (include external) UI API (OSP) always
- FL_NETWORK_API_ALWAYS_PROBING = 0x000100000000ULL, // all (include external) network API (glibc, OSP, libsoap, openssl) always
- FL_OPENGL_API_ALWAYS_PROBING = 0x000200000000ULL, // all (include external) openGL API always
- FL_UI_VIEWER_PROFILING = 0x2000000000000ULL, // ui viewer
- FL_LSAN = 0x4000000000000ULL, // enable LSan
-
- FL_ALWAYS_ON = 0xfffffffffffffULL, // always on feature
+enum feature_code_0 {
+ /* memory allocation API (glibc) */
+ FL_MEMORY_ALLOC_PROBING = 0x000000000008ULL,
+ /* file API (glibc, OSP) */
+ FL_FILE_API_PROBING = 0x000000000010ULL,
+ /* thread API (glibc, OSP) */
+ FL_THREAD_API_PROBING = 0x000000000020ULL,
+ /* UI API (OSP) */
+ FL_OSP_UI_API_PROBING = 0x000000000040ULL,
+ /* Screenshot */
+ FL_SCREENSHOT = 0x000000000080ULL,
+ /* events of Touch, Gesture, Orientation, Key */
+ FL_USER_EVENT = 0x000000000100ULL,
+ /* recording the user event */
+ FL_RECORDING = 0x000000000200ULL,
+ /* network API (glibc, OSP, libsoap, openssl) */
+ FL_NETWORK_API_PROBING = 0x000000020000ULL,
+ /* openGL API */
+ FL_OPENGL_API_PROBING = 0x000000040000ULL,
+ /* all (include external) memory allocation API (glibc) always */
+ FL_MEMORY_ALLOC_ALWAYS_PROBING = 0x000010000000ULL,
+ /* all (include external) file API (glibc, OSP) always */
+ FL_FILE_API_ALWAYS_PROBING = 0x000020000000ULL,
+ /* all (include external) thread API (glibc, OSP) always */
+ FL_THREAD_API_ALWAYS_PROBING = 0x000040000000ULL,
+ /* all (include external) UI API (OSP) always */
+ FL_OSP_UI_API_ALWAYS_PROBING = 0x000080000000ULL,
+ /* all (include external) network API always */
+ FL_NETWORK_API_ALWAYS_PROBING = 0x000100000000ULL,
+ /* all (include external) openGL API always */
+ FL_OPENGL_API_ALWAYS_PROBING = 0x000200000000ULL,
+ /* ui viewer */
+ FL_UI_VIEWER_PROFILING = 0x2000000000000ULL,
+ /* enable LSan */
+ FL_LSAN = 0x4000000000000ULL,
+ /* always on feature */
+ FL_ALWAYS_ON = 0xfffffffffffffULL,
};
enum feature_code_1 {
- FL_MEMORY_ALLOC_PROBING_PRELOAD = 0x0000000000001ULL, // 0x1 memory allocation API (glibc) based on preload
- FL_FILE_API_PROBING_PRELOAD = 0x0000000000002ULL, // 0x2 file API (glibc, OSP) based on preload
- FL_THREAD_API_PROBING_PRELOAD = 0x0000000000004ULL, // 0x4 thread API (glibc, OSP) based on preload
- FL_NETWORK_API_PROBING_PRELOAD = 0x0000000000008ULL, // 0x8 network API (glibc, OSP, libsoap, openssl) based on preload
- FL_OPENGL_API_PROBING_PRELOAD = 0x0000000000010ULL, // 0x10 openGL API based on preload
-
- FL_MEMORY_ALLOC_ALWAYS_PROBING_PRELOAD = 0x0000000000020ULL, // 0x20 all (include external) memory allocation API (glibc) always based on preload
- FL_FILE_API_ALWAYS_PROBING_PRELOAD = 0x0000000000040ULL, // 0x40 all (include external) file API (glibc, OSP) always based on preload
- FL_THREAD_API_ALWAYS_PROBING_PRELOAD = 0x0000000000080ULL, // 0x80 all (include external) thread API (glibc, OSP) always based on preload
- FL_NETWORK_API_ALWAYS_PROBING_PRELOAD = 0x0000000000100ULL, // 0x100 all (include external) network API (glibc, OSP, libsoap, openssl) always based on preload
- FL_OPENGL_API_ALWAYS_PROBING_PRELOAD = 0x0000000000200ULL, // 0x200 all (include external) openGL API always based on preload
+ /* 0x1 memory allocation API (glibc) based on preload */
+ FL_MEMORY_ALLOC_PROBING_PRELOAD = 0x0000000000001ULL,
+ /* 0x2 file API (glibc, OSP) based on preload */
+ FL_FILE_API_PROBING_PRELOAD = 0x0000000000002ULL,
+ /* 0x4 thread API (glibc, OSP) based on preload */
+ FL_THREAD_API_PROBING_PRELOAD = 0x0000000000004ULL,
+ /* 0x8 network API (glibc, OSP, libsoap, openssl) based on preload */
+ FL_NETWORK_API_PROBING_PRELOAD = 0x0000000000008ULL,
+ /* 0x10 openGL API based on preload */
+ FL_OPENGL_API_PROBING_PRELOAD = 0x0000000000010ULL,
+
+ /* 0x20 all (include external) memory API always based on preload */
+ FL_MEMORY_ALLOC_ALWAYS_PROBING_PRELOAD = 0x0000000000020ULL,
+ /* 0x40 all (include external) file API always based on preload */
+ FL_FILE_API_ALWAYS_PROBING_PRELOAD = 0x0000000000040ULL,
+ /* 0x80 all (include external) thread API always based on preload */
+ FL_THREAD_API_ALWAYS_PROBING_PRELOAD = 0x0000000000080ULL,
+ /* 0x100 all (include external) network API always based on preload */
+ FL_NETWORK_API_ALWAYS_PROBING_PRELOAD = 0x0000000000100ULL,
+ /* 0x200 all (include external) openGL API always based on preload */
+ FL_OPENGL_API_ALWAYS_PROBING_PRELOAD = 0x0000000000200ULL,
};
/* Probe flags:
// internal_sigaction instead.
int internal_sigaction_norestorer(int signum, const void *act, void *oldact);
void internal_sigdelset(__sanitizer_sigset_t *set, int signum);
-#if defined(__x86_64__) || defined(__mips__) || defined(__aarch64__) || defined(__arm__) || defined(__i386__)
+#if defined(__x86_64__) || defined(__mips__) || defined(__aarch64__) \
+ || defined(__arm__) || defined(__i386__)
uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg,
int *parent_tidptr, void *newtls, int *child_tidptr);
#endif
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
ui_app_lifecycle_callback_s uiAppCallback;
-#define PACK_ORIGINAL_APPFWCYCLE(API_ID, RTYPE, RVAL, INPUTFORMAT, ...) \
- newerrno = errno; \
- do { \
- CREATE_GENERIC_PROBE_DATA((uint64_t)0xffffffff, blockresult, orig);\
- PREPARE_LOCAL_BUF(); \
- PACK_COMMON_BEGIN(MSG_PROBE_LIFECYCLE, API_ID, INPUTFORMAT, __VA_ARGS__); \
- /* TODO Check address */ \
- /* Always feature */ \
- PACK_COMMON_END(RTYPE, RVAL, newerrno, probe_data); \
- FLUSH_LOCAL_BUF(); \
- } while(0); \
+#define PACK_ORIGINAL_APPFWCYCLE(API_ID, RTYPE, RVAL, INPUTFORMAT, ...) \
+ newerrno = errno; \
+ do { \
+ CREATE_GENERIC_PROBE_DATA((uint64_t)0xffffffff, blockresult, \
+ orig); \
+ PREPARE_LOCAL_BUF(); \
+ PACK_COMMON_BEGIN(MSG_PROBE_LIFECYCLE, API_ID, INPUTFORMAT, \
+ __VA_ARGS__); \
+ /* TODO Check address */ \
+ /* Always feature */ \
+ PACK_COMMON_END(RTYPE, RVAL, newerrno, probe_data); \
+ FLUSH_LOCAL_BUF(); \
+ } while (0); \
errno = (newerrno != 0) ? newerrno : olderrno
-/************************************ UI APP ******************************************/
+/******************************** UI APP **************************************/
static bool _ui_dalc_app_create(void *user_data)
{
bool bret = false;
static void *handle_ui_app_main;
-static int handler_ui_app_main(int argc, char **argv, ui_app_lifecycle_callback_s *callback, void *user_data)
+static int handler_ui_app_main(int argc, char **argv,
+ ui_app_lifecycle_callback_s *callback,
+ void *user_data)
{
- typedef int (*func_t)(int, char **, ui_app_lifecycle_callback_s *, void *);
+ typedef int (*func_t)(int, char **, ui_app_lifecycle_callback_s *,
+ void *);
int ret;
uiAppCallback.create = callback->create;
if (callback->app_control)
callback->app_control = _ui_dalc_app_control;
- ret = MULTIPROBE_CALL(handle_ui_app_main, func_t, argc, argv, callback, user_data);
+ ret = MULTIPROBE_CALL(handle_ui_app_main, func_t, argc, argv, callback,
+ user_data);
callback->create = uiAppCallback.create;
callback->terminate = uiAppCallback.terminate;
static void __attribute__((constructor)) ctor()
{
- handle_ui_app_main = multiprobe_reg("ui_app_main", (void *)handler_ui_app_main, true);
+ handle_ui_app_main = multiprobe_reg("ui_app_main",
+ (void *)handler_ui_app_main, true);
}
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
{
int os = _OS_NONE;
- switch(angle) {
+ switch (angle) {
case 0:
os = _OS_PORTRAIT;
break;
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
* macros for event probe
*
* log format:
- * SeqNumber`,ApiName`,Time`,Pid`,Tid`,InputParm`,Return`,PCAddr`,Error`,x`,y`,\n
- * callstack_start`,callstack`,callstack_end
+ * SeqNumber`,ApiName`,Time`,Pid`,Tid`,InputParm`,Return`,PCAddr`, Error`,
+ * x`,y`,\n
+ * callstack_start`,callstack`,callstack_end
*
*******************************************************************/
POST_UNCONDITIONAL_BLOCK_BEGIN(LC_UIEVENT); \
APPEND_LOG_INPUT(INPUTFORMAT, __VA_ARGS__); \
log.length += sprintf(log.data + log.length, \
- "`,`,`,`,1`,`,%d`,%d`,%d", x, y, EVENTTYPE);\
+ "`, `, `, `, 1`, `, %d`, %d`, %d", x, y, \
+ EVENTTYPE); \
APPEND_LOG_NULL_CALLSTACK(); \
POST_UNCONDITIONAL_BLOCK_END(); \
oldtime = timestamp; \
/* TODO generate PROBES_LIST with api_names.txt */
#define PROBES_LIST \
- X(PROBE_NAME(elm_gesture_layer_cb_set), elm_gesture_layer_cb_set, GT_TARGET_PROBE)
+ X(PROBE_NAME(elm_gesture_layer_cb_set), elm_gesture_layer_cb_set, \
+ GT_TARGET_PROBE)
/* X-macros replaced with func id's enumeration */
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
res = d->cb(d->data, event_info);
inc_current_event_index();
- CREATE_GENERIC_PROBE_DATA((uint64_t)0xffffffff, 0, 0);
+ CREATE_GENERIC_PROBE_DATA((uint64_t)0xffffffff, 0, 0);
PREPARE_LOCAL_BUF();
PACK_COMMON_BEGIN(MSG_PROBE_UIEVENT, API_ID___common_elm_gesture_layer_cb, "p", CALLER_ADDRESS);
/* Always feature */
elm_gesture_layer_cb_setp(obj, idx, cb_type, __common_elm_gesture_layer_cb, elm);
return;
}
-
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
#include "gesture.h"
#include "binproto.h"
-#define PACK_GESTURE_EVENT(API_ID, _GESTURETYPE, _X, _Y, _INFO1, _INFO2, _ARGDETECTOR) \
+#define PACK_GESTURE_EVENT(API_ID, _GESTURETYPE, _X, _Y, _INFO1, _INFO2, \
+ _ARGDETECTOR) \
do { \
char info1_str[16]; \
inc_current_event_index(); \
CREATE_GENERIC_PROBE_DATA((uint64_t)0xffffffff, 0, orig); \
PREPARE_LOCAL_BUF(); \
- PACK_COMMON_BEGIN(MSG_PROBE_UIEVENT, API_ID, "p", voidp_to_uint64(_ARGDETECTOR)); \
+ PACK_COMMON_BEGIN(MSG_PROBE_UIEVENT, API_ID, "p", \
+ voidp_to_uint64(_ARGDETECTOR)); \
/* TODO Check if address is really unused here */ \
/* Always feature */ \
PACK_COMMON_END('v', 0, 0, probe_data); \
sprintf(info1_str, "%d", _INFO1); \
- PACK_UIEVENT(_EVENT_GESTURE, _GESTURETYPE, _X, _Y, info1_str, _INFO2); \
+ PACK_UIEVENT(_EVENT_GESTURE, _GESTURETYPE, _X, _Y, \
+ info1_str, _INFO2); \
FLUSH_LOCAL_BUF(); \
} while (0)
}
-void GestureEventListener::OnCustomGestureCanceled (TouchGestureDetector &gestureDetector)
+void GestureEventListener::OnCustomGestureCanceled(TouchGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnCustomGestureCanceled__TouchGestureDetector__gestureDetector_,
_GESTURE_CUSTOM, 0, 0, 0, 0, &gestureDetector);
}
}
-void GestureEventListener::OnCustomGestureChanged (TouchGestureDetector &gestureDetector)
+void GestureEventListener::OnCustomGestureChanged(TouchGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnCustomGestureChanged__TouchGestureDetector__gestureDetector_,
_GESTURE_CUSTOM, 0, 0, 0, 0, &gestureDetector);
}
}
-void GestureEventListener::OnCustomGestureFinished (TouchGestureDetector &gestureDetector)
+void GestureEventListener::OnCustomGestureFinished(TouchGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnCustomGestureFinished__TouchGestureDetector__gestureDetector_,
_GESTURE_CUSTOM, 0, 0, 0, 0, &gestureDetector);
}
}
-void GestureEventListener::OnCustomGestureStarted (TouchGestureDetector &gestureDetector)
+void GestureEventListener::OnCustomGestureStarted(TouchGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnCustomGestureStarted__TouchGestureDetector__gestureDetector_,
_GESTURE_CUSTOM, 0, 0, 0, 0, &gestureDetector);
}
}
-void GestureEventListener::OnFlickGestureCanceled (TouchFlickGestureDetector &gestureDetector)
+void GestureEventListener::OnFlickGestureCanceled(TouchFlickGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
int x = 0, y = 0, dur = 0;
dur = gestureDetector.GetDuration();
direction = gestureDetector.GetDirection();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnFlickGestureCanceled__TouchFlickGestureDetector__gestureDetector_,
- _GESTURE_FLICK, x, y, dur, (int)direction, &gestureDetector);
+ _GESTURE_FLICK, x, y, dur, (int)direction,
+ &gestureDetector);
}
probeBlockEnd();
}
}
-void GestureEventListener::OnFlickGestureDetected (TouchFlickGestureDetector &gestureDetector)
+void GestureEventListener::OnFlickGestureDetected(TouchFlickGestureDetector &gestureDetecto)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
int x = 0, y = 0, dur = 0;
dur = gestureDetector.GetDuration();
direction = gestureDetector.GetDirection();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnFlickGestureDetected__TouchFlickGestureDetector__gestureDetector_,
- _GESTURE_FLICK, x, y, dur, (int)direction, &gestureDetector);
+ _GESTURE_FLICK, x, y, dur, (int)direction,
+ &gestureDetector);
}
probeBlockEnd();
}
}
-void GestureEventListener::OnLongPressGestureCanceled (TouchLongPressGestureDetector &gestureDetector)
+void GestureEventListener::OnLongPressGestureCanceled(TouchLongPressGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
int moveallow = 0, tcount = 0, dur = 0;
dur = gestureDetector.GetDuration();
tcount = gestureDetector.GetTouchCount();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnLongPressGestureCanceled__TouchLongPressGestureDetector__gestureDetector_,
- _GESTURE_LONGPRESS, moveallow, 0, dur, tcount, &gestureDetector);
+ _GESTURE_LONGPRESS, moveallow, 0, dur, tcount,
+ &gestureDetector);
}
probeBlockEnd();
}
}
-void GestureEventListener::OnLongPressGestureDetected (TouchLongPressGestureDetector &gestureDetector)
+void GestureEventListener::OnLongPressGestureDetected(TouchLongPressGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
int moveallow = 0, tcount = 0, dur = 0;
dur = gestureDetector.GetDuration();
tcount = gestureDetector.GetTouchCount();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnLongPressGestureDetected__TouchLongPressGestureDetector__gestureDetector_,
- _GESTURE_LONGPRESS, moveallow, 0, dur, tcount, &gestureDetector);
+ _GESTURE_LONGPRESS, moveallow, 0, dur, tcount,
+ &gestureDetector);
}
probeBlockEnd();
}
}
-void GestureEventListener::OnPanningGestureCanceled (TouchPanningGestureDetector &gestureDetector)
+void GestureEventListener::OnPanningGestureCanceled(TouchPanningGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
int tcount = 0;
}
}
-void GestureEventListener::OnPanningGestureChanged (TouchPanningGestureDetector &gestureDetector)
+void GestureEventListener::OnPanningGestureChanged(TouchPanningGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
int tcount = 0;
}
}
-void GestureEventListener::OnPanningGestureFinished (TouchPanningGestureDetector &gestureDetector)
+void GestureEventListener::OnPanningGestureFinished(TouchPanningGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
int tcount = 0;
}
}
-void GestureEventListener::OnPanningGestureStarted (TouchPanningGestureDetector &gestureDetector)
+void GestureEventListener::OnPanningGestureStarted(TouchPanningGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
int tcount = 0;
}
}
-void GestureEventListener::OnPinchGestureCanceled (TouchPinchGestureDetector &gestureDetector)
+void GestureEventListener::OnPinchGestureCanceled(TouchPinchGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
Tizen::Graphics::Point point;
point = gestureDetector.GetCenterPoint();
scale = gestureDetector.GetScale();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnPinchGestureCanceled__TouchPinchGestureDetector__gestureDetector_,
- _GESTURE_PINCH, point.x, point.y, scale, 0, &gestureDetector);
+ _GESTURE_PINCH, point.x, point.y, scale, 0,
+ &gestureDetector);
}
probeBlockEnd();
}
}
-void GestureEventListener::OnPinchGestureChanged (TouchPinchGestureDetector &gestureDetector)
+void GestureEventListener::OnPinchGestureChanged(TouchPinchGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
Tizen::Graphics::Point point;
point = gestureDetector.GetCenterPoint();
scale = gestureDetector.GetScale();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnPinchGestureChanged__TouchPinchGestureDetector__gestureDetector_,
- _GESTURE_PINCH, point.x, point.y, scale, 0, &gestureDetector);
+ _GESTURE_PINCH, point.x, point.y, scale, 0,
+ &gestureDetector);
}
probeBlockEnd();
}
}
-void GestureEventListener::OnPinchGestureFinished (TouchPinchGestureDetector &gestureDetector)
+void GestureEventListener::OnPinchGestureFinished(TouchPinchGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
Tizen::Graphics::Point point;
point = gestureDetector.GetCenterPoint();
scale = gestureDetector.GetScale();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnPinchGestureFinished__TouchPinchGestureDetector__gestureDetector_,
- _GESTURE_PINCH, point.x, point.y, scale, 0, &gestureDetector);
+ _GESTURE_PINCH, point.x, point.y, scale, 0,
+ &gestureDetector);
}
probeBlockEnd();
}
}
-void GestureEventListener::OnPinchGestureStarted (TouchPinchGestureDetector &gestureDetector)
+void GestureEventListener::OnPinchGestureStarted(TouchPinchGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
Tizen::Graphics::Point point;
point = gestureDetector.GetCenterPoint();
scale = gestureDetector.GetScale();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnPinchGestureStarted__TouchPinchGestureDetector__gestureDetector_,
- _GESTURE_PINCH, point.x, point.y, scale, 0, &gestureDetector);
+ _GESTURE_PINCH, point.x, point.y, scale, 0,
+ &gestureDetector);
}
probeBlockEnd();
}
}
-void GestureEventListener::OnRotationGestureCanceled (TouchRotationGestureDetector &gestureDetector)
+void GestureEventListener::OnRotationGestureCanceled(TouchRotationGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
int distance = 0;
distance = gestureDetector.GetDistance();
angle = gestureDetector.GetAngle();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnRotationGestureCanceled__TouchRotationGestureDetector__gestureDetector_,
- _GESTURE_ROTATION, 0, 0, distance, static_cast<int>(angle), &gestureDetector);
+ _GESTURE_ROTATION, 0, 0, distance,
+ static_cast<int>(angle), &gestureDetector);
}
probeBlockEnd();
}
}
-void GestureEventListener::OnRotationGestureChanged (TouchRotationGestureDetector &gestureDetector)
+void GestureEventListener::OnRotationGestureChanged(TouchRotationGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
int distance = 0;
distance = gestureDetector.GetDistance();
angle = gestureDetector.GetAngle();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnRotationGestureChanged__TouchRotationGestureDetector__gestureDetector_,
- _GESTURE_ROTATION, 0, 0, distance, static_cast<int>(angle), &gestureDetector);
+ _GESTURE_ROTATION, 0, 0, distance,
+ static_cast<int>(angle), &gestureDetector);
}
probeBlockEnd();
}
}
-void GestureEventListener::OnRotationGestureFinished (TouchRotationGestureDetector &gestureDetector)
+void GestureEventListener::OnRotationGestureFinished(TouchRotationGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
int distance = 0;
distance = gestureDetector.GetDistance();
angle = gestureDetector.GetAngle();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnRotationGestureFinished__TouchRotationGestureDetector__gestureDetector_,
- _GESTURE_ROTATION, 0, 0, distance, static_cast<int>(angle), &gestureDetector);
+ _GESTURE_ROTATION, 0, 0, distance,
+ static_cast<int>(angle), &gestureDetector);
}
probeBlockEnd();
}
}
-void GestureEventListener::OnRotationGestureStarted (TouchRotationGestureDetector &gestureDetector)
+void GestureEventListener::OnRotationGestureStarted(TouchRotationGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
int distance = 0;
distance = gestureDetector.GetDistance();
angle = gestureDetector.GetAngle();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnRotationGestureStarted__TouchRotationGestureDetector__gestureDetector_,
- _GESTURE_ROTATION, 0, 0, distance, static_cast<int>(angle), &gestureDetector);
+ _GESTURE_ROTATION, 0, 0, distance,
+ static_cast<int>(angle), &gestureDetector);
}
probeBlockEnd();
}
}
-void GestureEventListener::OnTapGestureCanceled (TouchTapGestureDetector &gestureDetector)
+void GestureEventListener::OnTapGestureCanceled(TouchTapGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
int move = 0, tapcount = 0, touchcount = 0, interval = 0;
interval = gestureDetector.GetTapInterval();
touchcount = gestureDetector.GetTouchCount();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnTapGestureCanceled__TouchTapGestureDetector__gestureDetector_,
- _GESTURE_TAP, move, tapcount, interval, touchcount, &gestureDetector);
+ _GESTURE_TAP, move, tapcount, interval, touchcount,
+ &gestureDetector);
}
probeBlockEnd();
}
}
-void GestureEventListener::OnTapGestureDetected (TouchTapGestureDetector &gestureDetector)
+void GestureEventListener::OnTapGestureDetected(TouchTapGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
+ if(isOptionEnabled(FL_USER_EVENT, 0)) {
probeBlockStart();
{
int move = 0, tapcount = 0, touchcount = 0, interval = 0;
interval = gestureDetector.GetTapInterval();
touchcount = gestureDetector.GetTouchCount();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnTapGestureDetected__TouchTapGestureDetector__gestureDetector_,
- _GESTURE_TAP, move, tapcount, interval, touchcount, &gestureDetector);
+ _GESTURE_TAP, move, tapcount, interval, touchcount,
+ &gestureDetector);
}
probeBlockEnd();
}
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
#ifndef __GESTURE_PROBES_H__
#define __GESTURE_PROBES_H__
-void PROBE_NAME(elm_gesture_layer_cb_set)(Evas_Object *obj, Elm_Gesture_Type idx,
- Elm_Gesture_State cb_type, Elm_Gesture_Event_Cb cb,
- void *data);
+void PROBE_NAME(elm_gesture_layer_cb_set)(Evas_Object *obj,
+ Elm_Gesture_Type idx, Elm_Gesture_State cb_type,
+ Elm_Gesture_Event_Cb cb, void *data);
#endif /* __GESTURE_PROBES_H__ */
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
bool touch_pressed = false;
static Ecore_Event_Handler *ecore_event_evas_handlers[5];
-#define PACK_HW_EVENT(API_ID, _EVENTTYPE, _DETAILTYPE, _X, _Y, _KEYCODE, _EXTRA, \
- _ARGDATA, _ARGTYPE, _ARGEVENT) \
+#define PACK_HW_EVENT(API_ID, _EVENTTYPE, _DETAILTYPE, _X, _Y, _KEYCODE, \
+ _EXTRA, _ARGDATA, _ARGTYPE, _ARGEVENT) \
do { \
CREATE_GENERIC_PROBE_DATA((uint64_t)0xffffffff, 0, 0); \
inc_current_event_index(); \
FLUSH_LOCAL_BUF(); \
} while (0)
-Eina_Bool PROBE_NAME(ecore_event_evas_key_down)(void *data, int type, void *event)
+Eina_Bool PROBE_NAME(ecore_event_evas_key_down)(void *data, int type,
+ void *event)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
- if(event != NULL)
- {
- Ecore_Event_Key* pEv = (Ecore_Event_Key*)event;
- if(strcasestr(pEv->keyname, "volume") == NULL)
- {
- PACK_HW_EVENT(API_ID_ecore_event_evas_key_down,
- _EVENT_KEY, _KEY_PRESSED, 0, 0, pEv->keyname, 0, \
- data, type, event);
- }
+ if (isOptionEnabled(FL_USER_EVENT, 0) && event) {
+ Ecore_Event_Key* pEv = (Ecore_Event_Key*)event;
+ if (strcasestr(pEv->keyname, "volume") == NULL) {
+ PACK_HW_EVENT(API_ID_ecore_event_evas_key_down,
+ _EVENT_KEY, _KEY_PRESSED, 0, 0,
+ pEv->keyname, 0, data, type, event);
}
}
Eina_Bool PROBE_NAME(ecore_event_evas_key_up)(void *data, int type, void *event)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
- if(event != NULL)
- {
- Ecore_Event_Key* pEv = (Ecore_Event_Key*)event;
- if(strcasestr(pEv->keyname, "volume") == NULL)
- {
- PACK_HW_EVENT(API_ID_ecore_event_evas_key_up,
- _EVENT_KEY, _KEY_RELEASED, 0, 0, pEv->keyname, 0, \
- data, type, event);
- }
+ if (isOptionEnabled(FL_USER_EVENT, 0) && event) {
+ Ecore_Event_Key* pEv = (Ecore_Event_Key*)event;
+ if (strcasestr(pEv->keyname, "volume") == NULL) {
+ PACK_HW_EVENT(API_ID_ecore_event_evas_key_up,
+ _EVENT_KEY, _KEY_RELEASED, 0, 0,
+ pEv->keyname, 0, data, type, event);
}
}
return ECORE_CALLBACK_PASS_ON;
}
-Eina_Bool PROBE_NAME(ecore_event_evas_mouse_button_down)(void *data, int type, void *event)
+Eina_Bool PROBE_NAME(ecore_event_evas_mouse_button_down)(void *data, int type,
+ void *event)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
- if(event != NULL)
- {
- Ecore_Event_Mouse_Button* pEv = (Ecore_Event_Mouse_Button*)event;
- touch_pressed = true;
- PACK_HW_EVENT(API_ID_ecore_event_evas_mouse_button_down,
- _EVENT_TOUCH, _TOUCH_PRESSED, pEv->root.x, pEv->root.y, "", pEv->multi.device, \
- data, type, event);
- }
+ if (isOptionEnabled(FL_USER_EVENT, 0) && event) {
+ Ecore_Event_Mouse_Button* pEv =
+ (Ecore_Event_Mouse_Button*)event;
+ touch_pressed = true;
+ PACK_HW_EVENT(API_ID_ecore_event_evas_mouse_button_down,
+ _EVENT_TOUCH, _TOUCH_PRESSED, pEv->root.x,
+ pEv->root.y, "", pEv->multi.device,
+ data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
-Eina_Bool PROBE_NAME(ecore_event_evas_mouse_button_up)(void *data, int type, void *event)
+Eina_Bool PROBE_NAME(ecore_event_evas_mouse_button_up)(void *data, int type,
+ void *event)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
- if(event != NULL)
- {
- Ecore_Event_Mouse_Button* pEv = (Ecore_Event_Mouse_Button*)event;
- touch_pressed = false;
- PACK_HW_EVENT(API_ID_ecore_event_evas_mouse_button_up,
- _EVENT_TOUCH, _TOUCH_RELEASED, pEv->root.x, pEv->root.y, "", pEv->multi.device, \
- data, type, event);
- }
+ if (isOptionEnabled(FL_USER_EVENT, 0) && event) {
+ Ecore_Event_Mouse_Button* pEv =
+ (Ecore_Event_Mouse_Button*)event;
+ touch_pressed = false;
+ PACK_HW_EVENT(API_ID_ecore_event_evas_mouse_button_up,
+ _EVENT_TOUCH, _TOUCH_RELEASED, pEv->root.x,
+ pEv->root.y, "", pEv->multi.device,
+ data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
}
-Eina_Bool PROBE_NAME(ecore_event_evas_mouse_move)(void *data, int type, void *event)
+Eina_Bool PROBE_NAME(ecore_event_evas_mouse_move)(void *data, int type,
+ void *event)
{
- if(isOptionEnabled(FL_USER_EVENT, 0))
- {
- if(touch_pressed)
- {
- if(event != NULL)
- {
- Ecore_Event_Mouse_Move* pEv = (Ecore_Event_Mouse_Move*)event;
- PACK_HW_EVENT(API_ID_ecore_event_evas_mouse_move,
- _EVENT_TOUCH, _TOUCH_MOVED, pEv->root.x, pEv->root.y, "", pEv->multi.device, \
- data, type, event);
- }
- }
+ if (isOptionEnabled(FL_USER_EVENT, 0) && touch_pressed && event) {
+ Ecore_Event_Mouse_Move* pEv = (Ecore_Event_Mouse_Move*)event;
+ PACK_HW_EVENT(API_ID_ecore_event_evas_mouse_move, _EVENT_TOUCH,
+ _TOUCH_MOVED, pEv->root.x, pEv->root.y, "",
+ pEv->multi.device, data, type, event);
}
return ECORE_CALLBACK_PASS_ON;
#ifndef __KEYTOUCH_H__
#define __KEYTOUCH_H__
-Eina_Bool PROBE_NAME(ecore_event_evas_key_down)(void *data, int type, void *event);
-Eina_Bool PROBE_NAME(ecore_event_evas_key_up)(void *data, int type, void *event);
-Eina_Bool PROBE_NAME(ecore_event_evas_mouse_button_down)(void *data, int type, void *event);
-Eina_Bool PROBE_NAME(ecore_event_evas_mouse_button_up)(void *data, int type, void *event);
-Eina_Bool PROBE_NAME(ecore_event_evas_mouse_move)(void *data, int type, void *event);
+Eina_Bool PROBE_NAME(ecore_event_evas_key_down)(void *data, int type,
+ void *event);
+Eina_Bool PROBE_NAME(ecore_event_evas_key_up)(void *data, int type,
+ void *event);
+Eina_Bool PROBE_NAME(ecore_event_evas_mouse_button_down)(void *data, int type,
+ void *event);
+Eina_Bool PROBE_NAME(ecore_event_evas_mouse_button_up)(void *data, int type,
+ void *event);
+Eina_Bool PROBE_NAME(ecore_event_evas_mouse_move)(void *data, int type,
+ void *event);
void mouse_key_init(void);
#endif /* __KEYTOUCH_H__ */
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
/* X-macros replaced with structures defenitions */
/* Used only for probes from target file */
#define X(func_name, orig_name, type) \
- { (ElfW(Addr))& func_name, #orig_name, type, (ElfW(Addr))0 },
+ { (ElfW(Addr)) &func_name, #orig_name, type, (ElfW(Addr))0 },
static struct probe_desc_t event_probes[] = {
PROBES_LIST
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
/********************************************************************
* RESOURCE PROBE MACRO
*
- * log format
- * SeqNumber`,ApiName`,Time`,Pid`,Tid`,InputParm`,Return`,PCAddr`,Error`,
- * Size`,FDValue`,FDType`,FDApiType`, \n
- * callstack_start`,callstack`,callstack_end
+ * - log format:
+ * SeqNumber`,ApiName`,Time`,Pid`,Tid`,InputParm`,Return`,PCAddr`,Error`,
+ * Size`,FDValue`,FDType`,FDApiType`, \n
+ * callstack_start`,callstack`,callstack_end
*
- * fd type
- * FD_TYPE_FILE, FD_TYPE_SOCKET
+ * - fd type:
+ * FD_TYPE_FILE, FD_TYPE_SOCKET
*
- * fd api type
- * FD_API_TYPE_OPEN, FD_API_TYPE_CLOSE, FD_API_TYPE_READ, FD_API_TYPE_WRITE,
- * FD_API_TYPE_DIRECTORY, FD_API_TYPE_PERMISSION, FD_API_TYPE_OTHER,
- * FD_API_TYPE_SEND, FD_API_TYPE_RECEIVE, FD_API_TYPE_OPTION, FD_API_TYPE_MANAGE
+ * - fd api type:
+ * FD_API_TYPE_OPEN, FD_API_TYPE_CLOSE, FD_API_TYPE_READ, FD_API_TYPE_WRITE,
+ * FD_API_TYPE_DIRECTORY, FD_API_TYPE_PERMISSION, FD_API_TYPE_OTHER,
+ * FD_API_TYPE_SEND, FD_API_TYPE_RECEIVE, FD_API_TYPE_OPTION, FD_API_TYPE_MANAGE
*
************************************************************************/
// POST_PROBEBLOCK_MIDDLE for file
// =================================================================
-#define POST_PACK_PROBEBLOCK_MIDDLE_FD(SIZE, FD, APITYPE) \
- do { \
- PACK_RESOURCE(SIZE, FD, APITYPE, \
- (_fstatret == 0 ? _statbuf.st_size : 0), _filepath); \
- FLUSH_LOCAL_BUF(); \
+#define POST_PACK_PROBEBLOCK_MIDDLE_FD(SIZE, FD, APITYPE) \
+ do { \
+ PACK_RESOURCE(SIZE, FD, APITYPE, \
+ (_fstatret == 0 ? _statbuf.st_size : 0), \
+ _filepath); \
+ FLUSH_LOCAL_BUF(); \
} while (0)
#define POST_PACK_PROBEBLOCK_MIDDLE_NOFD(SIZE, APITYPE) \
// macro for filesize
// ==================================================================
-#define DEFINE_FILESIZE_FD(fd) _fd = (fd); _filesize = get_fd_filesize(_fd);
-#define DEFINE_FILESIZE_FP(fp) _fd = checked_fileno(fp); _filesize = get_fd_filesize(_fd);
-#define DEFINE_FILESIZE_0() _fd = _filesize = 0;
+#define DEFINE_FILESIZE_FD(fd) \
+ _fd = (fd); \
+ _filesize = get_fd_filesize(_fd);
+#define DEFINE_FILESIZE_FP(fp) \
+ _fd = checked_fileno(fp); \
+ _filesize = get_fd_filesize(_fd);
+#define DEFINE_FILESIZE_0() \
+ _fd = _filesize = 0;
/*!
- * Macro AFTER_PACK_ORIGINAL_FD is used in and only in functions, which should report
- * only about regular files or sockets, so this logic implemented in macro.
- * Watch out when reusing it somewhere else
+ * Macro AFTER_PACK_ORIGINAL_FD is used in and only in functions, which should
+ * report only about regular files or sockets, so this logic implemented in
+ * macro. Watch out when reusing it somewhere else
*/
-#define AFTER_PACK_ORIGINAL_FD(API_ID, RTYPE, RVAL, SIZE, FD, APITYPE, \
- INPUTFORMAT, ...) \
-do { \
- POST_PACK_PROBEBLOCK_BEGIN(); \
- _fstatret = fstat(FD, &_statbuf); \
- if (_fstatret == -1) { \
- PRINTWRN("fstat returns error\n"); \
- } else if (stat_regular_or_socket_p(&_statbuf)) { \
- PREPARE_LOCAL_BUF(); \
- PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, __VA_ARGS__); \
- PACK_COMMON_END(RTYPE, RVAL, newerrno, probe_data); \
- POST_PACK_PROBEBLOCK_MIDDLE_FD(SIZE, FD, APITYPE); \
- } \
- POST_PACK_PROBEBLOCK_END(); \
+#define AFTER_PACK_ORIGINAL_FD(API_ID, RTYPE, RVAL, SIZE, FD, APITYPE, \
+ INPUTFORMAT, ...) \
+do { \
+ POST_PACK_PROBEBLOCK_BEGIN(); \
+ _fstatret = fstat(FD, &_statbuf); \
+ if (_fstatret == -1) { \
+ PRINTWRN("fstat returns error\n"); \
+ } else if (stat_regular_or_socket_p(&_statbuf)) { \
+ PREPARE_LOCAL_BUF(); \
+ PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, \
+ __VA_ARGS__); \
+ PACK_COMMON_END(RTYPE, RVAL, newerrno, probe_data); \
+ POST_PACK_PROBEBLOCK_MIDDLE_FD(SIZE, FD, APITYPE); \
+ } \
+ POST_PACK_PROBEBLOCK_END(); \
} while(0)
-#define AFTER_PACK_ORIGINAL_FD_MIDDLE(API_ID, RTYPE, RVAL, SIZE, FD, APITYPE, INPUTFORMAT, ...) \
-do { \
- POST_PACK_PROBEBLOCK_BEGIN(); \
- _fstatret = fstat(FD, &_statbuf); \
- if (_fstatret == -1) { \
- PRINTWRN("fstat returns error\n"); \
- } else if (stat_regular_or_socket_p(&_statbuf)) { \
- PREPARE_LOCAL_BUF(); \
- PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, __VA_ARGS__); \
- PACK_COMMON_END(RTYPE, RVAL, newerrno, probe_data); \
- POST_PACK_PROBEBLOCK_MIDDLE_FD(SIZE, FD, APITYPE); \
- } \
- POST_PACK_PROBEBLOCK_ADD_END(); \
+#define AFTER_PACK_ORIGINAL_FD_MIDDLE(API_ID, RTYPE, RVAL, SIZE, FD, APITYPE, \
+ INPUTFORMAT, ...) \
+do { \
+ POST_PACK_PROBEBLOCK_BEGIN(); \
+ _fstatret = fstat(FD, &_statbuf); \
+ if (_fstatret == -1) { \
+ PRINTWRN("fstat returns error\n"); \
+ } else if (stat_regular_or_socket_p(&_statbuf)) { \
+ PREPARE_LOCAL_BUF(); \
+ PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, \
+ __VA_ARGS__); \
+ PACK_COMMON_END(RTYPE, RVAL, newerrno, probe_data); \
+ POST_PACK_PROBEBLOCK_MIDDLE_FD(SIZE, FD, APITYPE); \
+ } \
+ POST_PACK_PROBEBLOCK_ADD_END(); \
} while(0)
-#define AFTER_PACK_ORIGINAL_NOFD(API_ID, RTYPE, RVAL, SIZE, APITYPE, INPUTFORMAT, ...) \
-do { \
- POST_PACK_PROBEBLOCK_BEGIN(); \
- PREPARE_LOCAL_BUF(); \
- PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, __VA_ARGS__); \
- PACK_COMMON_END(RTYPE, RVAL, newerrno, probe_data); \
- POST_PACK_PROBEBLOCK_MIDDLE_NOFD(SIZE, APITYPE); \
- POST_PACK_PROBEBLOCK_END(); \
+#define AFTER_PACK_ORIGINAL_NOFD(API_ID, RTYPE, RVAL, SIZE, APITYPE, \
+ INPUTFORMAT, ...) \
+do { \
+ POST_PACK_PROBEBLOCK_BEGIN(); \
+ PREPARE_LOCAL_BUF(); \
+ PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, \
+ __VA_ARGS__); \
+ PACK_COMMON_END(RTYPE, RVAL, newerrno, probe_data); \
+ POST_PACK_PROBEBLOCK_MIDDLE_NOFD(SIZE, APITYPE); \
+ POST_PACK_PROBEBLOCK_END(); \
} while(0)
-#define AFTER_PACK_ORIGINAL_FILEP(API_ID, RTYPE, RVAL, SIZE, FILEP, APITYPE, INPUTFORMAT, ...) \
-do { \
- POST_PACK_PROBEBLOCK_BEGIN(); \
- GET_FD_FROM_FILEP(FILEP); \
- if(_fd != -1) { \
- _fstatret = fstat(_fd, &_statbuf); \
- } \
- PREPARE_LOCAL_BUF(); \
- PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, __VA_ARGS__); \
- PACK_COMMON_END(RTYPE, RVAL, newerrno, probe_data); \
- POST_PACK_PROBEBLOCK_MIDDLE_FD(SIZE, _fd, APITYPE); \
- POST_PACK_PROBEBLOCK_END(); \
+#define AFTER_PACK_ORIGINAL_FILEP(API_ID, RTYPE, RVAL, SIZE, FILEP, APITYPE, \
+ INPUTFORMAT, ...) \
+do { \
+ POST_PACK_PROBEBLOCK_BEGIN(); \
+ GET_FD_FROM_FILEP(FILEP); \
+ if(_fd != -1) { \
+ _fstatret = fstat(_fd, &_statbuf); \
+ } \
+ PREPARE_LOCAL_BUF(); \
+ PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, \
+ __VA_ARGS__); \
+ PACK_COMMON_END(RTYPE, RVAL, newerrno, probe_data); \
+ POST_PACK_PROBEBLOCK_MIDDLE_FD(SIZE, _fd, APITYPE); \
+ POST_PACK_PROBEBLOCK_END(); \
} while(0)
/*!
{
return S_ISREG(buf->st_mode) || S_ISSOCK(buf->st_mode);
}
-#define BEFORE_ORIGINAL_START_END_FD(API_ID, RTYPE, FUNCNAME, LIBNAME, FD, APITYPE, INPUTFORMAT, ...) \
- DECLARE_VARIABLE_FD; \
- PRE_PROBEBLOCK_BEGIN(); \
- _fstatret = fstat(FD, &_statbuf); \
- if (_fstatret == -1) { \
- PRINTWRN("fstat returns error\n"); \
- } else if (stat_regular_or_socket_p(&_statbuf)) { \
- DEFINE_FILESIZE_FD(fd); \
- PREPARE_LOCAL_BUF(); \
- PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, __VA_ARGS__); \
- PACK_COMMON_END(RTYPE, 0, 0, probe_data); \
- PACK_RESOURCE(0, FD, APITYPE, _filesize, _filepath); \
- FLUSH_LOCAL_BUF(); \
- } \
- PRE_PROBEBLOCK_END(); \
-
-#define AFTER_ORIGINAL_START_END_FD(API_ID, RTYPE, RVAL, SIZE, FD, APITYPE, INPUTFORMAT, ...) \
-do { \
- POST_PACK_PROBEBLOCK_BEGIN(); \
- inc_current_event_index(); \
- _fstatret = fstat(FD, &_statbuf); \
- if (_fstatret == -1) { \
- PRINTWRN("fstat returns error\n"); \
- } else if (stat_regular_or_socket_p(&_statbuf)) { \
- PREPARE_LOCAL_BUF(); \
- PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, __VA_ARGS__); \
- PACK_COMMON_END(RTYPE, RVAL, newerrno, probe_data); \
- PACK_RESOURCE(SIZE, FD, APITYPE, _filesize, _filepath); \
- FLUSH_LOCAL_BUF(); \
- } \
- POST_PACK_PROBEBLOCK_END(); \
+#define BEFORE_ORIGINAL_START_END_FD(API_ID, RTYPE, FUNCNAME, LIBNAME, FD, \
+ APITYPE, INPUTFORMAT, ...) \
+ DECLARE_VARIABLE_FD; \
+ PRE_PROBEBLOCK_BEGIN(); \
+ _fstatret = fstat(FD, &_statbuf); \
+ if (_fstatret == -1) { \
+ PRINTWRN("fstat returns error\n"); \
+ } else if (stat_regular_or_socket_p(&_statbuf)) { \
+ DEFINE_FILESIZE_FD(fd); \
+ PREPARE_LOCAL_BUF(); \
+ PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, \
+ __VA_ARGS__); \
+ PACK_COMMON_END(RTYPE, 0, 0, probe_data); \
+ PACK_RESOURCE(0, FD, APITYPE, _filesize, _filepath); \
+ FLUSH_LOCAL_BUF(); \
+ } \
+ PRE_PROBEBLOCK_END(); \
+
+#define AFTER_ORIGINAL_START_END_FD(API_ID, RTYPE, RVAL, SIZE, FD, APITYPE, \
+ INPUTFORMAT, ...) \
+do { \
+ POST_PACK_PROBEBLOCK_BEGIN(); \
+ inc_current_event_index(); \
+ _fstatret = fstat(FD, &_statbuf); \
+ if (_fstatret == -1) { \
+ PRINTWRN("fstat returns error\n"); \
+ } else if (stat_regular_or_socket_p(&_statbuf)) { \
+ PREPARE_LOCAL_BUF(); \
+ PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, \
+ __VA_ARGS__); \
+ PACK_COMMON_END(RTYPE, RVAL, newerrno, probe_data); \
+ PACK_RESOURCE(SIZE, FD, APITYPE, _filesize, _filepath); \
+ FLUSH_LOCAL_BUF(); \
+ } \
+ POST_PACK_PROBEBLOCK_END(); \
} while(0)
-#define BEFORE_ORIGINAL_START_END_NOFD(API_ID, RTYPE, FUNCNAME, LIBNAME, APITYPE, INPUTFORMAT, ...) \
- DECLARE_VARIABLE_FD; \
- PRE_PROBEBLOCK_BEGIN(); \
- DEFINE_FILESIZE_0(); \
- PREPARE_LOCAL_BUF(); \
- PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, __VA_ARGS__); \
- PACK_COMMON_END(RTYPE, 0, 0, probe_data); \
- POST_PACK_PROBEBLOCK_MIDDLE_NOFD(0, APITYPE); \
+#define BEFORE_ORIGINAL_START_END_NOFD(API_ID, RTYPE, FUNCNAME, LIBNAME, \
+ APITYPE, INPUTFORMAT, ...) \
+ DECLARE_VARIABLE_FD; \
+ PRE_PROBEBLOCK_BEGIN(); \
+ DEFINE_FILESIZE_0(); \
+ PREPARE_LOCAL_BUF(); \
+ PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, \
+ __VA_ARGS__); \
+ PACK_COMMON_END(RTYPE, 0, 0, probe_data); \
+ POST_PACK_PROBEBLOCK_MIDDLE_NOFD(0, APITYPE); \
PRE_PROBEBLOCK_END()
-#define BEFORE_ORIGINAL_START_END_FILEP(API_ID, RTYPE, FUNCNAME, LIBNAME, FILEP, APITYPE, INPUTFORMAT, ...) \
- DECLARE_VARIABLE_FD; \
- PRE_PROBEBLOCK_BEGIN(); \
- GET_FD_FROM_FILEP(FILEP); \
- if(_fd != -1) { \
- _fstatret = fstat(_fd, &_statbuf); \
- } \
- PREPARE_LOCAL_BUF(); \
- PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, __VA_ARGS__); \
- PACK_COMMON_END(RTYPE, 0, 0, probe_data); \
- POST_PACK_PROBEBLOCK_MIDDLE_FD(0, _fd, APITYPE); \
+#define BEFORE_ORIGINAL_START_END_FILEP(API_ID, RTYPE, FUNCNAME, LIBNAME, \
+ FILEP, APITYPE, INPUTFORMAT, ...) \
+ DECLARE_VARIABLE_FD; \
+ PRE_PROBEBLOCK_BEGIN(); \
+ GET_FD_FROM_FILEP(FILEP); \
+ if(_fd != -1) { \
+ _fstatret = fstat(_fd, &_statbuf); \
+ } \
+ PREPARE_LOCAL_BUF(); \
+ PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, \
+ __VA_ARGS__); \
+ PACK_COMMON_END(RTYPE, 0, 0, probe_data); \
+ POST_PACK_PROBEBLOCK_MIDDLE_FD(0, _fd, APITYPE); \
PRE_PROBEBLOCK_END()
-#define AFTER_ORIGINAL_START_END_NOFD(API_ID, RTYPE, RVAL, SIZE, APITYPE, INPUTFORMAT, ...) \
-do { \
- POST_PACK_PROBEBLOCK_BEGIN(); \
- inc_current_event_index(); \
- PREPARE_LOCAL_BUF(); \
- PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, __VA_ARGS__); \
- PACK_COMMON_END(RTYPE, RVAL, newerrno, probe_data); \
- POST_PACK_PROBEBLOCK_MIDDLE_NOFD(SIZE, APITYPE); \
- POST_PACK_PROBEBLOCK_END(); \
+#define AFTER_ORIGINAL_START_END_NOFD(API_ID, RTYPE, RVAL, SIZE, APITYPE, \
+ INPUTFORMAT, ...) \
+do { \
+ POST_PACK_PROBEBLOCK_BEGIN(); \
+ inc_current_event_index(); \
+ PREPARE_LOCAL_BUF(); \
+ PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, \
+ __VA_ARGS__); \
+ PACK_COMMON_END(RTYPE, RVAL, newerrno, probe_data); \
+ POST_PACK_PROBEBLOCK_MIDDLE_NOFD(SIZE, APITYPE); \
+ POST_PACK_PROBEBLOCK_END(); \
} while(0)
-#define AFTER_ORIGINAL_START_END_FILEP(API_ID, RTYPE, RVAL, SIZE, FILEP, APITYPE, INPUTFORMAT, ...) \
-do { \
- POST_PACK_PROBEBLOCK_BEGIN(); \
- inc_current_event_index(); \
- GET_FD_FROM_FILEP(FILEP); \
- if(_fd != -1) { \
- _fstatret = fstat(_fd, &_statbuf); \
- } \
- PREPARE_LOCAL_BUF(); \
- PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, __VA_ARGS__); \
- PACK_COMMON_END(RTYPE, RVAL, newerrno, probe_data); \
- POST_PACK_PROBEBLOCK_MIDDLE_FD(SIZE, _fd, APITYPE); \
- POST_PACK_PROBEBLOCK_END(); \
+#define AFTER_ORIGINAL_START_END_FILEP(API_ID, RTYPE, RVAL, SIZE, FILEP, \
+ APITYPE, INPUTFORMAT, ...) \
+do { \
+ POST_PACK_PROBEBLOCK_BEGIN(); \
+ inc_current_event_index(); \
+ GET_FD_FROM_FILEP(FILEP); \
+ if(_fd != -1) { \
+ _fstatret = fstat(_fd, &_statbuf); \
+ } \
+ PREPARE_LOCAL_BUF(); \
+ PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID, INPUTFORMAT, \
+ __VA_ARGS__); \
+ PACK_COMMON_END(RTYPE, RVAL, newerrno, probe_data); \
+ POST_PACK_PROBEBLOCK_MIDDLE_FD(SIZE, _fd, APITYPE); \
+ POST_PACK_PROBEBLOCK_END(); \
} while(0)
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
return path;
}
-HANDLER_WRAPPERS_VAR(file_feature, oflag, int, open, const char*, path, int, oflag, ...)
+HANDLER_WRAPPERS_VAR(file_feature, oflag, int, open, const char*, path,
+ int, oflag, ...)
{
int (*openp)(const char* path, int oflag, ...);
char buffer[PATH_MAX];
openp = (void *)PROBE_GET_FUNC(probe_data);
- if(oflag & O_CREAT)
+ if (oflag & O_CREAT)
mode = va_arg(args, int);
ret = openp(path, oflag, mode);
return ret;
}
-HANDLER_WRAPPERS_VAR(file_feature, oflag, int, openat, int, fd, const char*, path, int, oflag, ...)
+HANDLER_WRAPPERS_VAR(file_feature, oflag, int, openat, int, fd,
+ const char*, path, int, oflag, ...)
{
int (*openatp)(int fd, const char* path, int oflag, ...);
char buffer[PATH_MAX];
openatp = (void *)PROBE_GET_FUNC(probe_data);
- if(oflag & O_CREAT)
+ if (oflag & O_CREAT)
mode = va_arg(args, int);
ret = openatp(fd, path, oflag, mode);
return ret;
}
-HANDLER_WRAPPERS(file_feature, off_t, lseek, int, fd, off_t, offset, int, whence)
+HANDLER_WRAPPERS(file_feature, off_t, lseek, int, fd, off_t, offset,
+ int, whence)
{
int (*lseekp)(int fd, off_t offset, int whence);
off_t offret;
fchownp = (void *)PROBE_GET_FUNC(probe_data);
ret = fchownp(fd, owner, group);
- AFTER_PACK_ORIGINAL_FD(API_ID_fchown, 'd', ret, 0, fd, FD_API_PERMISSION,
- "ddd", fd, owner, group);
+ AFTER_PACK_ORIGINAL_FD(API_ID_fchown, 'd', ret, 0, fd,
+ FD_API_PERMISSION, "ddd", fd, owner, group);
return ret;
}
preadp = (void *)PROBE_GET_FUNC(probe_data);
sret = preadp(fd, buf, nbyte, offset);
- AFTER_ORIGINAL_START_END_FD(API_ID_pread, 'x', sret, (unsigned int)sret, fd,
- FD_API_READ_END, "dpxx", fd,
+ AFTER_ORIGINAL_START_END_FD(API_ID_pread, 'x', sret, (unsigned int)sret,
+ fd, FD_API_READ_END, "dpxx", fd,
voidp_to_uint64(buf),
(uint64_t)(nbyte),
(uint64_t)(offset));
return sret;
}
-HANDLER_WRAPPERS(file_feature, ssize_t, read, int, fd, void *, buf, size_t, nbyte)
+HANDLER_WRAPPERS(file_feature, ssize_t, read, int, fd, void *, buf,
+ size_t, nbyte)
{
ssize_t (*readp)(int fildes, void *buf, size_t nbyte);
ssize_t sret;
- BEFORE_ORIGINAL_START_END_FD(API_ID_read, 'x', read, LIBC, fd, FD_API_READ_START,
- "dpx", fd, voidp_to_uint64(buf),
- (uint64_t)(nbyte));
+ BEFORE_ORIGINAL_START_END_FD(API_ID_read, 'x', read, LIBC, fd,
+ FD_API_READ_START, "dpx", fd,
+ voidp_to_uint64(buf), (uint64_t)(nbyte));
readp = (void *)PROBE_GET_FUNC(probe_data);
sret = readp(fd, buf, nbyte);
- AFTER_ORIGINAL_START_END_FD(API_ID_read, 'x', sret, (unsigned int)sret, fd,
- FD_API_READ_END, "dpx", fd,
+ AFTER_ORIGINAL_START_END_FD(API_ID_read, 'x', sret, (unsigned int)sret,
+ fd, FD_API_READ_END, "dpx", fd,
voidp_to_uint64(buf),
(uint64_t)(nbyte));
ssize_t (*pwritep)(int fd, const void *buf, size_t nbyte, off_t offset);
ssize_t sret;
- BEFORE_ORIGINAL_START_END_FD(API_ID_pwrite, 'x', pwrite, LIBC, fd, FD_API_WRITE_START,
- "dpxx", fd, voidp_to_uint64(buf),
- (uint64_t)(nbyte),
+ BEFORE_ORIGINAL_START_END_FD(API_ID_pwrite, 'x', pwrite, LIBC, fd,
+ FD_API_WRITE_START, "dpxx", fd,
+ voidp_to_uint64(buf), (uint64_t)(nbyte),
(uint64_t)(offset));
pwritep = (void *)PROBE_GET_FUNC(probe_data);
sret = pwritep(fd, buf, nbyte, offset);
DEFINE_FILESIZE_FD(fd);
- AFTER_ORIGINAL_START_END_FD(API_ID_pwrite, 'x', sret, (unsigned int)sret, fd,
- FD_API_WRITE_END, "dpxx", fd,
- voidp_to_uint64(buf),
+ AFTER_ORIGINAL_START_END_FD(API_ID_pwrite, 'x', sret,
+ (unsigned int)sret, fd, FD_API_WRITE_END,
+ "dpxx", fd, voidp_to_uint64(buf),
(uint64_t)(nbyte),
(uint64_t)(offset));
ssize_t (*writep)(int fildes, const void *buf, size_t nbyte);
ssize_t sret;
- BEFORE_ORIGINAL_START_END_FD(API_ID_write, 'x', write, LIBC, fd, FD_API_WRITE_START,
- "dpx", fd, voidp_to_uint64(buf),
- (uint64_t)(nbyte));
+ BEFORE_ORIGINAL_START_END_FD(API_ID_write, 'x', write, LIBC, fd,
+ FD_API_WRITE_START, "dpx", fd,
+ voidp_to_uint64(buf), (uint64_t)(nbyte));
writep = (void *)PROBE_GET_FUNC(probe_data);
sret = writep(fd, buf, nbyte);
DEFINE_FILESIZE_FD(fd);
- AFTER_ORIGINAL_START_END_FD(API_ID_write, 'x', sret, (unsigned int)sret, fd,
- FD_API_WRITE_END, "dpx", fd,
+ AFTER_ORIGINAL_START_END_FD(API_ID_write, 'x', sret, (unsigned int)sret,
+ fd, FD_API_WRITE_END, "dpx", fd,
voidp_to_uint64(buf),
(uint64_t)(nbyte));
ssize_t (*readvp)(int fd, const struct iovec *iov, int iovcnt);
ssize_t sret;
- BEFORE_ORIGINAL_START_END_FD(API_ID_readv, 'x', readv, LIBC, fd, FD_API_READ_START,
- "dpd", fd, voidp_to_uint64(iov), iovcnt);
+ BEFORE_ORIGINAL_START_END_FD(API_ID_readv, 'x', readv, LIBC, fd,
+ FD_API_READ_START, "dpd", fd,
+ voidp_to_uint64(iov), iovcnt);
readvp = (void *)PROBE_GET_FUNC(probe_data);
- sret = readvp(fd,iov,iovcnt);
+ sret = readvp(fd, iov, iovcnt);
- AFTER_ORIGINAL_START_END_FD(API_ID_readv, 'x', sret, (unsigned int)sret, fd,
- FD_API_READ_END, "dpd", fd,
+ AFTER_ORIGINAL_START_END_FD(API_ID_readv, 'x', sret, (unsigned int)sret,
+ fd, FD_API_READ_END, "dpd", fd,
voidp_to_uint64(iov), iovcnt);
return sret;
// why writev is commented ?
#if 0
-HANDLER_WRAPPERS(file_feature, ssize_t, writev, int, fd, const struct iovec *, iov, int, iovcnt)
+HANDLER_WRAPPERS(file_feature, ssize_t, writev, int, fd, const struct iovec *,
+ iov, int, iovcnt)
{
ssize_t (*writevp)(int fd, const struct iovec *iov, int iovcnt);
- MAKE_RESOURCE_PREBLOCK(writev, LIBC,3,VT_INT,fd,VT_PTR,iov,VT_INT,iovcnt);
+ MAKE_RESOURCE_PREBLOCK(writev, LIBC, 3, VT_INT, fd, VT_PTR, iov,
+ VT_INT, iovcnt);
ssize_t ret;
writevp = (void *)PROBE_GET_FUNC(probe_data);
- ret = writevp(fd,iov,iovcnt);
- MAKE_RESOURCE_POSTBLOCK(VT_SSIZE_T,ret,VT_SSIZE_T,ret,VT_INT,fd, FD_API_WRITE);
+ ret = writevp(fd, iov, iovcnt);
+ MAKE_RESOURCE_POSTBLOCK(VT_SSIZE_T, ret, VT_SSIZE_T, ret, VT_INT, fd,
+ FD_API_WRITE);
return ret;
}
#endif
dup2p = (void *)PROBE_GET_FUNC(probe_data);
ret = dup2p(fd, fd2);
- AFTER_PACK_ORIGINAL_FD(API_ID_dup2,
- 'd', ret, 0, ret, FD_API_OPEN, "dd", fd, fd2);
+ AFTER_PACK_ORIGINAL_FD(API_ID_dup2, 'd', ret, 0, ret, FD_API_OPEN,
+ "dd", fd, fd2);
return ret;
}
HANDLER_WRAPPERS_DEF(int, fchown, int, fd, uid_t, owner, gid_t, group);
HANDLER_WRAPPERS_DEF(int, lockf, int, fd, int, function, off_t, size);
HANDLER_WRAPPERS_DEF(int, fchmod, int, fd, mode_t, mode);
-HANDLER_WRAPPERS_DEF(ssize_t, pread, int, fd, void *, buf, size_t, nbyte, off_t, offset);
+HANDLER_WRAPPERS_DEF(ssize_t, pread, int, fd, void *, buf, size_t, nbyte,
+ off_t, offset);
HANDLER_WRAPPERS_DEF(ssize_t, read, int, fd, void *, buf, size_t, nbyte);
-HANDLER_WRAPPERS_DEF(ssize_t, pwrite, int, fd, const void *, buf, size_t, nbyte, off_t, offset);
+HANDLER_WRAPPERS_DEF(ssize_t, pwrite, int, fd, const void *, buf, size_t, nbyte,
+ off_t, offset);
HANDLER_WRAPPERS_DEF(ssize_t, write, int, fd, const void *, buf, size_t, nbyte);
-HANDLER_WRAPPERS_DEF(ssize_t, readv, int, fd, const struct iovec *, iov, int, iovcnt);
-//HANDLER_WRAPPERS_DEF(ssize_t, writev, int, fd, const struct iovec *, iov, int, iovcnt);
+HANDLER_WRAPPERS_DEF(ssize_t, readv, int, fd, const struct iovec *, iov,
+ int, iovcnt);
+/*HANDLER_WRAPPERS_DEF(ssize_t, writev, int, fd, const struct iovec *, iov,
+ int, iovcnt); */
HANDLER_WRAPPERS_DEF(int, fcntl, int, fd, int, cmd, ...);
HANDLER_WRAPPERS_DEF(int, dup, int, fd);
HANDLER_WRAPPERS_DEF(int, dup2, int, fd, int, fd2);
-//HANDLER_WRAPPERS_DEF(int, fstat, int, fd, struct stat *, buf);
+/* HANDLER_WRAPPERS_DEF(int, fstat, int, fd, struct stat *, buf); */
HANDLER_WRAPPERS_DEF(int, futimens, int, fd, const struct timespec *, times);
#endif /* __DA_IO_POSIX_H__ */
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
static inline char *get_abs_path(FILE *file, const char *fname,
char *buf, size_t bufsiz)
{
- char *path = file ? real_abs_path(fileno(file), buf, bufsiz): NULL;
+ char *path = file ? real_abs_path(fileno(file), buf, bufsiz) : NULL;
if (!path)
path = absolutize_filepath(fname, buf, bufsiz);
return fret;
}
-HANDLER_WRAPPERS(file_feature, FILE*, freopen, const char *, filename, const char *, mode, FILE *, stream)
+HANDLER_WRAPPERS(file_feature, FILE*, freopen, const char *, filename,
+ const char *, mode, FILE *, stream)
{
FILE* (*freopenp)(const char *filename, const char *mode, FILE *stream);
char buffer[PATH_MAX];
- FILE* fret;
+ FILE* fret;
BEFORE_ORIGINAL_FILE(freopen, LIBC);
freopenp = (void *)PROBE_GET_FUNC(probe_data);
_filepath = get_abs_path(fret, filename, buffer, PATH_MAX);
- AFTER_PACK_ORIGINAL_FILEP(API_ID_freopen, 'p', fret, 0, fret, FD_API_OPEN,
- "s4sp", filename, mode,
+ AFTER_PACK_ORIGINAL_FILEP(API_ID_freopen, 'p', fret, 0, fret,
+ FD_API_OPEN, "s4sp", filename, mode,
voidp_to_uint64(stream));
return fret;
HANDLER_WRAPPERS(file_feature, FILE*, fdopen, int, fildes, const char *, mode)
{
FILE* (*fdopenp)(int fildes, const char *mode);
- FILE* fret;
+ FILE* fret;
BEFORE_ORIGINAL_FILE(fdopen, LIBC);
fdopenp = (void *)PROBE_GET_FUNC(probe_data);
fret = fdopenp(fildes, mode);
- AFTER_PACK_ORIGINAL_FILEP(API_ID_fdopen,
- 'p', fret, 0, fret, FD_API_OPEN, "ds", fildes, mode);
+ AFTER_PACK_ORIGINAL_FILEP(API_ID_fdopen, 'p', fret, 0, fret,
+ FD_API_OPEN, "ds", fildes, mode);
return fret;
}
PRE_PROBEBLOCK_BEGIN();
GET_FD_FROM_FILEP(stream);
- if(_fd != -1) {
+ if (_fd != -1)
_fstatret = fstat(_fd, &_statbuf);
- }
PRE_PROBEBLOCK_END();
ret = fclosep(stream);
HANDLER_WRAPPERS(file_feature, FILE *, tmpfile)
{
- FILE* (*tmpfilep) ( void );
+ FILE* (*tmpfilep) (void);
FILE* fret;
BEFORE_ORIGINAL_FILE(tmpfile, LIBC);
return ret;
}
-HANDLER_WRAPPERS(file_feature, int, fseek, FILE*, stream, long int, offset, int, origin)
+HANDLER_WRAPPERS(file_feature, int, fseek, FILE*, stream, long int, offset,
+ int, origin)
{
int (*fseekp)(FILE* stream, long int offset, int origin);
fseekp = (void *)PROBE_GET_FUNC(probe_data);
ret = fseekp(stream, offset, origin);
AFTER_PACK_ORIGINAL_FILEP(API_ID_fseek,
- 'd', ret, (unsigned int)offset, stream, FD_API_OTHER,
- "pxd", voidp_to_uint64(stream),
+ 'd', ret, (unsigned int)offset, stream,
+ FD_API_OTHER, "pxd", voidp_to_uint64(stream),
(uint64_t)(offset), origin);
return ret;
}
ret = fsetposp(stream, pos);
AFTER_PACK_ORIGINAL_FILEP(API_ID_fsetpos,
'd', ret, 0, stream, FD_API_OTHER, "pp",
- voidp_to_uint64(stream), voidp_to_uint64(pos));
+ voidp_to_uint64(stream),
+ voidp_to_uint64(pos));
return ret;
}
// File read / write APIs
// *******************************************************************
-HANDLER_WRAPPERS(file_feature, int, vfprintf, FILE*, stream, const char*, format, va_list, arg)
+HANDLER_WRAPPERS(file_feature, int, vfprintf, FILE*, stream,
+ const char*, format, va_list, arg)
{
int (*vfprintfp)(FILE* stream, const char* format, va_list arg);
- BEFORE_ORIGINAL_START_END_FILEP(API_ID_vfprintf, 'd', vfprintf, LIBC, stream,
- FD_API_WRITE_START, "ps",
+ BEFORE_ORIGINAL_START_END_FILEP(API_ID_vfprintf, 'd', vfprintf, LIBC,
+ stream, FD_API_WRITE_START, "ps",
voidp_to_uint64(stream), format);
vfprintfp = (void *)PROBE_GET_FUNC(probe_data);
ret = vfprintfp(stream, format, arg);
return ret;
}
-HANDLER_WRAPPERS(file_feature, int, vfscanf, FILE*, stream, const char*, format, va_list, arg)
+HANDLER_WRAPPERS(file_feature, int, vfscanf, FILE*, stream,
+ const char*, format, va_list, arg)
{
int (*vfscanfp)(FILE* stream, const char* format, va_list arg);
- BEFORE_ORIGINAL_START_END_FILEP(API_ID_vfscanf, 'd', vfscanf, LIBC, stream,
- FD_API_READ_START, "ps",
+ BEFORE_ORIGINAL_START_END_FILEP(API_ID_vfscanf, 'd', vfscanf, LIBC,
+ stream, FD_API_READ_START, "ps",
voidp_to_uint64(stream), format);
vfscanfp = (void *)PROBE_GET_FUNC(probe_data);
ret = vfscanfp(stream, format, arg);
fgetcp = (void *)PROBE_GET_FUNC(probe_data);
ret = fgetcp(stream);
- AFTER_ORIGINAL_START_END_FILEP(API_ID_fgetc, 'd', ret, (ret != EOF), stream,
- FD_API_READ_END, "p",
+ AFTER_ORIGINAL_START_END_FILEP(API_ID_fgetc, 'd', ret, (ret != EOF),
+ stream, FD_API_READ_END, "p",
voidp_to_uint64(stream));
return ret;
}
#if 0 // why is this commented?
-HANDLER_WRAPPERS(file_feature, char*, fgets, char*, str, int, size, FILE*, stream)
+HANDLER_WRAPPERS(file_feature, char*, fgets, char*, str, int, size,
+ FILE*, stream)
{
static char* (*fgetsp)(char* str, int num, FILE* stream);
char* cret;
fgets, LIBC, stream, "sdp", str, size, stream);
cret = fgetsp(str, size, stream);
- AFTER_ORIGINAL_START_END_FILEP(API_ID_fgets, 'p', cret, (ret == NULL ? 0 : strlen(cret)),
- stream, FD_API_READ_END, "sdp", str, size, stream);
+ AFTER_ORIGINAL_START_END_FILEP(API_ID_fgets, 'p', cret,
+ (ret == NULL ? 0 : strlen(cret)),
+ stream, FD_API_READ_END, "sdp", str,
+ size, stream);
return cret;
}
fputcp = (void *)PROBE_GET_FUNC(probe_data);
ret = fputcp(character, stream);
- AFTER_ORIGINAL_START_END_FILEP(API_ID_fputc, 'd', ret, (ret == EOF ? 0 : 1),
- stream, FD_API_WRITE_END, "dp",
- character, voidp_to_uint64(stream));
+ AFTER_ORIGINAL_START_END_FILEP(API_ID_fputc, 'd', ret,
+ (ret == EOF ? 0 : 1), stream,
+ FD_API_WRITE_END, "dp", character,
+ voidp_to_uint64(stream));
return ret;
}
getcp = (void *)PROBE_GET_FUNC(probe_data);
ret = getcp(stream);
- AFTER_ORIGINAL_START_END_FILEP(API_ID_getc, 'd', ret, (ret == EOF ? 0 : 1), stream,
+ AFTER_ORIGINAL_START_END_FILEP(API_ID_getc, 'd', ret,
+ (ret == EOF ? 0 : 1), stream,
FD_API_READ_END, "p",
voidp_to_uint64(stream));
{
int (*getcp)(_IO_FILE* stream);
- BEFORE_ORIGINAL_START_END_FILEP(API_ID_getc, 'd', _IO_getc, LIBC, stream,
- FD_API_READ_START, "p",
+ BEFORE_ORIGINAL_START_END_FILEP(API_ID_getc, 'd', _IO_getc, LIBC,
+ stream, FD_API_READ_START, "p",
voidp_to_uint64(stream));
getcp = (void *)PROBE_GET_FUNC(probe_data);
ret = getcp(stream);
putcp = (void *)PROBE_GET_FUNC(probe_data);
ret = putcp(character, stream);
- AFTER_ORIGINAL_START_END_FILEP(API_ID_putc, 'd', ret, (ret == EOF ? 0 : 1),
+ AFTER_ORIGINAL_START_END_FILEP(API_ID_putc, 'd', ret,
+ (ret == EOF ? 0 : 1),
stream, FD_API_WRITE_END, "dp",
character, voidp_to_uint64(stream));
{
int (*_IO_putcp)(int character, _IO_FILE* stream);
- BEFORE_ORIGINAL_START_END_FILEP(API_ID_putc, 'd', _IO_putc, LIBC, stream,
- FD_API_WRITE_START, "dp", character,
- voidp_to_uint64(stream));
+ BEFORE_ORIGINAL_START_END_FILEP(API_ID_putc, 'd', _IO_putc, LIBC,
+ stream, FD_API_WRITE_START, "dp",
+ character, voidp_to_uint64(stream));
_IO_putcp = (void *)PROBE_GET_FUNC(probe_data);
ret = _IO_putcp(character, stream);
{
int (*ungetcp)(int character, FILE* stream);
- BEFORE_ORIGINAL_START_END_FILEP(API_ID_ungetc, 'd', ungetc, LIBC, stream,
- FD_API_WRITE_START, "dp", character,
- voidp_to_uint64(stream));
+ BEFORE_ORIGINAL_START_END_FILEP(API_ID_ungetc, 'd', ungetc, LIBC,
+ stream, FD_API_WRITE_START, "dp",
+ character, voidp_to_uint64(stream));
ungetcp = (void *)PROBE_GET_FUNC(probe_data);
ret = ungetcp(character, stream);
return ret;
}
-HANDLER_WRAPPERS(file_feature, size_t, fread, void*, ptr, size_t, size, size_t, count, FILE*, stream)
+HANDLER_WRAPPERS(file_feature, size_t, fread, void*, ptr, size_t, size,
+ size_t, count, FILE*, stream)
{
size_t (*freadp)(void* ptr, size_t size, size_t count, FILE* stream);
size_t tret;
freadp = (void *)PROBE_GET_FUNC(probe_data);
tret = freadp(ptr, size, count, stream);
- AFTER_ORIGINAL_START_END_FILEP(API_ID_fread, 'x', tret, tret*size, stream,
- FD_API_READ_END, "pxxp",
+ AFTER_ORIGINAL_START_END_FILEP(API_ID_fread, 'x', tret, tret*size,
+ stream, FD_API_READ_END, "pxxp",
voidp_to_uint64(ptr),
(uint64_t)(size),
(uint64_t)(count),
return tret;
}
-HANDLER_WRAPPERS(file_feature, size_t, fwrite, const void*, ptr, size_t, size, size_t, count, FILE*, stream)
+HANDLER_WRAPPERS(file_feature, size_t, fwrite, const void*, ptr, size_t, size,
+ size_t, count, FILE*, stream)
{
- size_t (*fwritep)(const void* ptr, size_t size, size_t count, FILE* stream);
+ size_t (*fwritep)(const void* ptr, size_t size, size_t count,
+ FILE* stream);
size_t tret;
- BEFORE_ORIGINAL_START_END_FILEP(API_ID_fwrite, 'x', fwrite, LIBC, stream,
- FD_API_WRITE_START, "pxxp",
+ BEFORE_ORIGINAL_START_END_FILEP(API_ID_fwrite, 'x', fwrite, LIBC,
+ stream, FD_API_WRITE_START, "pxxp",
voidp_to_uint64(ptr),
(uint64_t)(size),
(uint64_t)(count),
fwritep = (void *)PROBE_GET_FUNC(probe_data);
tret = fwritep(ptr, size, count, stream);
- AFTER_ORIGINAL_START_END_FILEP(API_ID_fwrite, 'x', tret, tret*size, stream,
- FD_API_WRITE_END, "pxxp",
+ AFTER_ORIGINAL_START_END_FILEP(API_ID_fwrite, 'x', tret, tret*size,
+ stream, FD_API_WRITE_END, "pxxp",
voidp_to_uint64(ptr),
(uint64_t)(size),
(uint64_t)(count),
// *********************************************************
// variable parameter function
// *********************************************************
-HANDLER_WRAPPERS_VAR(file_feature, format, int, fprintf, FILE*, stream, const char*, format, ...)
+HANDLER_WRAPPERS_VAR(file_feature, format, int, fprintf, FILE*, stream,
+ const char*, format, ...)
{
- BEFORE_ORIGINAL_START_END_FILEP(API_ID_fprintf, 'd', vfprintf, LIBC, stream,
- FD_API_WRITE_START, "ps",
+ BEFORE_ORIGINAL_START_END_FILEP(API_ID_fprintf, 'd', vfprintf, LIBC,
+ stream, FD_API_WRITE_START, "ps",
voidp_to_uint64(stream), format);
ret = vfprintf(stream, format, args);
return ret;
}
-HANDLER_WRAPPERS_VAR(file_feature, format, int, fscanf, FILE*, stream, const char*, format, ...)
+HANDLER_WRAPPERS_VAR(file_feature, format, int, fscanf, FILE*, stream,
+ const char*, format, ...)
{
- BEFORE_ORIGINAL_START_END_FILEP(API_ID_fscanf, 'd', vfscanf, LIBC, stream,
- FD_API_READ_START, "ps",
+ BEFORE_ORIGINAL_START_END_FILEP(API_ID_fscanf, 'd', vfscanf, LIBC,
+ stream, FD_API_READ_START, "ps",
voidp_to_uint64(stream), format);
ret = vfscanf(stream, format, args);
}
#if !defined(DA_DEBUG_LOG) && !defined(PRINT_STDOUT)
-HANDLER_WRAPPERS_VAR(file_feature, format, int, printf, const char*, format, ...)
+HANDLER_WRAPPERS_VAR(file_feature, format, int, printf,
+ const char*, format, ...)
{
BEFORE_ORIGINAL_START_END_NOFD(API_ID_printf, 'd', vprintf, LIBC,
FD_API_WRITE_START, "s", format);
}
#endif
-HANDLER_WRAPPERS_VAR(file_feature, format, int, scanf, const char*, format, ...)
+HANDLER_WRAPPERS_VAR(file_feature, format, int, scanf,
+ const char*, format, ...)
{
BEFORE_ORIGINAL_START_END_NOFD(API_ID_scanf, 'd', vscanf, LIBC,
FD_API_READ_START, "s", format);
getcharp = (void *)PROBE_GET_FUNC(probe_data);
ret = getcharp();
- AFTER_ORIGINAL_START_END_NOFD(API_ID_getchar, 'd', ret, (ret == EOF ? 0 : 1),
- FD_API_READ_END, "", 0);
+ AFTER_ORIGINAL_START_END_NOFD(API_ID_getchar, 'd', ret,
+ (ret == EOF ? 0 : 1), FD_API_READ_END,
+ "", 0);
return ret;
}
putcharp = (void *)PROBE_GET_FUNC(probe_data);
ret = putcharp(c);
- AFTER_ORIGINAL_START_END_NOFD(API_ID_putchar, 'd', ret, (ret == EOF ? 0 : 1),
- FD_API_WRITE_END, "d", c);
+ AFTER_ORIGINAL_START_END_NOFD(API_ID_putchar, 'd', ret,
+ (ret == EOF ? 0 : 1), FD_API_WRITE_END,
+ "d", c);
return ret;
}
voidp_to_uint64(buf));
}
-HANDLER_WRAPPERS_VOID(file_feature, void, setbuffer, FILE*, stream, char*, buf, size_t, size)
+HANDLER_WRAPPERS_VOID(file_feature, void, setbuffer, FILE*, stream, char*, buf,
+ size_t, size)
{
void (*setbufferp)(FILE* stream, char* buf, size_t size);
voidp_to_uint64(stream));
}
-HANDLER_WRAPPERS(file_feature, int, setvbuf, FILE*, stream, char*, buf, int, mode, size_t, size)
+HANDLER_WRAPPERS(file_feature, int, setvbuf, FILE*, stream, char*, buf,
+ int, mode, size_t, size)
{
int (*setvbufp)(FILE* stream, char* buf, int mode, size_t size);
BEFORE_ORIGINAL_FILE(setvbuf, LIBC);
setvbufp = (void *)PROBE_GET_FUNC(probe_data);
- ret = setvbufp(stream,buf,mode,size);
+ ret = setvbufp(stream, buf, mode, size);
AFTER_PACK_ORIGINAL_FILEP(API_ID_setvbuf,
'd', ret, size, stream, FD_API_OTHER,
"ppdx",
#define __DA_IO_STDC_H__
HANDLER_WRAPPERS_DEF(FILE*, fopen, const char*, filename, const char*, mode);
-HANDLER_WRAPPERS_DEF(FILE*, freopen, const char *, filename, const char *, mode, FILE *, stream);
+HANDLER_WRAPPERS_DEF(FILE*, freopen, const char *, filename, const char *, mode,
+ FILE *, stream);
HANDLER_WRAPPERS_DEF(FILE*, fdopen, int, fildes, const char *, mode);
HANDLER_WRAPPERS_DEF(int, fflush, FILE*, stream);
HANDLER_WRAPPERS_DEF(int, fclose, FILE*, stream);
HANDLER_WRAPPERS_DEF(int, feof, FILE*, stream);
HANDLER_WRAPPERS_DEF(int, ferror, FILE*, stream);
HANDLER_WRAPPERS_DEF(int, fileno, FILE*, stream);
-HANDLER_WRAPPERS_DEF(int, vfprintf, FILE*, stream, const char*, format, va_list, arg);
-HANDLER_WRAPPERS_DEF(int, vfscanf, FILE*, stream, const char*, format, va_list, arg);
+HANDLER_WRAPPERS_DEF(int, vfprintf, FILE*, stream, const char*, format,
+ va_list, arg);
+HANDLER_WRAPPERS_DEF(int, vfscanf, FILE*, stream, const char*, format,
+ va_list, arg);
HANDLER_WRAPPERS_DEF(int, fgetc, FILE*, stream);
//HANDLER_WRAPPERS_DEF(char*, fgets, char*, str, int, size, FILE*, stream);
HANDLER_WRAPPERS_DEF(int, fputc, int, character, FILE*, stream);
HANDLER_WRAPPERS_DEF(int, getc, FILE*, stream);
HANDLER_WRAPPERS_DEF(int, putc, int, character, FILE*, stream);
HANDLER_WRAPPERS_DEF(int, ungetc, int, character, FILE*, stream);
-HANDLER_WRAPPERS_DEF(size_t, fread, void*, ptr, size_t, size, size_t, count, FILE*, stream);
-HANDLER_WRAPPERS_DEF(size_t, fwrite, const void*, ptr, size_t, size, size_t, count, FILE*, stream);
+HANDLER_WRAPPERS_DEF(size_t, fread, void*, ptr, size_t, size, size_t, count,
+ FILE*, stream);
+HANDLER_WRAPPERS_DEF(size_t, fwrite, const void*, ptr, size_t, size,
+ size_t, count, FILE*, stream);
HANDLER_WRAPPERS_DEF(int, fprintf, FILE*, stream, const char*, format, ...);
HANDLER_WRAPPERS_DEF(int, fscanf, FILE*, stream, const char*, format, ...);
HANDLER_WRAPPERS_DEF(int, printf, const char*, format, ...);
HANDLER_WRAPPERS_DEF(void, setbuf, FILE*, stream, char*, buf);
HANDLER_WRAPPERS_DEF(void, setbuffer, FILE*, stream, char*, buf, size_t, size);
HANDLER_WRAPPERS_DEF(void, setlinebuf, FILE*, stream);
-HANDLER_WRAPPERS_DEF(int, setvbuf, FILE*, stream, char*, buf, int, mode, size_t, size);
+HANDLER_WRAPPERS_DEF(int, setvbuf, FILE*, stream, char*, buf, int, mode,
+ size_t, size);
#endif /* __DA_IO_STDC_H__ */
}
enum file_funcs_id_t get_file_feature_always_id(void *ptr)
- __attribute__((alias("get_file_feature_id")));
+ __attribute__((alias("get_file_feature_id")));
#undef X
/* X-macros replaced by structures defenitions */
/* For target binaries probes */
#define X(func_name, orig_name) \
- { (ElfW(Addr))& func_name, #orig_name, GT_TARGET_PROBE, (ElfW(Addr))0 },
+ { (ElfW(Addr))&func_name, #orig_name, GT_TARGET_PROBE, (ElfW(Addr))0 },
static struct probe_desc_t file_probes[] = {
PROBES_LIST
#undef X
/* For all binaries probes */
-#define X(func_name, orig_name) \
- { (ElfW(Addr))& CONCAT(func_name, _always), #orig_name, \
- GT_ALWAYS_PROBE,(ElfW(Addr))0},
+#define X(func_name, orig_name) \
+ { (ElfW(Addr))&CONCAT(func_name, _always), #orig_name, \
+ GT_ALWAYS_PROBE, (ElfW(Addr))0},
static struct probe_desc_t file_always_probes[] = {
PROBES_LIST
return ret;
}
-HANDLER_WRAPPERS(graphics_feature, EGLSurface, eglCreatePbufferFromClientBuffer, EGLDisplay, dpy,
- EGLenum, buftype, EGLClientBuffer, buffer, EGLConfig, config,
+HANDLER_WRAPPERS(graphics_feature, EGLSurface, eglCreatePbufferFromClientBuffer,
+ EGLDisplay, dpy, EGLenum, buftype, EGLClientBuffer, buffer, EGLConfig, config,
const EGLint *, attrib_list)
{
typedef EGLSurface (*methodType)(EGLDisplay dpy, EGLenum buftype,
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - Samsung RnD Institute Russia
return res;
}
-HANDLER_WRAPPERS(graphics_feature, Evas_GL_Surface *, evas_gl_surface_create, Evas_GL *, evas_gl,
- Evas_GL_Config *, cfg, int, w, int, h)
+HANDLER_WRAPPERS(graphics_feature, Evas_GL_Surface *, evas_gl_surface_create,
+ Evas_GL *, evas_gl, Evas_GL_Config *, cfg, int, w, int, h)
{
typedef Evas_GL_Surface *(*methodType)(Evas_GL *evas_gl,
Evas_GL_Config *cfg,
return res;
}
-HANDLER_WRAPPERS(graphics_feature, Evas_GL_Context *, evas_gl_context_create, Evas_GL *, evas_gl,
- Evas_GL_Context *, share_ctx)
+HANDLER_WRAPPERS(graphics_feature, Evas_GL_Context *, evas_gl_context_create,
+ Evas_GL *, evas_gl, Evas_GL_Context *, share_ctx)
{
typedef Evas_GL_Context *(*methodType)(Evas_GL *evas_gl,
Evas_GL_Context *share_ctx);
return res;
}
-HANDLER_WRAPPERS(graphics_feature, Eina_Bool, evas_gl_make_current, Evas_GL *, evas_gl,
- Evas_GL_Surface *, surf, Evas_GL_Context *, ctx)
+HANDLER_WRAPPERS(graphics_feature, Eina_Bool, evas_gl_make_current,
+ Evas_GL *, evas_gl, Evas_GL_Surface *, surf,
+ Evas_GL_Context *, ctx)
{
typedef Eina_Bool (*methodType)(Evas_GL *evas_gl, Evas_GL_Surface *surf,
Evas_GL_Context *ctx);
BEFORE_EVAS_GL(evas_gl_make_current);
Eina_Bool res = evas_gl_make_currentp(evas_gl, surf, ctx);
AFTER_DIRECT('b', res, APITYPE_CONTEXT, "", "ppp",
- voidp_to_uint64(evas_gl), voidp_to_uint64(surf), voidp_to_uint64(ctx));
+ voidp_to_uint64(evas_gl), voidp_to_uint64(surf),
+ voidp_to_uint64(ctx));
return res;
}
-HANDLER_WRAPPERS(graphics_feature, const char *, evas_gl_string_query, Evas_GL *, evas_gl,
- int, name)
+HANDLER_WRAPPERS(graphics_feature, const char *, evas_gl_string_query,
+ Evas_GL *, evas_gl, int, name)
{
typedef const char *(*methodType)(Evas_GL *evas_gl, int name);
BEFORE_EVAS_GL(evas_gl_string_query);
return res;
}
-HANDLER_WRAPPERS(graphics_feature, Evas_GL_Func , evas_gl_proc_address_get, Evas_GL *, evas_gl,
- const char *, name)
+HANDLER_WRAPPERS(graphics_feature, Evas_GL_Func , evas_gl_proc_address_get,
+ Evas_GL *, evas_gl, const char *, name)
{
typedef Evas_GL_Func(*methodType)(Evas_GL *evas_gl, const char *name);
BEFORE_EVAS_GL(evas_gl_proc_address_get);
return res;
}
-HANDLER_WRAPPERS(graphics_feature, Eina_Bool, evas_gl_native_surface_get, Evas_GL *, evas_gl,
- Evas_GL_Surface *, surf, Evas_Native_Surface *, ns)
+HANDLER_WRAPPERS(graphics_feature, Eina_Bool, evas_gl_native_surface_get,
+ Evas_GL *, evas_gl, Evas_GL_Surface *, surf,
+ Evas_Native_Surface *, ns)
{
typedef Eina_Bool(*methodType)(Evas_GL *evas_gl, Evas_GL_Surface *surf,
Evas_Native_Surface *ns);
/* ----------------- api get functions -------------- */
-HANDLER_WRAPPERS(graphics_feature, Evas_GL_API *, evas_gl_api_get, Evas_GL *, evas_gl)
+HANDLER_WRAPPERS(graphics_feature, Evas_GL_API *, evas_gl_api_get,
+ Evas_GL *, evas_gl)
{
typedef Evas_GL_API *(*methodType)(Evas_GL *evas_gl);
BEFORE_EVAS_GL(evas_gl_api_get);
return res;
}
-HANDLER_WRAPPERS(graphics_feature, Evas_GL_API* , elm_glview_gl_api_get, const Evas_Object *, obj)
+HANDLER_WRAPPERS(graphics_feature, Evas_GL_API* , elm_glview_gl_api_get,
+ const Evas_Object *, obj)
{
typedef Evas_GL_API *(*methodType)(const Evas_Object *obj);
BEFORE_EVAS_GL(elm_glview_gl_api_get);
return res;
}
-HANDLER_WRAPPERS(graphics_feature, Evas_GL_API *, evas_gl_context_api_get, Evas_GL *, evas_gl,
- Evas_GL_Context *, ctx)
+HANDLER_WRAPPERS(graphics_feature, Evas_GL_API *, evas_gl_context_api_get,
+ Evas_GL *, evas_gl, Evas_GL_Context *, ctx)
{
- typedef Evas_GL_API *(*methodType)(Evas_GL *evas_gl, Evas_GL_Context *ctx);
+ typedef Evas_GL_API *(*methodType)(Evas_GL *evas_gl,
+ Evas_GL_Context *ctx);
BEFORE_EVAS_GL(evas_gl_context_api_get);
Evas_GL_API *res = evas_gl_context_api_getp(evas_gl, ctx);
HANDLER_WRAPPERS_DEF(void, evas_gl_free, Evas_GL *, evas_gl);
HANDLER_WRAPPERS_DEF(void, evas_gl_config_free, Evas_GL_Config *, cfg);
-HANDLER_WRAPPERS_DEF(void, evas_gl_surface_destroy, Evas_GL *, evas_gl, Evas_GL_Surface *, surf);
-HANDLER_WRAPPERS_DEF(void, evas_gl_context_destroy, Evas_GL *, evas_gl, Evas_GL_Context *, ctx);
+HANDLER_WRAPPERS_DEF(void, evas_gl_surface_destroy, Evas_GL *, evas_gl,
+ Evas_GL_Surface *, surf);
+HANDLER_WRAPPERS_DEF(void, evas_gl_context_destroy, Evas_GL *, evas_gl,
+ Evas_GL_Context *, ctx);
HANDLER_WRAPPERS_DEF(Evas_GL *, evas_gl_new, Evas *, e);
HANDLER_WRAPPERS_DEF(Evas_GL_Config *, evas_gl_config_new, void);
-HANDLER_WRAPPERS_DEF(Evas_GL_Surface *, evas_gl_surface_create, Evas_GL *, evas_gl, Evas_GL_Config *, cfg, int, w, int, h);
-HANDLER_WRAPPERS_DEF(Evas_GL_Context *, evas_gl_context_create, Evas_GL *, evas_gl, Evas_GL_Context *, share_ctx);
-HANDLER_WRAPPERS_DEF(Eina_Bool, evas_gl_make_current, Evas_GL *, evas_gl, Evas_GL_Surface *, surf, Evas_GL_Context *, ctx);
-HANDLER_WRAPPERS_DEF(const char *, evas_gl_string_query, Evas_GL *, evas_gl, int, name);
-HANDLER_WRAPPERS_DEF(Evas_GL_Func, evas_gl_proc_address_get, Evas_GL *, evas_gl, const char *, name);
-HANDLER_WRAPPERS_DEF(Eina_Bool, evas_gl_native_surface_get, Evas_GL *, evas_gl, Evas_GL_Surface *, surf, Evas_Native_Surface *, ns);
+HANDLER_WRAPPERS_DEF(Evas_GL_Surface *, evas_gl_surface_create,
+ Evas_GL *, evas_gl, Evas_GL_Config *, cfg, int, w, int, h);
+HANDLER_WRAPPERS_DEF(Evas_GL_Context *, evas_gl_context_create,
+ Evas_GL *, evas_gl, Evas_GL_Context *, share_ctx);
+HANDLER_WRAPPERS_DEF(Eina_Bool, evas_gl_make_current, Evas_GL *, evas_gl,
+ Evas_GL_Surface *, surf, Evas_GL_Context *, ctx);
+HANDLER_WRAPPERS_DEF(const char *, evas_gl_string_query, Evas_GL *, evas_gl,
+ int, name);
+HANDLER_WRAPPERS_DEF(Evas_GL_Func, evas_gl_proc_address_get, Evas_GL *, evas_gl,
+ const char *, name);
+HANDLER_WRAPPERS_DEF(Eina_Bool, evas_gl_native_surface_get, Evas_GL *, evas_gl,
+ Evas_GL_Surface *, surf, Evas_Native_Surface *, ns);
HANDLER_WRAPPERS_DEF(Evas_GL_API *, evas_gl_api_get, Evas_GL *, evas_gl);
-HANDLER_WRAPPERS_DEF(Evas_GL_API*, elm_glview_gl_api_get, const Evas_Object *, obj);
-HANDLER_WRAPPERS_DEF(Evas_GL_API *, evas_gl_context_api_get, Evas_GL *, evas_gl, Evas_GL_Context *, ctx);
+HANDLER_WRAPPERS_DEF(Evas_GL_API*, elm_glview_gl_api_get,
+ const Evas_Object *, obj);
+HANDLER_WRAPPERS_DEF(Evas_GL_API *, evas_gl_context_api_get, Evas_GL *, evas_gl,
+ Evas_GL_Context *, ctx);
#endif /* __DA_EVAS_GL_H__ */
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
__gl_api_fake.func = (typeof(api->func)) __local_##func; \
if (__gl_api_fake.func == NULL) \
PRINTWRN("api->%s not setted", #func); \
- } while(0);
+ } while (0);
#include "da_gl_api_func_list.h"
/* --------------------------------------------------------------------- */
static __thread GLenum gl_error_external = GL_NO_ERROR;
static __thread int is_gl_error_external = 1;
-static void __ui_array_to_str(char *to, GLuint *arr ,int count, size_t bufsize)
+static void __ui_array_to_str(char *to, GLuint *arr, int count, size_t bufsize)
{
int i = 0, len = 0;
}
//lsh_get
-DECLARE(int ,glGetAttribLocation, GLuint, program, const char *, name)
+DECLARE(int, glGetAttribLocation, GLuint, program, const char *, name)
{
TYPEDEF(int (*methodType)(GLuint, const char*));
BEFORE(glGetAttribLocation);
#include "probe_graphics.h"
#define DECLARE(TYPE, FUNCNAME, ...) \
- TYPE REAL_NAME(FUNCNAME)( FUNC_TA(__VA_ARGS__) )
+ TYPE REAL_NAME(FUNCNAME)(FUNC_TA(__VA_ARGS__))
#define DECLARE_NOARGS(TYPE, FUNCNAME) TYPE REAL_NAME(FUNCNAME)()
#define DECLARE_VOID(TYPE, FUNCNAME, ...) \
TYPE REAL_NAME(FUNCNAME)(FUNC_TA(__VA_ARGS__))
UniformBlockIndex, uniformBlockBinding);
}
-DECLARE_GL_DEFAULT_VOID(void, glUniformMatrix2x3fv, "dxbp", GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value)
-DECLARE_GL_DEFAULT_VOID(void, glUniformMatrix3x2fv, "dxbp", GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value)
-DECLARE_GL_DEFAULT_VOID(void, glUniformMatrix2x4fv, "dxbp", GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value)
-DECLARE_GL_DEFAULT_VOID(void, glUniformMatrix4x2fv, "dxbp", GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value)
-DECLARE_GL_DEFAULT_VOID(void, glUniformMatrix3x4fv, "dxbp", GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value)
-DECLARE_GL_DEFAULT_VOID(void, glUniformMatrix4x3fv, "dxbp", GLint, location, GLsizei, count, GLboolean, transpose, const GLfloat *, value)
+DECLARE_GL_DEFAULT_VOID(void, glUniformMatrix2x3fv, "dxbp", GLint, location, GLsizei, count,
+ GLboolean, transpose, const GLfloat *, value)
+DECLARE_GL_DEFAULT_VOID(void, glUniformMatrix3x2fv, "dxbp", GLint, location, GLsizei, count,
+ GLboolean, transpose, const GLfloat *, value)
+DECLARE_GL_DEFAULT_VOID(void, glUniformMatrix2x4fv, "dxbp", GLint, location, GLsizei, count,
+ GLboolean, transpose, const GLfloat *, value)
+DECLARE_GL_DEFAULT_VOID(void, glUniformMatrix4x2fv, "dxbp", GLint, location, GLsizei, count,
+ GLboolean, transpose, const GLfloat *, value)
+DECLARE_GL_DEFAULT_VOID(void, glUniformMatrix3x4fv, "dxbp", GLint, location, GLsizei, count,
+ GLboolean, transpose, const GLfloat *, value)
+DECLARE_GL_DEFAULT_VOID(void, glUniformMatrix4x3fv, "dxbp", GLint, location, GLsizei, count,
+ GLboolean, transpose, const GLfloat *, value)
DECLARE_VOID(void, glVertexAttribI2ui, GLuint, index, GLuint, x, GLuint, y)
{
TYPEDEF(void (*methodType)(GLuint, GLsizei, const GLuint *, GLenum,
GLint *));
BEFORE(glGetActiveUniformsiv);
- CALL_ORIG(glGetActiveUniformsiv, program, uniformCount,uniformIndices,
+ CALL_ORIG(glGetActiveUniformsiv, program, uniformCount, uniformIndices,
pname, params);
GL_GET_ERROR();
AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dddxp", program,
AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dddd", r, g, b, a);
}
-DECLARE_GL_DEFAULT_VOID(void, glClearBufferiv, "xdp", GLenum, buffer, GLint, drawBuffer, const GLuint *, value)
-DECLARE_GL_DEFAULT_VOID(void, glClearBufferuiv, "xdp", GLenum, buffer, GLint, drawBuffer, const GLuint *, value)
-DECLARE_GL_DEFAULT_VOID(void, glClearBufferfv, "xdp", GLenum, buffer, GLint, drawBuffer, const GLfloat *, value)
-DECLARE_GL_DEFAULT_VOID(void, glClearBufferfi, "xdpd", GLenum, buffer, GLint, drawBuffer, GLfloat, depth, GLint, stencil)
+DECLARE_GL_DEFAULT_VOID(void, glClearBufferiv, "xdp", GLenum, buffer, GLint, drawBuffer,
+ const GLuint *, value)
+DECLARE_GL_DEFAULT_VOID(void, glClearBufferuiv, "xdp", GLenum, buffer, GLint, drawBuffer,
+ const GLuint *, value)
+DECLARE_GL_DEFAULT_VOID(void, glClearBufferfv, "xdp", GLenum, buffer, GLint, drawBuffer,
+ const GLfloat *, value)
+DECLARE_GL_DEFAULT_VOID(void, glClearBufferfi, "xdpd", GLenum, buffer, GLint, drawBuffer,
+ GLfloat, depth, GLint, stencil)
DECLARE_VOID(void, glTexParameterIiv, GLenum, target, GLenum, pname, GLint *, params)
data);
}
-DECLARE_GL_DEFAULT_VOID(void, glGetInteger64i_v, "xdp", GLenum, target, GLuint, index, GLint64xx *, data)
+DECLARE_GL_DEFAULT_VOID(void, glGetInteger64i_v, "xdp", GLenum, target, GLuint, index,
+ GLint64xx *, data)
DECLARE_GL_DEFAULT_VOID(void, glGetInteger64v, "xp", GLenum, pname, GLint64xx *, data)
DECLARE_GL_DEFAULT_VOID(void, glGetIntegeri_v, "xdp", GLenum, target, GLuint, index, GLint *, data)
CALL_ORIG(glFlushMappedBufferRange, target, offset, length);
GL_GET_ERROR();
AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xpp", target,
- offset, length );
+ offset, length);
}
DECLARE(GLboolean, glUnmapBuffer, GLenum, target)
return ret;
}
-DECLARE_GL_DEFAULT_VOID(void, glGetSamplerParameterfv, "dxp", GLuint, sampler, GLenum, pname, GLfloat *, params)
-DECLARE_GL_DEFAULT_VOID(void, glGetSamplerParameteriv, "dxp", GLuint, sampler, GLenum, pname, GLint *, params)
+DECLARE_GL_DEFAULT_VOID(void, glGetSamplerParameterfv, "dxp", GLuint, sampler, GLenum, pname,
+ GLfloat *, params)
+DECLARE_GL_DEFAULT_VOID(void, glGetSamplerParameteriv, "dxp", GLuint, sampler, GLenum, pname,
+ GLint *, params)
DECLARE_VOID(void, glGetSynciv, GLsync, sync, GLenum, pname, GLsizei, bufSize,
GLsizei *, length, GLint *, values)
target, internalformat, pname, bufSize, params);
}
-DECLARE_GL_DEFAULT_VOID(void, glGetBufferParameteri64v, "xxp", GLenum, target, GLenum, value, GLint64xx *, data)
+DECLARE_GL_DEFAULT_VOID(void, glGetBufferParameteri64v, "xxp", GLenum, target, GLenum, value,
+ GLint64xx *, data)
DECLARE_VOID(void, glGetBufferPointerv, GLenum, target, GLenum, pname,
faddr = dlsym(_id, func_name);
if (faddr == NULL || dlerror() != NULL) {
- PRINTWRN("[set_real_function] function <%s> not found in lib <%s>; dummy function will be seted",
+ PRINTWRN("[set_real_function] function <%s> not found in lib "
+ "<%s>; dummy function will be seted",
func_name, lib_string[id]);
faddr = __gl_dummy_function;
}
return;
}
-void init_probe_egl(__attribute__ ((unused))const char *func_name, void **func_pointer,
+void init_probe_egl(__attribute__ ((unused))const char *func_name,
+ void **func_pointer,
__attribute__ ((unused))ORIGINAL_LIBRARY id)
{
PRINTMSG(func_name);
real_glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVal[0]);
real_glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS,
&maxVal[1]);
- snprintf(maxValString, sizeof(maxValString), "%d,%d", maxVal[0], maxVal[1]);
+ snprintf(maxValString, sizeof(maxValString),
+ "%d,%d", maxVal[0], maxVal[1]);
CREATE_GENERIC_PROBE_DATA((uint64_t)0xffffffff, 0, orig);
PREPARE_LOCAL_BUF();
PACK_COMMON_BEGIN(MSG_PROBE_GL, vAPI_ID, "", 0);
}
enum graphics_funcs_id_t get_graphics_feature_always_id(void *ptr)
- __attribute__((alias("get_graphics_feature_id")));
+ __attribute__((alias("get_graphics_feature_id")));
#undef X
/* X-macros replaced by structures defenitions */
/* For target binaries probes */
#define X(func_name, orig_name) \
- { (ElfW(Addr))& func_name, #orig_name, GT_TARGET_PROBE, (ElfW(Addr))0 },
+ { (ElfW(Addr))&func_name, #orig_name, GT_TARGET_PROBE, (ElfW(Addr))0 },
static struct probe_desc_t graphics_probes[] = {
PROBES_LIST
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
* MEMORY PROBE MACRO
*
* log format
- * SeqNumber`,ApiName`,Time`,Pid`,Tid`,InputParm`,Return`,PCAddr`,Error`,
- * Size`,MemoryAPIType`,Addr`,\n
- * callstack_start`,callstack`,callstack_end
+ * SeqNumber`,ApiName`,Time`,Pid`,Tid`,InputParm`,Return`,PCAddr`,Error`,
+ * Size`,MemoryAPIType`,Addr`,\n
+ * callstack_start`,callstack`,callstack_end
*
********************************************************************/
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
pret = (*mallocp)(size);
- if(pret != NULL)
- add_memory_hash(convert_addr_to_hash(pret), size, MEMTYPE_ALLOC,
+ if (pret)
+ add_memory_hash(convert_addr_to_hash(pret), size,
+ MEMTYPE_ALLOC,
PROBE_GET_CALL_TYPE(probe_data));
POST_PACK_PROBEBLOCK_BEGIN();
PRE_PROBEBLOCK();
- if(ptr != NULL)
+ if (ptr)
del_memory_hash(convert_addr_to_hash(ptr), MEMTYPE_FREE, NULL);
(*freep)(ptr);
}
-HANDLER_WRAPPERS(memory_feature, void *, realloc, void *, memblock, size_t, size)
+HANDLER_WRAPPERS(memory_feature, void *, realloc, void *, memblock,
+ size_t, size)
{
/* TODO Split LSan */
static void* (*lsan_reallocp)(void*, size_t);
(void *)PROBE_GET_FUNC(probe_data);
PRE_PROBEBLOCK();
- if(memblock != NULL)
+ if (memblock)
del_memory_hash(convert_addr_to_hash(memblock),
MEMTYPE_FREE, NULL);
pret = (*reallocp)(memblock, size);
- if(pret != NULL)
+ if (pret)
add_memory_hash(convert_addr_to_hash(pret), size,
- MEMTYPE_ALLOC, PROBE_GET_CALL_TYPE(probe_data));
+ MEMTYPE_ALLOC,
+ PROBE_GET_CALL_TYPE(probe_data));
POST_PACK_PROBEBLOCK_BEGIN();
pret = (*callocp)(nelem, elsize);
- if(pret != NULL)
+ if (pret)
add_memory_hash(convert_addr_to_hash(pret), nelem * elsize,
- MEMTYPE_ALLOC, PROBE_GET_CALL_TYPE(probe_data));
+ MEMTYPE_ALLOC,
+ PROBE_GET_CALL_TYPE(probe_data));
POST_PACK_PROBEBLOCK_BEGIN();
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
-HANDLER_WRAPPERS(memory_feature, void *, memset, void *, memblock, int, c, size_t, n)
+HANDLER_WRAPPERS(memory_feature, void *, memset, void *, memblock, int, c,
+ size_t, n)
{
- void *(*memsetp)(void *,int,size_t);
+ void *(*memsetp)(void *, int, size_t);
DECLARE_VARIABLE_STANDARD;
void *pret;
return pret;
}
-HANDLER_WRAPPERS(memory_feature, int, memcmp, const void *, ptr1, const void *, ptr2,
- size_t, num)
+HANDLER_WRAPPERS(memory_feature, int, memcmp, const void *, ptr1,
+ const void *, ptr2, size_t, num)
{
- int(*memcmpp)(const void *,const void *,size_t);
+ int(*memcmpp)(const void *, const void *, size_t);
DECLARE_VARIABLE_STANDARD;
memcmpp = (void *)PROBE_GET_FUNC(probe_data);
return ret;
}
-HANDLER_WRAPPERS(memory_feature, void *, memcpy, void *, destination, const void *, source,
- size_t, num)
+HANDLER_WRAPPERS(memory_feature, void *, memcpy, void *, destination,
+ const void *, source, size_t, num)
{
- void *(*memcpyp)(void *,const void *,size_t);
+ void *(*memcpyp)(void *, const void *, size_t);
DECLARE_VARIABLE_STANDARD;
void *pret;
#define __LIBDAMEMMANAGE_H__
HANDLER_WRAPPERS_DEF(void *, memset, void *, memblock, int, c, size_t, n);
-HANDLER_WRAPPERS_DEF(int, memcmp, const void *, ptr1, const void *, ptr2, size_t, num);
-HANDLER_WRAPPERS_DEF(void *, memcpy, void *, destination, const void *, source, size_t, num);
+HANDLER_WRAPPERS_DEF(int, memcmp, const void *, ptr1, const void *, ptr2,
+ size_t, num);
+HANDLER_WRAPPERS_DEF(void *, memcpy, void *, destination, const void *, source,
+ size_t, num);
#endif /* __LIBDAMEMMANAGE_H__ */
X(CONCAT(PROBE_NAME(memset), _always), memset, GT_ALWAYS_PROBE) \
X(CONCAT(PROBE_NAME(memcmp), _always), memcmp, GT_ALWAYS_PROBE) \
X(CONCAT(PROBE_NAME(memcpy), _always), memcpy, GT_ALWAYS_PROBE) \
- X(CONCAT(PROBE_NAME(posix_memalign), _always), posix_memalign, GT_ALWAYS_PROBE) \
+ X(CONCAT(PROBE_NAME(posix_memalign), _always), posix_memalign, \
+ GT_ALWAYS_PROBE) \
X(CONCAT(PROBE_NAME(strdup), _always), strdup, GT_ALWAYS_PROBE)
/* TODO generate PROBES_LIST with api_names.txt */
}
enum memory_funcs_id_t get_memory_feature_always_id(void *ptr)
- __attribute__((alias("get_memory_feature_id")));
+ __attribute__((alias("get_memory_feature_id")));
#undef X
/* X-macros replaced by structures defenitions */
/* For target binaries probes */
#define X(func_name, orig_name, type) \
- { (ElfW(Addr))& func_name, #orig_name, type, (ElfW(Addr))0 },
+ { (ElfW(Addr))&func_name, #orig_name, type, (ElfW(Addr))0 },
static struct probe_desc_t memory_probes[] = {
PROBES_LIST_MEMORY
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
einfo->info.func.new_update_region = NULL;
einfo->info.func.free_update_region = NULL;
- ret = __evas_engine_info_set_p(canvas,(Evas_Engine_Info*)einfo);
+ ret = __evas_engine_info_set_p(canvas, (Evas_Engine_Info*)einfo);
if (unlikely(ret == EINA_FALSE)) {
PRINTERR("could not set evas engine info!");
__evas_free_p(canvas);
width = data->width + padding;
height = data->height;
- t_surface = tbm_surface_create(width, data->height, TBM_FORMAT_XRGB8888);
+ t_surface = tbm_surface_create(width, data->height,
+ TBM_FORMAT_XRGB8888);
if (!t_surface) {
PRINTERR("failed to create tbm_surface\n");
goto fail_tbm_client;
checked4padding = true;
goto wrong_padding;
} else if (ret == -ECANCELED) {
- PRINTERR("Checking for padding failed because of screen is black. Let's check next time.\n");
+ PRINTERR("Checking for padding failed because of "
+ "screen is black. Let's check next time.\n");
} else {
checked4padding = true;
}
pthread_mutex_lock(&(gTraceInfo.screenshot.ssMutex));
old = gTraceInfo.screenshot.state;
- if(gTraceInfo.screenshot.state >= 0)
+ if (gTraceInfo.screenshot.state >= 0)
gTraceInfo.screenshot.state = 1;
pthread_mutex_unlock(&(gTraceInfo.screenshot.ssMutex));
- if(old == 2 && isOptionEnabled(FL_SCREENSHOT, 0))
+ if (old == 2 && isOptionEnabled(FL_SCREENSHOT, 0))
captureScreen();
}
void screenshot_unset(void)
{
pthread_mutex_lock(&(gTraceInfo.screenshot.ssMutex));
- if(gTraceInfo.screenshot.state >= 0)
+ if (gTraceInfo.screenshot.state >= 0)
gTraceInfo.screenshot.state = 0;
pthread_mutex_unlock(&(gTraceInfo.screenshot.ssMutex));
}
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
#define SOCKET_SEND_SIZE 1024
#define NO_TOTAL_INFO (NULL)
-#define POST_PROBEBLOCK_MIDDLE_LIBC_SOCK(OBJECTPTR, FDVALUE, APITYPE, TOTAL_INFO) \
- do { \
- BUF_PTR = pack_int64(BUF_PTR, (uintptr_t)OBJECTPTR); \
- BUF_PTR = pack_int64(BUF_PTR, FDVALUE); \
- BUF_PTR = pack_int32(BUF_PTR, APITYPE); \
- struct sockaddr *tmp_dest = ((struct sockaddr *)TOTAL_INFO.sock); \
- if ( tmp_dest != NO_TOTAL_INFO) { \
- switch (tmp_dest->sa_family) { \
- case AF_INET:\
- BUF_PTR = pack_int32(BUF_PTR, ((struct sockaddr_in *)tmp_dest)->sin_addr.s_addr ); \
- BUF_PTR = pack_int32(BUF_PTR, ntohs(((struct sockaddr_in *)tmp_dest)->sin_port ) ); \
- break;\
- /*case AF_INET6:\
- BUF_PTR = pack_int32(BUF_PTR, ((struct sockaddr_in6 *)tmp_dest)->sin6_addr.s6_addr32 ); \
- BUF_PTR = pack_int32(BUF_PTR, ((struct sockaddr_in6 *)tmp_dest)->sin6_port ); \
- break;*/ \
- default:\
- BUF_PTR = pack_int32(BUF_PTR, (uint32_t) 0); \
- BUF_PTR = pack_int32(BUF_PTR, (uint32_t) 0); \
- break; \
- } \
- } else { \
- BUF_PTR = pack_int32(BUF_PTR, (uint32_t) 0); \
- BUF_PTR = pack_int32(BUF_PTR, (uint32_t) 0); \
- }; \
- BUF_PTR = pack_int64(BUF_PTR, TOTAL_INFO.msg_total_size); \
- BUF_PTR = pack_bin(BUF_PTR, TOTAL_INFO.msg_buf, TOTAL_INFO.msg_pack_size); \
- } while (0)
+#define POST_PROBEBLOCK_MIDDLE_LIBC_SOCK(OBJECTPTR, FDVALUE, APITYPE, \
+ TOTAL_INFO) \
+do { \
+ BUF_PTR = pack_int64(BUF_PTR, (uintptr_t)OBJECTPTR); \
+ BUF_PTR = pack_int64(BUF_PTR, FDVALUE); \
+ BUF_PTR = pack_int32(BUF_PTR, APITYPE); \
+ struct sockaddr *tmp_dest = \
+ ((struct sockaddr *)TOTAL_INFO.sock); \
+ if ( tmp_dest != NO_TOTAL_INFO) { \
+ switch (tmp_dest->sa_family) { \
+ case AF_INET: \
+ { \
+ struct sockaddr_in *tmp_in = \
+ (struct sockaddr_in *)tmp_dest; \
+ BUF_PTR = pack_int32(BUF_PTR, \
+ tmp_in->sin_addr.s_addr); \
+ BUF_PTR = pack_int32(BUF_PTR, \
+ ntohs(tmp_in->sin_port)); \
+ break; \
+ } \
+ default: \
+ BUF_PTR = pack_int32(BUF_PTR, (uint32_t) 0); \
+ BUF_PTR = pack_int32(BUF_PTR, (uint32_t) 0); \
+ break; \
+ } \
+ } else { \
+ BUF_PTR = pack_int32(BUF_PTR, (uint32_t) 0); \
+ BUF_PTR = pack_int32(BUF_PTR, (uint32_t) 0); \
+ }; \
+ BUF_PTR = pack_int64(BUF_PTR, TOTAL_INFO.msg_total_size); \
+ BUF_PTR = pack_bin(BUF_PTR, TOTAL_INFO.msg_buf, \
+ TOTAL_INFO.msg_pack_size); \
+} while (0)
//lib Common Function
-#define AFTER_ORIGINAL_LIBC_SOCK(RTYPE, RVAL, OBJECTPTR, FDVALUE, APITYPE, TOTAL_INFO, INPUTFORMAT, ...) \
- POST_PROBEBLOCK_BEGIN(LC_SOCKET, RTYPE, RVAL, probe_data, INPUTFORMAT, __VA_ARGS__); \
- POST_PROBEBLOCK_MIDDLE_LIBC_SOCK(OBJECTPTR, FDVALUE, APITYPE, TOTAL_INFO ); \
+#define AFTER_ORIGINAL_LIBC_SOCK(RTYPE, RVAL, OBJECTPTR, FDVALUE, APITYPE, \
+ TOTAL_INFO, INPUTFORMAT, ...) \
+ POST_PROBEBLOCK_BEGIN(LC_SOCKET, RTYPE, RVAL, probe_data, \
+ INPUTFORMAT, __VA_ARGS__); \
+ POST_PROBEBLOCK_MIDDLE_LIBC_SOCK(OBJECTPTR, FDVALUE, APITYPE, \
+ TOTAL_INFO); \
POST_PROBEBLOCK_END();
//lib START Function
-#define AFTER_ORIGINAL_LIBC_SOCK_WAIT_FUNC_START(RTYPE, RVAL,OBJECTPTR, FDVALUE, APITYPE, TOTAL_INFO, INPUTFORMAT, ...) \
- POST_PROBEBLOCK_FUNC_START_BEGIN(LC_SOCKET, RTYPE, RVAL, INPUTFORMAT, __VA_ARGS__); \
- POST_PROBEBLOCK_MIDDLE_LIBC_SOCK(OBJECTPTR, FDVALUE, APITYPE, TOTAL_INFO ); \
- FLUSH_LOCAL_BUF(); \
+#define AFTER_ORIGINAL_LIBC_SOCK_WAIT_FUNC_START(RTYPE, RVAL, OBJECTPTR, \
+ FDVALUE, APITYPE, TOTAL_INFO, \
+ INPUTFORMAT, ...) \
+ POST_PROBEBLOCK_FUNC_START_BEGIN(LC_SOCKET, RTYPE, RVAL, INPUTFORMAT, \
+ __VA_ARGS__); \
+ POST_PROBEBLOCK_MIDDLE_LIBC_SOCK(OBJECTPTR, FDVALUE, APITYPE, \
+ TOTAL_INFO); \
+ FLUSH_LOCAL_BUF(); \
POST_PROBEBLOCK_FUNC_START_END()
-#define POST_PROBEBLOCK_FUNC_START_BEGIN(LCTYPE, RTYPE, RETVALUE, INPUTFORMAT, ...) \
- newerrno = errno; \
- do { \
- PREPARE_LOCAL_BUF(); \
- PACK_COMMON_BEGIN(MSG_PROBE_NETWORK, vAPI_ID, INPUTFORMAT, __VA_ARGS__);\
- PACK_COMMON_END(RTYPE, RETVALUE, errno, probe_data)
+#define POST_PROBEBLOCK_FUNC_START_BEGIN(LCTYPE, RTYPE, RETVALUE, \
+ INPUTFORMAT, ...) \
+ newerrno = errno; \
+ do { \
+ PREPARE_LOCAL_BUF(); \
+ PACK_COMMON_BEGIN(MSG_PROBE_NETWORK, vAPI_ID, INPUTFORMAT, \
+ __VA_ARGS__); \
+ PACK_COMMON_END(RTYPE, RETVALUE, errno, probe_data)
//lib END Function
-#define AFTER_ORIGINAL_LIBC_SOCK_WAIT_FUNC_END(RTYPE, RVAL, OBJECTPTR, FDVALUE, APITYPE, TOTAL_INFO, INPUTFORMAT, ...) \
- POST_PROBEBLOCK_FUNC_END_BEGIN(LC_SOCKET, RTYPE, RVAL, INPUTFORMAT, __VA_ARGS__); \
- POST_PROBEBLOCK_MIDDLE_LIBC_SOCK(OBJECTPTR, FDVALUE, APITYPE, TOTAL_INFO ); \
+#define AFTER_ORIGINAL_LIBC_SOCK_WAIT_FUNC_END(RTYPE, RVAL, OBJECTPTR, FDVALUE,\
+ APITYPE, TOTAL_INFO, \
+ INPUTFORMAT, ...) \
+ POST_PROBEBLOCK_FUNC_END_BEGIN(LC_SOCKET, RTYPE, RVAL, INPUTFORMAT, \
+ __VA_ARGS__); \
+ POST_PROBEBLOCK_MIDDLE_LIBC_SOCK(OBJECTPTR, FDVALUE, APITYPE, \
+ TOTAL_INFO); \
POST_PROBEBLOCK_END()
-#define POST_PROBEBLOCK_FUNC_END_BEGIN(LCTYPE, RTYPE, RETVALUE, INPUTFORMAT, ...) \
- newerrno = errno; \
- do { \
- inc_current_event_index(); \
- PREPARE_LOCAL_BUF(); \
- PACK_COMMON_BEGIN(MSG_PROBE_NETWORK, vAPI_ID, INPUTFORMAT, __VA_ARGS__);\
+#define POST_PROBEBLOCK_FUNC_END_BEGIN(LCTYPE, RTYPE, RETVALUE, \
+ INPUTFORMAT, ...) \
+ newerrno = errno; \
+ do { \
+ inc_current_event_index(); \
+ PREPARE_LOCAL_BUF(); \
+ PACK_COMMON_BEGIN(MSG_PROBE_NETWORK, vAPI_ID, INPUTFORMAT, \
+ __VA_ARGS__); \
PACK_COMMON_END(RTYPE, RETVALUE, errno, probe_data)
-#define POST_PROBEBLOCK_MIDDLE_TIZEN_SOCK(OBJECTPTR, FDVALUE, APITYPE, TOTAL_INFO ) \
- do { \
- BUF_PTR = pack_int64(BUF_PTR, (uintptr_t)OBJECTPTR); \
- BUF_PTR = pack_int64(BUF_PTR, FDVALUE); \
- BUF_PTR = pack_int32(BUF_PTR, APITYPE); \
- BUF_PTR = pack_int32(BUF_PTR, TOTAL_INFO.host_ip); \
- BUF_PTR = pack_int32(BUF_PTR, TOTAL_INFO.host_port); \
- BUF_PTR = pack_int64(BUF_PTR, TOTAL_INFO.msg_total_size); \
- BUF_PTR = pack_bin(BUF_PTR, TOTAL_INFO.msg_buf, \
- TOTAL_INFO.msg_pack_size); \
+#define POST_PROBEBLOCK_MIDDLE_TIZEN_SOCK(OBJECTPTR, FDVALUE, APITYPE, \
+ TOTAL_INFO) \
+ do { \
+ BUF_PTR = pack_int64(BUF_PTR, (uintptr_t)OBJECTPTR); \
+ BUF_PTR = pack_int64(BUF_PTR, FDVALUE); \
+ BUF_PTR = pack_int32(BUF_PTR, APITYPE); \
+ BUF_PTR = pack_int32(BUF_PTR, TOTAL_INFO.host_ip); \
+ BUF_PTR = pack_int32(BUF_PTR, TOTAL_INFO.host_port); \
+ BUF_PTR = pack_int64(BUF_PTR, TOTAL_INFO.msg_total_size); \
+ BUF_PTR = pack_bin(BUF_PTR, TOTAL_INFO.msg_buf, \
+ TOTAL_INFO.msg_pack_size); \
} while (0)
#define BEFORE_ORIGINAL_SOCK(FUNCNAME, LIBNAME) \
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
#define OBJ_DUMMY 0
-void getAddress(const struct sockaddr *sa, char *address) {
+void getAddress(const struct sockaddr *sa, char *address)
+{
char buff[INET6_ADDRSTRLEN];
char *path;
break;
case AF_INET6:
snprintf(address, MAX_PATH_LENGTH, "%s:%d",
- inet_ntop(AF_INET6, &(((struct sockaddr_in6 *) sa)->sin6_addr),
- buff, sizeof(buff)),
- ntohs(((struct sockaddr_in6*) sa)->sin6_port));
+ inet_ntop(AF_INET6,
+ &(((struct sockaddr_in6 *)sa)->sin6_addr),
+ buff, sizeof(buff)),
+ ntohs(((struct sockaddr_in6*) sa)->sin6_port));
break;
case AF_UNIX:
path = ((struct sockaddr_un*)sa)->sun_path;
}
//FD
-HANDLER_WRAPPERS(network_feature, int , socket, int, domain, int, type, int, protocol)
+HANDLER_WRAPPERS(network_feature, int , socket, int, domain, int, type,
+ int, protocol)
{
int (*socketp)(int domain, int type, int protocol);
BEFORE_ORIGINAL_SOCK(socket, LIBC);
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, accept, int, socket, struct sockaddr *, address,
- socklen_t *, address_len)
+HANDLER_WRAPPERS(network_feature, int, accept, int, socket,
+ struct sockaddr *, address, socklen_t *, address_len)
{
int (*acceptp)(int socket, struct sockaddr *address,
socklen_t *address_len);
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, accept4, int, sockfd, struct sockaddr *, addr,
- socklen_t *, addrlen, int, flags)
+HANDLER_WRAPPERS(network_feature, int, accept4, int, sockfd,
+ struct sockaddr *, addr, socklen_t *, addrlen, int, flags)
{
int (*accept4p)(int sockfd, struct sockaddr *addr,
socklen_t *addrlen, int flags);
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, connect, int, socket, const struct sockaddr *, address,
- socklen_t, address_len)
+HANDLER_WRAPPERS(network_feature, int, connect, int, socket,
+ const struct sockaddr *, address, socklen_t, address_len)
{
int (*connectp)(int socket, const struct sockaddr *address,
socklen_t address_len);
char callAddress[MAX_PATH_LENGTH];
getAddress(address, callAddress);
- AFTER_ORIGINAL_LIBC_SOCK('d', ret, OBJ_DUMMY, socket, SOCKET_API_CONNECT,
- info, "dsd",
- socket, callAddress, address_len);
+ AFTER_ORIGINAL_LIBC_SOCK('d', ret, OBJ_DUMMY, socket,
+ SOCKET_API_CONNECT, info, "dsd", socket,
+ callAddress, address_len);
return ret;
}
ret = shutdownp(socket, how);
- AFTER_ORIGINAL_LIBC_SOCK('d', ret, OBJ_DUMMY, socket, SOCKET_API_FD_CLOSE,
- info, "dd", socket, how);
+ AFTER_ORIGINAL_LIBC_SOCK('d', ret, OBJ_DUMMY, socket,
+ SOCKET_API_FD_CLOSE, info, "dd", socket, how);
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, bind, int, socket, const struct sockaddr *, address,
- socklen_t, address_len)
+HANDLER_WRAPPERS(network_feature, int, bind, int, socket,
+ const struct sockaddr *, address, socklen_t, address_len)
{
int (*bindp)(int socket, const struct sockaddr *address,
socklen_t address_len);
return ret;
}
-HANDLER_WRAPPERS(network_feature, ssize_t, send, int, socket, const void *, message,
- size_t, length, int, flags)
+HANDLER_WRAPPERS(network_feature, ssize_t, send, int, socket,
+ const void *, message, size_t, length, int, flags)
{
ssize_t (*sendp)(int socket, const void *message, size_t length,
int flags);
if (result < 0)
result = 0;
info.msg_total_size = (uint64_t)result;
- info.msg_pack_size = result>SOCKET_SEND_SIZE?SOCKET_SEND_SIZE:result;
+ info.msg_pack_size = result > SOCKET_SEND_SIZE ? SOCKET_SEND_SIZE
+ : result;
info.msg_buf = messagP;
AFTER_ORIGINAL_LIBC_SOCK_WAIT_FUNC_END('x', sret, OBJ_DUMMY, socket,
return sret;
}
-HANDLER_WRAPPERS(network_feature, ssize_t, recv, int, socket, void *, buffer, size_t, length,
- int, flags)
+HANDLER_WRAPPERS(network_feature, ssize_t, recv, int, socket, void *, buffer,
+ size_t, length, int, flags)
{
ssize_t (*recvp)(int socket, void *buffer, size_t length, int flags);
ssize_t sret, result;
if (result < 0)
result = 0;
info.msg_total_size = (uint64_t)result;
- info.msg_pack_size = result>SOCKET_SEND_SIZE?SOCKET_SEND_SIZE:result;
+ info.msg_pack_size = result > SOCKET_SEND_SIZE ? SOCKET_SEND_SIZE
+ : result;
info.msg_buf = bufferP;
AFTER_ORIGINAL_LIBC_SOCK_WAIT_FUNC_END('x', sret, OBJ_DUMMY, socket,
return sret;
}
-HANDLER_WRAPPERS(network_feature, ssize_t, sendto, int, socket, const void *, message,
- size_t, length, int, flags, const struct sockaddr *, dest_addr,
- socklen_t, dest_len)
+HANDLER_WRAPPERS(network_feature, ssize_t, sendto, int, socket,
+ const void *, message, size_t, length, int, flags,
+ const struct sockaddr *, dest_addr, socklen_t, dest_len)
{
ssize_t (*sendtop)(int socket, const void *message, size_t length,
- int flags, const struct sockaddr *dest_addr, socklen_t dest_len);
+ int flags, const struct sockaddr *dest_addr,
+ socklen_t dest_len);
ssize_t sret, result;
BEFORE_ORIGINAL_SOCK(sendto, LIBC);
if (result < 0)
result = 0;
info.msg_total_size = (uint64_t)result;
- info.msg_pack_size = result>SOCKET_SEND_SIZE?SOCKET_SEND_SIZE:result;
+ info.msg_pack_size = result > SOCKET_SEND_SIZE ? SOCKET_SEND_SIZE
+ : result;
info.msg_buf = bufferP;
AFTER_ORIGINAL_LIBC_SOCK_WAIT_FUNC_END('x', sret, OBJ_DUMMY, socket,
"dpddpd", socket,
voidp_to_uint64(bufferP),
length, flags,
- voidp_to_uint64(dest_addr), dest_len);
+ voidp_to_uint64(dest_addr),
+ dest_len);
return sret;
}
-HANDLER_WRAPPERS(network_feature, ssize_t, recvfrom, int, socket, void *, buffer, size_t, length,
+HANDLER_WRAPPERS(network_feature, ssize_t, recvfrom, int, socket,
+ void *, buffer, size_t, length,
int, flags, struct sockaddr *, address,
socklen_t *, address_len)
{
ssize_t (*recvfromp)(int socket, void *buffer, size_t length,
- int flags, struct sockaddr *address, socklen_t *address_len);
+ int flags, struct sockaddr *address,
+ socklen_t *address_len);
ssize_t sret, result;
BEFORE_ORIGINAL_SOCK(recvfrom, LIBC);
if (result < 0)
result = 0;
info.msg_total_size = (uint64_t)result;
- info.msg_pack_size = result>SOCKET_SEND_SIZE?SOCKET_SEND_SIZE:result;
+ info.msg_pack_size = result > SOCKET_SEND_SIZE ? SOCKET_SEND_SIZE
+ : result;
info.msg_buf = bufferP;
AFTER_ORIGINAL_LIBC_SOCK_WAIT_FUNC_END('x', sret, OBJ_DUMMY, socket,
return sret;
}
-HANDLER_WRAPPERS(network_feature, ssize_t, recvmsg, int, socket, struct msghdr *,message,
- int, flags)
+HANDLER_WRAPPERS(network_feature, ssize_t, recvmsg, int, socket,
+ struct msghdr *, message, int, flags)
{
ssize_t (*recvmsgp)(int socket, struct msghdr *message, int flags);
ssize_t sret;
return sret;
}
-HANDLER_WRAPPERS(network_feature, ssize_t, sendmsg, int, socket, const struct msghdr *, message,
- int, flags)
+HANDLER_WRAPPERS(network_feature, ssize_t, sendmsg, int, socket,
+ const struct msghdr *, message, int, flags)
{
ssize_t (*sendmsgp)(int socket, const struct msghdr *message,
int flags);
return sret;
}
-HANDLER_WRAPPERS(network_feature, int, getsockopt, int, socket, int, level, int, option_name,
- void *, option_value, socklen_t *, option_len)
+HANDLER_WRAPPERS(network_feature, int, getsockopt, int, socket, int, level,
+ int, option_name, void *, option_value,
+ socklen_t *, option_len)
{
int (*getsockoptp)(int socket, int level, int option_name,
void *option_value, socklen_t *option_len);
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, setsockopt, int, socket, int, level, int, option_name,
- const void *, option_value, socklen_t, option_len)
+HANDLER_WRAPPERS(network_feature, int, setsockopt, int, socket, int, level,
+ int, option_name, const void *, option_value,
+ socklen_t, option_len)
{
int (*setsockoptp)(int socket, int level, int option_name,
const void *option_value, socklen_t option_len);
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, getpeername, int, fd, struct sockaddr *, addr,
- socklen_t *, len)
+HANDLER_WRAPPERS(network_feature, int, getpeername, int, fd,
+ struct sockaddr *, addr, socklen_t *, len)
{
int (*getpeernamep)(int s, struct sockaddr *addr, socklen_t *len);
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, getsockname, int, sockfd, struct sockaddr *, addr,
- socklen_t *, addrlen)
+HANDLER_WRAPPERS(network_feature, int, getsockname, int, sockfd,
+ struct sockaddr *, addr, socklen_t *, addrlen)
{
int (*getsocknamep)(int sockfd, struct sockaddr *addr,
socklen_t *addrlen);
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, socketpair, int, domain, int, type, int, protocol,
- int *, socket_vector)
+HANDLER_WRAPPERS(network_feature, int, socketpair, int, domain, int, type,
+ int, protocol, int *, socket_vector)
{
int (*socketpairp)(int domain, int type, int protocol,
int socket_vector[2]);
AFTER_ORIGINAL_LIBC_SOCK('d', ret, OBJ_DUMMY, socket_vector[0],
SOCKET_API_FD_OPEN, info, "ddddd",
- domain, type, protocol, socket_vector[0], socket_vector[1]);
+ domain, type, protocol, socket_vector[0],
+ socket_vector[1]);
return ret;
}
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, select, int, nfds, fd_set *, readfds, fd_set *, writefds,
- fd_set *, exceptfds, struct timeval *, timeout)
+HANDLER_WRAPPERS(network_feature, int, select, int, nfds, fd_set *, readfds,
+ fd_set *, writefds, fd_set *, exceptfds,
+ struct timeval *, timeout)
{
int (*selectp)(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout);
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, pselect, int, nfds, fd_set *, readfds, fd_set *, writefds,
- fd_set *, exceptfds, const struct timespec *, ntimeout,
- const sigset_t *, sigmask)
+HANDLER_WRAPPERS(network_feature, int, pselect, int, nfds, fd_set *, readfds,
+ fd_set *, writefds, fd_set *, exceptfds,
+ const struct timespec *, ntimeout, const sigset_t *, sigmask)
{
int (*pselectp)(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, const struct timespec *ntimeout,
AFTER_ORIGINAL_LIBC_SOCK_WAIT_FUNC_START('d', NULL, OBJ_DUMMY, 0,
SOCKET_API_EVENT_START, info,
- "dppppp",nfds,
+ "dppppp", nfds,
voidp_to_uint64(readfds),
voidp_to_uint64(writefds),
voidp_to_uint64(exceptfds),
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, poll, struct pollfd *, fds, nfds_t, nfds, int, timeout)
+HANDLER_WRAPPERS(network_feature, int, poll, struct pollfd *, fds, nfds_t, nfds,
+ int, timeout)
{
int (*pollp)(struct pollfd *ufds, unsigned int nfds, int timeout);
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, ppoll, struct pollfd *, fds, nfds_t, nfds,
- const struct timespec *, timeout_ts, const sigset_t *,sigmask)
+HANDLER_WRAPPERS(network_feature, int, ppoll, struct pollfd *, fds,
+ nfds_t, nfds, const struct timespec *, timeout_ts,
+ const sigset_t *, sigmask)
{
int (*ppollp)(struct pollfd *fds, nfds_t nfds,
- const struct timespec *timeout_ts, const sigset_t *sigmask);
+ const struct timespec *timeout_ts,
+ const sigset_t *sigmask);
BEFORE_ORIGINAL_SOCK(ppoll, LIBC);
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, epoll_wait, int, __epfd, struct epoll_event *, __events,
- int, __maxevents, int, __timeout)
+HANDLER_WRAPPERS(network_feature, int, epoll_wait, int, __epfd,
+ struct epoll_event *, __events, int, __maxevents,
+ int, __timeout)
{
int (*epoll_waitp)(int __epfd, struct epoll_event *__events,
int __maxevents, int __timeout);
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, epoll_pwait, int, __epfd, struct epoll_event *, __events,
- int, __maxevents, int, __timeout, __const __sigset_t *, __ss)
+HANDLER_WRAPPERS(network_feature, int, epoll_pwait, int, __epfd,
+ struct epoll_event *, __events, int, __maxevents,
+ int, __timeout, __const __sigset_t *, __ss)
{
int (*epoll_pwaitp)(int __epfd, struct epoll_event *__events,
- int __maxevents, int __timeout, __const __sigset_t *__ss);
+ int __maxevents, int __timeout,
+ __const __sigset_t *__ss);
BEFORE_ORIGINAL_SOCK(epoll_pwait, LIBC);
AFTER_ORIGINAL_LIBC_SOCK_WAIT_FUNC_START('d', NULL, OBJ_DUMMY, __epfd,
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, epoll_ctl, int, __epfd, int, __op, int, __fd,
- struct epoll_event *, __event)
+HANDLER_WRAPPERS(network_feature, int, epoll_ctl, int, __epfd, int, __op,
+ int, __fd, struct epoll_event *, __event)
{
int (*epoll_ctlp)(int __epfd, int __op, int __fd,
struct epoll_event *__event);
uret = htonsp(hostshort);
- AFTER_ORIGINAL_LIBC_SOCK('d', (uint32_t)uret, OBJ_DUMMY, 0, SOCKET_API_OTHER,
- info, "d", hostshort);
+ AFTER_ORIGINAL_LIBC_SOCK('d', (uint32_t)uret, OBJ_DUMMY, 0,
+ SOCKET_API_OTHER, info, "d", hostshort);
return uret;
}
-HANDLER_WRAPPERS(network_feature, int , inet_aton, const char *, cp, struct in_addr *, inp)
+HANDLER_WRAPPERS(network_feature, int , inet_aton, const char *, cp,
+ struct in_addr *, inp)
{
static int (*inet_atonp)(const char *cp, struct in_addr *inp);
uret = ntohsp(netshort);
- AFTER_ORIGINAL_LIBC_SOCK('d', (uint32_t)uret, OBJ_DUMMY, 0, SOCKET_API_OTHER,
- info, "d", netshort);
+ AFTER_ORIGINAL_LIBC_SOCK('d', (uint32_t)uret, OBJ_DUMMY, 0,
+ SOCKET_API_OTHER, info, "d", netshort);
return uret;
}
return iret;
}
-HANDLER_WRAPPERS(network_feature, const char *, inet_ntop, int, af, const void *, src,
- char *, dst, socklen_t, size)
+HANDLER_WRAPPERS(network_feature, const char *, inet_ntop, int, af,
+ const void *, src, char *, dst, socklen_t, size)
{
static const char* (*inet_ntopp)(int af, const void *src, char *dst,
socklen_t size);
cret = inet_ntopp(af, src, dst, size);
AFTER_ORIGINAL_LIBC_SOCK(cret, OBJ_DUMMY, 0, SOCKET_API_OTHER,
- info, "dppd", af, voidp_to_uint64(src), voidp_to_uint64(dst), size);
+ info, "dppd", af, voidp_to_uint64(src),
+ voidp_to_uint64(dst), size);
return cret;
}
-HANDLER_WRAPPERS(network_feature, int , inet_pton, int, af, const char *, src, void *, dst)
+HANDLER_WRAPPERS(network_feature, int , inet_pton, int, af, const char *, src,
+ void *, dst)
{
static int (*inet_ptonp)(int af, const char *src, void *dst);
ret = inet_ptonp(af, src, dst);
AFTER_ORIGINAL_LIBC_SOCK('d', ret, OBJ_DUMMY, 0, SOCKET_API_OTHER,
- info, "dpp", af, voidp_to_uint64(src), voidp_to_uint64(dst));
+ info, "dpp", af, voidp_to_uint64(src),
+ voidp_to_uint64(dst));
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, getaddrinfo, const char *, node, const char *, service,
- const struct addrinfo *, hints, struct addrinfo **, res)
+HANDLER_WRAPPERS(network_feature, int, getaddrinfo, const char *, node,
+ const char *, service, const struct addrinfo *, hints,
+ struct addrinfo **, res)
{
static int (*getaddrinfop)(const char *node, const char *service,
const struct addrinfo *hints, struct addrinfo **res);
ret = getaddrinfop(node, service, hints, res);
AFTER_ORIGINAL_LIBC_SOCK('d', ret, OBJ_DUMMY, 0, SOCKET_API_OTHER,
- info, "pppp", voidp_to_uint64(node), voidp_to_uint64(service), voidp_to_uint64(hints), voidp_to_uint64(res));
+ info, "pppp", voidp_to_uint64(node),
+ voidp_to_uint64(service),
+ voidp_to_uint64(hints), voidp_to_uint64(res));
return ret;
}
return cret;
}
-HANDLER_WRAPPERS(network_feature, int, gai_suspend, const struct gaicb** const, list,
- int, nitems, const struct timespec *, timeout)
+HANDLER_WRAPPERS(network_feature, int, gai_suspend,
+ const struct gaicb** const, list, int, nitems,
+ const struct timespec *, timeout)
{
static int (*gai_suspendp)(const struct gaicb* const list[], int nitems,
const struct timespec *timeout);
ret = gai_suspendp(list, nitems, timeout);
AFTER_ORIGINAL_LIBC_SOCK('d', ret, OBJ_DUMMY, 0, SOCKET_API_OTHER,
- info, "pdp", voidp_to_uint64(list), nitems, voidp_to_uint64(timeout));
+ info, "pdp", voidp_to_uint64(list), nitems,
+ voidp_to_uint64(timeout));
return ret;
}
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, getaddrinfo_a, int, mode, struct gaicb **, list,
- int, nitems, struct sigevent *, sevp)
+HANDLER_WRAPPERS(network_feature, int, getaddrinfo_a, int, mode,
+ struct gaicb **, list, int, nitems, struct sigevent *, sevp)
{
static int (*getaddrinfo_ap)(int mode, struct gaicb *list[], int nitems,
struct sigevent *sevp);
ret = getaddrinfo_ap(mode, list, nitems, sevp);
AFTER_ORIGINAL_LIBC_SOCK('d', ret, OBJ_DUMMY, 0, SOCKET_API_OTHER,
- info, "dpdp", mode, voidp_to_uint64(list), nitems, voidp_to_uint64(sevp));
+ info, "dpdp", mode, voidp_to_uint64(list),
+ nitems, voidp_to_uint64(sevp));
return ret;
}
-HANDLER_WRAPPERS(network_feature, int , getdomainname, char *, name, size_t, len)
+HANDLER_WRAPPERS(network_feature, int , getdomainname, char *, name,
+ size_t, len)
{
static int (*getdomainnamep)(char *name, size_t len);
return ret;
}
-HANDLER_WRAPPERS(network_feature, int , setdomainname, const char *, name, size_t, len)
+HANDLER_WRAPPERS(network_feature, int , setdomainname, const char *, name,
+ size_t, len)
{
static int (*setdomainnamep)(const char *name, size_t len);
return ret;
}
-HANDLER_WRAPPERS(network_feature, int , sethostname, const char *, name, size_t, len)
+HANDLER_WRAPPERS(network_feature, int , sethostname, const char *, name,
+ size_t, len)
{
static int (*sethostnamep)(const char *name, size_t len);
char *, serv, socklen_t, servlen, unsigned int, flags)
{
static int (*getnameinfop)(const struct sockaddr *sa, socklen_t salen,
- char *host, socklen_t hostlen, char *serv, socklen_t servlen,
- unsigned int flags);
+ char *host, socklen_t hostlen, char *serv,
+ socklen_t servlen, unsigned int flags);
BEFORE_ORIGINAL_SOCK(getnameinfo, LIBC);
return ret;
}
-HANDLER_WRAPPERS(network_feature, struct hostent *, gethostbyname, const char *, name)
+HANDLER_WRAPPERS(network_feature, struct hostent *, gethostbyname,
+ const char *, name)
{
static struct hostent * (*gethostbynamep)(const char *name);
struct hostent* pret;
return pret;
}
-HANDLER_WRAPPERS(network_feature, struct hostent *, gethostbyaddr, const void *, addr,
- socklen_t, len, int, type)
+HANDLER_WRAPPERS(network_feature, struct hostent *, gethostbyaddr,
+ const void *, addr, socklen_t, len, int, type)
{
- static struct hostent * (*gethostbyaddrp)(const void *addr, socklen_t len,
- int type);
+ static struct hostent * (*gethostbyaddrp)(const void *addr,
+ socklen_t len, int type);
struct hostent* pret;
BEFORE_ORIGINAL_SOCK(gethostbyaddr, LIBC);
return pret;
}
-HANDLER_WRAPPERS(network_feature, struct hostent *, gethostbyname2, const char *, name, int, af)
+HANDLER_WRAPPERS(network_feature, struct hostent *, gethostbyname2,
+ const char *, name, int, af)
{
static struct hostent * (*gethostbyname2p)(const char *name, int af);
struct hostent* pret;
return pret;
}
-HANDLER_WRAPPERS(network_feature, int, gethostent_r, struct hostent *, rret, char *, buf,
- size_t, buflen, struct hostent **, result, int *, h_errnop)
+HANDLER_WRAPPERS(network_feature, int, gethostent_r, struct hostent *, rret,
+ char *, buf, size_t, buflen, struct hostent **, result,
+ int *, h_errnop)
{
- static int (*gethostent_rp)(struct hostent *rret, char *buf, size_t buflen,
- struct hostent **result, int *h_errnop);
+ static int (*gethostent_rp)(struct hostent *rret, char *buf,
+ size_t buflen, struct hostent **result,
+ int *h_errnop);
BEFORE_ORIGINAL_SOCK(gethostent_r, LIBC);
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, gethostbyaddr_r, const void *, addr, socklen_t, len,
- int, type, struct hostent *, rret, char *, buf, size_t, buflen,
- struct hostent **, result, int *, h_errnop)
+HANDLER_WRAPPERS(network_feature, int, gethostbyaddr_r, const void *, addr,
+ socklen_t, len, int, type, struct hostent *, rret, char *, buf,
+ size_t, buflen, struct hostent **, result, int *, h_errnop)
{
- static int (*gethostbyaddr_rp)(const void *addr, socklen_t len, int type,
- struct hostent *rret, char *buf, size_t buflen,
- struct hostent **result, int *h_errnop);
+ static int (*gethostbyaddr_rp)(const void *addr, socklen_t len,
+ int type, struct hostent *rret,
+ char *buf, size_t buflen,
+ struct hostent **result, int *h_errnop);
BEFORE_ORIGINAL_SOCK(gethostbyaddr_r, LIBC);
struct hostent **, result, int *, h_errnop)
{
static int (*gethostbyname_rp)(const char *name, struct hostent *rret,
- char *buf, size_t buflen, struct hostent **result, int *h_errnop);
+ char *buf, size_t buflen, struct hostent **result,
+ int *h_errnop);
BEFORE_ORIGINAL_SOCK(gethostbyname_r, LIBC);
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, gethostbyname2_r, const char *, name, int, af,
- struct hostent *, rret, char *, buf, size_t, buflen,
+HANDLER_WRAPPERS(network_feature, int, gethostbyname2_r, const char *, name,
+ int, af, struct hostent *, rret, char *, buf, size_t, buflen,
struct hostent **, result, int *, h_errnop)
{
static int (*gethostbyname2_rp)(const char *name, int af,
return ret;
}
-HANDLER_WRAPPERS(network_feature, struct servent *, getservbyname, const char *, name,
- const char *, proto)
+HANDLER_WRAPPERS(network_feature, struct servent *, getservbyname,
+ const char *, name, const char *, proto)
{
static struct servent * (*getservbynamep)(const char *name,
const char *proto);
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, getservbyname_r, const char *, name, const char *, proto,
- struct servent *, result_buf, char *, buf, size_t, buflen,
- struct servent **, result)
+HANDLER_WRAPPERS(network_feature, int, getservbyname_r, const char *, name,
+ const char *, proto, struct servent *, result_buf, char *, buf,
+ size_t, buflen, struct servent **, result)
{
static int (*getservbyname_rp)(const char *name, const char *proto,
struct servent *result_buf, char *buf, size_t buflen,
return ret;
}
-HANDLER_WRAPPERS(network_feature, int, getservbyport_r, int, port, const char *, proto,
- struct servent *, result_buf, char *, buf, size_t, buflen,
- struct servent **, result)
+HANDLER_WRAPPERS(network_feature, int, getservbyport_r, int, port,
+ const char *, proto, struct servent *, result_buf, char *, buf,
+ size_t, buflen, struct servent **, result)
{
static int (*getservbyport_rp)(int port, const char *proto,
struct servent *result_buf, char *buf, size_t buflen,
return pret;
}
-HANDLER_WRAPPERS(network_feature, struct netent *, getnetbyname, const char *, name)
+HANDLER_WRAPPERS(network_feature, struct netent *, getnetbyname,
+ const char *, name)
{
static struct netent * (*getnetbynamep)(const char *name);
struct netent* pret;
return pret;
}
-HANDLER_WRAPPERS(network_feature, struct netent *, getnetbyaddr, uint32_t, net, int, type)
+HANDLER_WRAPPERS(network_feature, struct netent *, getnetbyaddr, uint32_t, net,
+ int, type)
{
static struct netent * (*getnetbyaddrp)(uint32_t net, int type);
struct netent * pret;
info, "s", "");
}
-HANDLER_WRAPPERS(network_feature, int, getnetent_r, struct netent *, result_buf, char *, buf,
- size_t, buflen, struct netent **, result, int *, h_errnop)
+HANDLER_WRAPPERS(network_feature, int, getnetent_r, struct netent *, result_buf,
+ char *, buf, size_t, buflen, struct netent **, result,
+ int *, h_errnop)
{
static int (*getnetent_rp)(struct netent *result_buf, char *buf,
size_t buflen, struct netent **result, int *h_errnop);
struct netent *, result_buf, char *, buf, size_t, buflen,
struct netent **, result, int *, h_errnop)
{
- static int (*getnetbyname_rp)(const char *name, struct netent *result_buf,
- char *buf, size_t buflen, struct netent **result, int *h_errnop);
+ static int (*getnetbyname_rp)(const char *name,
+ struct netent *result_buf, char *buf,
+ size_t buflen, struct netent **result,
+ int *h_errnop);
BEFORE_ORIGINAL_SOCK(getnetbyname_r, LIBC);
BEFORE_ORIGINAL_SOCK(getnetbyaddr_r, LIBC);
- ret = getnetbyaddr_rp(net, type, result_buf, buf, buflen, result, h_errnop);
+ ret = getnetbyaddr_rp(net, type, result_buf, buf, buflen, result,
+ h_errnop);
AFTER_ORIGINAL_LIBC_SOCK('d', ret, OBJ_DUMMY, 0, SOCKET_API_OTHER,
info, "ddppdpp", net, type,
return pret;
}
-HANDLER_WRAPPERS(network_feature, struct protoent *, getprotobyname, const char *, name)
+HANDLER_WRAPPERS(network_feature, struct protoent *, getprotobyname,
+ const char *, name)
{
static struct protoent * (*getprotobynamep)(const char *name);
struct protoent * pret;
return pret;
}
-HANDLER_WRAPPERS(network_feature, struct protoent *, getprotobynumber, int, proto)
+HANDLER_WRAPPERS(network_feature, struct protoent *, getprotobynumber,
+ int, proto)
{
static struct protoent * (*getprotobynumberp)(int proto);
struct protoent * pret;
info, "s", "");
}
-HANDLER_WRAPPERS(network_feature, int, getprotoent_r, struct protoent *, result_buf, char *, buf,
+HANDLER_WRAPPERS(network_feature, int, getprotoent_r,
+ struct protoent *, result_buf, char *, buf,
size_t, buflen, struct protoent **, result)
{
static int (*getprotoent_rp)(struct protoent *result_buf, char *buf,
struct protoent *, result_buf, char *, buf, size_t, buflen,
struct protoent **, result)
{
- static int (*getprotobynumber_rp)(int proto, struct protoent *result_buf,
- char *buf, size_t buflen, struct protoent **result);
+ static int (*getprotobynumber_rp)(int proto,
+ struct protoent *result_buf,
+ char *buf, size_t buflen,
+ struct protoent **result);
BEFORE_ORIGINAL_SOCK(getprotobynumber_r, LIBC);
return ret;
}
-HANDLER_WRAPPERS(network_feature, unsigned int , if_nametoindex, __const char *, __ifname)
+HANDLER_WRAPPERS(network_feature, unsigned int , if_nametoindex,
+ __const char *, __ifname)
{
static unsigned int (*if_nametoindexp)(__const char *__ifname);
unsigned int uret;
return uret;
}
-HANDLER_WRAPPERS(network_feature, char *, if_indextoname, unsigned int, __ifindex,
- char *, __ifname)
+HANDLER_WRAPPERS(network_feature, char *, if_indextoname,
+ unsigned int, __ifindex, char *, __ifname)
{
- static char * (*if_indextonamep)(unsigned int __ifindex, char *__ifname);
+ static char * (*if_indextonamep)(unsigned int __ifindex,
+ char *__ifname);
char * cret;
BEFORE_ORIGINAL_SOCK(if_indextoname, LIBC);
return uret;
}
-HANDLER_WRAPPERS(network_feature, uint16_t , be16toh, uint16_t, big_endian_16bits)
+HANDLER_WRAPPERS(network_feature, uint16_t , be16toh,
+ uint16_t, big_endian_16bits)
{
static uint16_t (*be16tohp)(uint16_t big_endian_16bits);
uint16_t uret;
return uret;
}
-HANDLER_WRAPPERS(network_feature, uint16_t , le16toh, uint16_t, little_endian_16bits)
+HANDLER_WRAPPERS(network_feature, uint16_t , le16toh,
+ uint16_t, little_endian_16bits)
{
static uint16_t (*le16tohp)(uint16_t little_endian_16bits);
uint16_t uret;
return uret;
}
-HANDLER_WRAPPERS(network_feature, uint32_t , be32toh, uint32_t, big_endian_32bits)
+HANDLER_WRAPPERS(network_feature, uint32_t , be32toh,
+ uint32_t, big_endian_32bits)
{
static uint32_t (*be32tohp)(uint32_t big_endian_32bits);
uint32_t uret;
return uret;
}
-HANDLER_WRAPPERS(network_feature, uint32_t , le32toh, uint32_t, little_endian_32bits)
+HANDLER_WRAPPERS(network_feature, uint32_t , le32toh,
+ uint32_t, little_endian_32bits)
{
static uint32_t (*le32tohp)(uint32_t little_endian_32bits);
uint32_t uret;
return uret;
}
-HANDLER_WRAPPERS(network_feature, uint64_t , be64toh, uint64_t, big_endian_64bits)
+HANDLER_WRAPPERS(network_feature, uint64_t , be64toh,
+ uint64_t, big_endian_64bits)
{
static uint64_t (*be64tohp)(uint64_t big_endian_64bits);
uint64_t uret;
return uret;
}
-HANDLER_WRAPPERS(network_feature, uint64_t , le64toh, uint64_t, little_endian_64bits)
+HANDLER_WRAPPERS(network_feature, uint64_t , le64toh,
+ uint64_t, little_endian_64bits)
{
static uint64_t (*le64tohp)(uint64_t little_endian_64bits);
uint64_t uret;
return uret;
}
-HANDLER_WRAPPERS(network_feature, struct in_addr , inet_makeaddr, int, net, int, host)
+HANDLER_WRAPPERS(network_feature, struct in_addr , inet_makeaddr, int, net,
+ int, host)
{
static struct in_addr (*inet_makeaddrp)(int net, int host);
struct in_addr iret;
BEFORE_ORIGINAL_SOCK(inet_makeaddr, LIBC);
- iret = inet_makeaddrp(net,host);
+ iret = inet_makeaddrp(net, host);
AFTER_ORIGINAL_NOSOCK_RET('d', iret.s_addr, 0, FD_API_OTHER,
"dd", net, host);
#define __LIBDASOCKET_H__
HANDLER_WRAPPERS_DEF(int, socket, int, domain, int, type, int, protocol);
-HANDLER_WRAPPERS_DEF(int, accept, int, socket, struct sockaddr *, address, socklen_t *, address_len);
-HANDLER_WRAPPERS_DEF(int, accept4, int, sockfd, struct sockaddr *, addr, socklen_t *, addrlen, int, flags);
-HANDLER_WRAPPERS_DEF(int, connect, int, socket, const struct sockaddr *, address, socklen_t, address_len);
+HANDLER_WRAPPERS_DEF(int, accept, int, socket, struct sockaddr *, address,
+ socklen_t *, address_len);
+HANDLER_WRAPPERS_DEF(int, accept4, int, sockfd, struct sockaddr *, addr,
+ socklen_t *, addrlen, int, flags);
+HANDLER_WRAPPERS_DEF(int, connect, int, socket,
+ const struct sockaddr *, address, socklen_t, address_len);
HANDLER_WRAPPERS_DEF(int, shutdown, int, socket, int, how);
-HANDLER_WRAPPERS_DEF(int, bind, int, socket, const struct sockaddr *, address, socklen_t, address_len);
+HANDLER_WRAPPERS_DEF(int, bind, int, socket, const struct sockaddr *, address,
+ socklen_t, address_len);
HANDLER_WRAPPERS_DEF(int, listen, int, socket, int, backlog);
-HANDLER_WRAPPERS_DEF(ssize_t, send, int, socket, const void *, message, size_t, length, int, flags);
-HANDLER_WRAPPERS_DEF(ssize_t, recv, int, socket, void *, buffer, size_t, length, int, flags);
-HANDLER_WRAPPERS_DEF(ssize_t, sendto, int, socket, const void *, message, size_t, length, int, flags, const struct sockaddr *, dest_addr, socklen_t, dest_len);
-HANDLER_WRAPPERS_DEF(ssize_t, recvfrom, int, socket, void *, buffer, size_t, length, int, flags, struct sockaddr *, address, socklen_t *, address_len);
-HANDLER_WRAPPERS_DEF(ssize_t, recvmsg, int, socket, struct msghdr *, message, int, flags);
-HANDLER_WRAPPERS_DEF(ssize_t, sendmsg, int, socket, const struct msghdr *, message, int, flags);
-HANDLER_WRAPPERS_DEF(int, getsockopt, int, socket, int, level, int, option_name, void *, option_value, socklen_t *, option_len);
-HANDLER_WRAPPERS_DEF(int, setsockopt, int, socket, int, level, int, option_name, const void *, option_value, socklen_t, option_len);
-HANDLER_WRAPPERS_DEF(int, getpeername, int, fd, struct sockaddr *, addr, socklen_t *, len);
-HANDLER_WRAPPERS_DEF(int, getsockname, int, sockfd, struct sockaddr *, addr, socklen_t *, addrlen);
-HANDLER_WRAPPERS_DEF(int, socketpair, int, domain, int, type, int, protocol, int *, socket_vector);
+HANDLER_WRAPPERS_DEF(ssize_t, send, int, socket, const void *, message,
+ size_t, length, int, flags);
+HANDLER_WRAPPERS_DEF(ssize_t, recv, int, socket, void *, buffer, size_t, length,
+ int, flags);
+HANDLER_WRAPPERS_DEF(ssize_t, sendto, int, socket, const void *, message,
+ size_t, length, int, flags,
+ const struct sockaddr *, dest_addr, socklen_t, dest_len);
+HANDLER_WRAPPERS_DEF(ssize_t, recvfrom, int, socket, void *, buffer,
+ size_t, length, int, flags, struct sockaddr *, address,
+ socklen_t *, address_len);
+HANDLER_WRAPPERS_DEF(ssize_t, recvmsg, int, socket, struct msghdr *, message,
+ int, flags);
+HANDLER_WRAPPERS_DEF(ssize_t, sendmsg, int, socket,
+ const struct msghdr *, message, int, flags);
+HANDLER_WRAPPERS_DEF(int, getsockopt, int, socket, int, level, int, option_name,
+ void *, option_value, socklen_t *, option_len);
+HANDLER_WRAPPERS_DEF(int, setsockopt, int, socket, int, level, int, option_name,
+ const void *, option_value, socklen_t, option_len);
+HANDLER_WRAPPERS_DEF(int, getpeername, int, fd, struct sockaddr *, addr,
+ socklen_t *, len);
+HANDLER_WRAPPERS_DEF(int, getsockname, int, sockfd, struct sockaddr *, addr,
+ socklen_t *, addrlen);
+HANDLER_WRAPPERS_DEF(int, socketpair, int, domain, int, type, int, protocol,
+ int *, socket_vector);
HANDLER_WRAPPERS_DEF(int, sockatmark, int, __fd);
HANDLER_WRAPPERS_DEF(int, isfdtype, int, __fd, int, __fdtype);
-HANDLER_WRAPPERS_DEF(int, select, int, nfds, fd_set *, readfds, fd_set *, writefds, fd_set *, exceptfds, struct timeval *, timeout);
-HANDLER_WRAPPERS_DEF(int, pselect, int, nfds, fd_set *, readfds, fd_set *, writefds, fd_set *, exceptfds, const struct timespec *, ntimeout, const sigset_t *, sigmask);
-HANDLER_WRAPPERS_DEF(int, poll, struct pollfd *, fds, nfds_t, nfds, int, timeout);
-HANDLER_WRAPPERS_DEF(int, ppoll, struct pollfd *, fds, nfds_t, nfds, const struct timespec *, timeout_ts, const sigset_t *, sigmask);
+HANDLER_WRAPPERS_DEF(int, select, int, nfds, fd_set *, readfds,
+ fd_set *, writefds, fd_set *, exceptfds,
+ struct timeval *, timeout);
+HANDLER_WRAPPERS_DEF(int, pselect, int, nfds, fd_set *, readfds,
+ fd_set *, writefds, fd_set *, exceptfds,
+ const struct timespec *, ntimeout,
+ const sigset_t *, sigmask);
+HANDLER_WRAPPERS_DEF(int, poll, struct pollfd *, fds, nfds_t, nfds,
+ int, timeout);
+HANDLER_WRAPPERS_DEF(int, ppoll, struct pollfd *, fds, nfds_t, nfds,
+ const struct timespec *, timeout_ts,
+ const sigset_t *, sigmask);
HANDLER_WRAPPERS_DEF(int, epoll_create, int, __size);
HANDLER_WRAPPERS_DEF(int, epoll_create1, int, __flags);
-HANDLER_WRAPPERS_DEF(int, epoll_wait, int, __epfd, struct epoll_event *, __events, int, __maxevents, int, __timeout);
-HANDLER_WRAPPERS_DEF(int, epoll_pwait, int, __epfd, struct epoll_event *, __events, int, __maxevents, int, __timeout, __const __sigset_t *, __ss);
-HANDLER_WRAPPERS_DEF(int, epoll_ctl, int, __epfd, int, __op, int, __fd, struct epoll_event *, __event);
+HANDLER_WRAPPERS_DEF(int, epoll_wait, int, __epfd,
+ struct epoll_event *, __events, int, __maxevents,
+ int, __timeout);
+HANDLER_WRAPPERS_DEF(int, epoll_pwait, int, __epfd,
+ struct epoll_event *, __events, int, __maxevents,
+ int, __timeout, __const __sigset_t *, __ss);
+HANDLER_WRAPPERS_DEF(int, epoll_ctl, int, __epfd, int, __op, int, __fd,
+ struct epoll_event *, __event);
//HANDLER_WRAPPERS_DEF(uint32_t, htonl, uint32_t, hostlong);
//HANDLER_WRAPPERS_DEF(uint16_t, htons, uint16_t, hostshort);
//HANDLER_WRAPPERS_DEF(int, inet_aton, const char *, cp, struct in_addr *, inp);
//HANDLER_WRAPPERS_DEF(uint16_t, ntohs, uint16_t, netshort);
//HANDLER_WRAPPERS_DEF(in_addr_t, inet_lnaof, struct in_addr, in);
//HANDLER_WRAPPERS_DEF(in_addr_t, inet_netof, struct in_addr, in);
-//HANDLER_WRAPPERS_DEF(const char *, inet_ntop, int, af, const void *, src, char *, dst, socklen_t, size);
+//HANDLER_WRAPPERS_DEF(const char *, inet_ntop, int, af, const void *, src,
+// char *, dst, socklen_t, size);
//HANDLER_WRAPPERS_DEF(int, inet_pton, int, af, const char *, src, void *, dst);
-//HANDLER_WRAPPERS_DEF(int, getaddrinfo, const char *, node, const char *, service, const struct addrinfo *, hints, struct addrinfo **, res);
+//HANDLER_WRAPPERS_DEF(int, getaddrinfo, const char *, node,
+// const char *, service, const struct addrinfo *, hints,
+// struct addrinfo **, res);
//HANDLER_WRAPPERS_DEF(void, freeaddrinfo, struct addrinfo *res);
//HANDLER_WRAPPERS_DEF(const char *PROBE_NAME(gai_strerror, int errcode);
-//HANDLER_WRAPPERS_DEF(int, gai_suspend, const struct gaicb* const list[], int nitems, const struct timespec *timeout);
+//HANDLER_WRAPPERS_DEF(int, gai_suspend, const struct gaicb* const list[],
+// int nitems, const struct timespec *timeout);
//HANDLER_WRAPPERS_DEF(int, gai_error, struct gaicb *req);
//HANDLER_WRAPPERS_DEF(int, gai_cancel, struct gaicb *req);
-//HANDLER_WRAPPERS_DEF(int, getaddrinfo_a, int mode, struct gaicb *list[], int nitems, struct sigevent *sevp);
+//HANDLER_WRAPPERS_DEF(int, getaddrinfo_a, int mode, struct gaicb *list[],
+// int nitems, struct sigevent *sevp);
//HANDLER_WRAPPERS_DEF(int, getdomainname, char *name, size_t len);
//HANDLER_WRAPPERS_DEF(int, setdomainname, const char *name, size_t len);
//HANDLER_WRAPPERS_DEF(int, gethostname, char *name, size_t len);
//HANDLER_WRAPPERS_DEF(int, sethostname, const char *name, size_t len);
-//HANDLER_WRAPPERS_DEF(int, getnameinfo, const struct sockaddr *sa, socklen_t salen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, unsigned int flags);
-//HANDLER_WRAPPERS_DEF(struct hostent *PROBE_NAME(gethostbyname, const char *name);
-//HANDLER_WRAPPERS_DEF(struct hostent *PROBE_NAME(gethostbyaddr, const void *addr, socklen_t len, int type);
+//HANDLER_WRAPPERS_DEF(int, getnameinfo, const struct sockaddr *sa,
+// socklen_t salen, char *host, socklen_t hostlen,
+// char *serv, socklen_t servlen, unsigned int flags);
+//HANDLER_WRAPPERS_DEF(struct hostent *PROBE_NAME(gethostbyname,
+// const char *name);
+//HANDLER_WRAPPERS_DEF(struct hostent *PROBE_NAME(gethostbyaddr,
+// const void *addr, socklen_t len, int type);
//HANDLER_WRAPPERS_DEF(void, sethostent, int stayopen);
//HANDLER_WRAPPERS_DEF(void, endhostent, void);
//HANDLER_WRAPPERS_DEF(void, herror, const char *s);
//HANDLER_WRAPPERS_DEF(const char *PROBE_NAME(hstrerror, int err);
//HANDLER_WRAPPERS_DEF(struct hostent *PROBE_NAME(gethostent, void);
-//HANDLER_WRAPPERS_DEF(struct hostent *PROBE_NAME(gethostbyname2, const char *name, int af);
-//HANDLER_WRAPPERS_DEF(int, gethostent_r, struct hostent *rret, char *buf, size_t buflen, struct hostent **result, int *h_errnop);
-//HANDLER_WRAPPERS_DEF(int, gethostbyaddr_r, const void *addr, socklen_t len, int type, struct hostent *rret, char *buf, size_t buflen, struct hostent **result, int *h_errnop);
-//HANDLER_WRAPPERS_DEF(int, gethostbyname_r, const char *name, struct hostent *rret, char *buf, size_t buflen, struct hostent **result, int *h_errnop);
-//HANDLER_WRAPPERS_DEF(int, gethostbyname2_r, const char *name, int af, struct hostent *rret, char *buf, size_t buflen, struct hostent **result, int *h_errnop);
-//HANDLER_WRAPPERS_DEF(struct servent *PROBE_NAME(getservbyname, const char *name, const char *proto);
+//HANDLER_WRAPPERS_DEF(struct hostent *PROBE_NAME(gethostbyname2,
+// const char *name, int af);
+//HANDLER_WRAPPERS_DEF(int, gethostent_r, struct hostent *rret, char *buf,
+// size_t buflen, struct hostent **result, int *h_errnop);
+//HANDLER_WRAPPERS_DEF(int, gethostbyaddr_r, const void *addr, socklen_t len,
+// int type, struct hostent *rret, char *buf, size_t buflen,
+// struct hostent **result, int *h_errnop);
+//HANDLER_WRAPPERS_DEF(int, gethostbyname_r, const char *name,
+// struct hostent *rret, char *buf, size_t buflen,
+// struct hostent **result, int *h_errnop);
+//HANDLER_WRAPPERS_DEF(int, gethostbyname2_r, const char *name, int af,
+// struct hostent *rret, char *buf, size_t buflen,
+// struct hostent **result, int *h_errnop);
+//HANDLER_WRAPPERS_DEF(struct servent *PROBE_NAME(getservbyname,
+// const char *name, const char *proto);
//HANDLER_WRAPPERS_DEF(void, setservent, int stayopen);
//HANDLER_WRAPPERS_DEF(void, endservent, void);
//HANDLER_WRAPPERS_DEF(struct servent *PROBE_NAME(getservent, void);
-//HANDLER_WRAPPERS_DEF(struct servent *PROBE_NAME(getservbyport, int port, const char *proto);
-//HANDLER_WRAPPERS_DEF(int, getservent_r, struct servent *result_buf, char *buf, size_t buflen, struct servent **result);
-//HANDLER_WRAPPERS_DEF(int, getservbyname_r, const char *name, const char *proto, struct servent *result_buf, char *buf, size_t buflen, struct servent **result);
-//HANDLER_WRAPPERS_DEF(int, getservbyport_r, int port, const char *proto, struct servent *result_buf, char *buf, size_t buflen, struct servent **result);
+//HANDLER_WRAPPERS_DEF(struct servent *PROBE_NAME(getservbyport, int port,
+// const char *proto);
+//HANDLER_WRAPPERS_DEF(int, getservent_r, struct servent *result_buf, char *buf,
+// size_t buflen, struct servent **result);
+//HANDLER_WRAPPERS_DEF(int, getservbyname_r, const char *name,
+// const char *proto, struct servent *result_buf, char *buf,
+// size_t buflen, struct servent **result);
+//HANDLER_WRAPPERS_DEF(int, getservbyport_r, int port, const char *proto,
+// struct servent *result_buf, char *buf, size_t buflen,
+// struct servent **result);
//HANDLER_WRAPPERS_DEF(struct netent*, getnetent, void);
-//HANDLER_WRAPPERS_DEF(struct netent *PROBE_NAME(getnetbyname, const char *name);
-//HANDLER_WRAPPERS_DEF(struct netent *PROBE_NAME(getnetbyaddr, uint32_t net, int type);
+//HANDLER_WRAPPERS_DEF(struct netent *PROBE_NAME(getnetbyname,
+// const char *name);
+//HANDLER_WRAPPERS_DEF(struct netent *PROBE_NAME(getnetbyaddr, uint32_t net,
+// int type);
//HANDLER_WRAPPERS_DEF(void, setnetent, int stayopen);
//HANDLER_WRAPPERS_DEF(void, endnetent, void);
-//HANDLER_WRAPPERS_DEF(int, getnetent_r, struct netent *result_buf, char *buf, size_t buflen, struct netent **result, int *h_errnop);
-//HANDLER_WRAPPERS_DEF(int, getnetbyname_r, const char *name, struct netent *result_buf, char *buf, size_t buflen, struct netent **result, int *h_errnop);
-//HANDLER_WRAPPERS_DEF(int, getnetbyaddr_r, uint32_t net, int type, struct netent *result_buf, char *buf, size_t buflen, struct netent **result, int *h_errnop);
+//HANDLER_WRAPPERS_DEF(int, getnetent_r, struct netent *result_buf, char *buf,
+// size_t buflen, struct netent **result, int *h_errnop);
+//HANDLER_WRAPPERS_DEF(int, getnetbyname_r, const char *name,
+// struct netent *result_buf, char *buf, size_t buflen,
+// struct netent **result, int *h_errnop);
+//HANDLER_WRAPPERS_DEF(int, getnetbyaddr_r, uint32_t net, int type,
+// struct netent *result_buf, char *buf, size_t buflen,
+// struct netent **result, int *h_errnop);
//HANDLER_WRAPPERS_DEF(struct protoent *PROBE_NAME(getprotoent, void);
-//HANDLER_WRAPPERS_DEF(struct protoent *PROBE_NAME(getprotobyname, const char *name);
+//HANDLER_WRAPPERS_DEF(struct protoent *PROBE_NAME(getprotobyname,
+// const char *name);
//HANDLER_WRAPPERS_DEF(struct protoent *PROBE_NAME(getprotobynumber, int proto);
//HANDLER_WRAPPERS_DEF(void, setprotoent, int stayopen);
//HANDLER_WRAPPERS_DEF(void, endprotoent, void);
-//HANDLER_WRAPPERS_DEF(int, getprotoent_r, struct protoent *result_buf, char *buf, size_t buflen, struct protoent **result);
-//HANDLER_WRAPPERS_DEF(int, getprotobyname_r, const char *name, struct protoent *result_buf, char *buf, size_t buflen, struct protoent **result);
-//HANDLER_WRAPPERS_DEF(int, getprotobynumber_r, int proto, struct protoent *result_buf, char *buf, size_t buflen, struct protoent **result);
+//HANDLER_WRAPPERS_DEF(int, getprotoent_r, struct protoent *result_buf,
+// char *buf, size_t buflen, struct protoent **result);
+//HANDLER_WRAPPERS_DEF(int, getprotobyname_r, const char *name,
+// struct protoent *result_buf, char *buf, size_t buflen,
+// struct protoent **result);
+//HANDLER_WRAPPERS_DEF(int, getprotobynumber_r, int proto,
+// struct protoent *result_buf, char *buf, size_t buflen,
+// struct protoent **result);
//HANDLER_WRAPPERS_DEF(unsigned int, if_nametoindex, __const char *__ifname);
-//HANDLER_WRAPPERS_DEF(char *PROBE_NAME(if_indextoname, unsigned int __ifindex, char *__ifname);
+//HANDLER_WRAPPERS_DEF(char *PROBE_NAME(if_indextoname, unsigned int __ifindex,
+// char *__ifname);
//HANDLER_WRAPPERS_DEF(struct if_nameindex *PROBE_NAME(if_nameindex, void);
//HANDLER_WRAPPERS_DEF(void, if_freenameindex, struct if_nameindex *__ptr);
//HANDLER_WRAPPERS_DEF(int, getifaddrs, struct ifaddrs **ifap);
}
enum network_funcs_id_t get_network_feature_always_id(void *ptr)
- __attribute__((alias("get_network_feature_id")));
+ __attribute__((alias("get_network_feature_id")));
#undef X
/* X-macros replaced by structures defenitions */
/* For target binaries probes */
#define X(func_name, orig_name) \
- { (ElfW(Addr))& func_name, #orig_name, GT_TARGET_PROBE, (ElfW(Addr))0 },
+ { (ElfW(Addr))&func_name, #orig_name, GT_TARGET_PROBE, (ElfW(Addr))0 },
static struct probe_desc_t network_probes[] = {
PROBES_LIST
/* For all binaries probes */
#define X(func_name, orig_name) \
- { (ElfW(Addr))& CONCAT(func_name, _always), #orig_name, \
+ { (ElfW(Addr))&CONCAT(func_name, _always), #orig_name, \
GT_ALWAYS_PROBE, (ElfW(Addr))0 },
static struct probe_desc_t network_always_probes[] = {
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
#endif
#endif // __DA_SYNC_H__
-
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
#include "daprobe.h"
-#define BEFORE_ORIGINAL_THREAD(FUNCNAME, LIBNAME) \
- DECLARE_VARIABLE_STANDARD; \
- FUNCNAME ## p = (void *)PROBE_GET_FUNC(probe_data); \
+#define BEFORE_ORIGINAL_THREAD(FUNCNAME, LIBNAME) \
+ DECLARE_VARIABLE_STANDARD; \
+ FUNCNAME ## p = (void *)PROBE_GET_FUNC(probe_data); \
PRE_PROBEBLOCK()
-#define AFTER_PACK_ORIGINAL_THREAD(API_ID, RTYPE, RVAL, THREADVAL, APITYPE, INPUTFORMAT, ...) \
- POST_PACK_PROBEBLOCK_BEGIN(); \
- PREPARE_LOCAL_BUF(); \
- PACK_COMMON_BEGIN(MSG_PROBE_THREAD, API_ID, INPUTFORMAT, __VA_ARGS__); \
- PACK_COMMON_END(RTYPE, RVAL, errno, probe_data); \
- PACK_THREAD(THREADVAL, THREAD_PTHREAD, APITYPE, THREAD_CLASS_BLANK); \
- FLUSH_LOCAL_BUF(); \
+#define AFTER_PACK_ORIGINAL_THREAD(API_ID, RTYPE, RVAL, THREADVAL, APITYPE, \
+ INPUTFORMAT, ...) \
+ POST_PACK_PROBEBLOCK_BEGIN(); \
+ PREPARE_LOCAL_BUF(); \
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD, API_ID, INPUTFORMAT, __VA_ARGS__); \
+ PACK_COMMON_END(RTYPE, RVAL, errno, probe_data); \
+ PACK_THREAD(THREADVAL, THREAD_PTHREAD, APITYPE, THREAD_CLASS_BLANK); \
+ FLUSH_LOCAL_BUF(); \
POST_PACK_PROBEBLOCK_END()
#endif // __DA_THREAD_H__
-
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
-HANDLER_WRAPPERS(thread_feature, int, pthread_mutex_init, pthread_mutex_t * ,mutex,
- const pthread_mutexattr_t *, attr)
+HANDLER_WRAPPERS(thread_feature, int, pthread_mutex_init, pthread_mutex_t *,
+ mutex, const pthread_mutexattr_t *, attr)
{
int (*pthread_mutex_initp)(pthread_mutex_t *mutex,
- const pthread_mutexattr_t *attr);
+ const pthread_mutexattr_t *attr);
BEFORE_ORIGINAL_SYNC(pthread_mutex_init, LIBPTHREAD);
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_mutex_destroy, pthread_mutex_t *, mutex)
+HANDLER_WRAPPERS(thread_feature, int , pthread_mutex_destroy,
+ pthread_mutex_t *, mutex)
{
int (*pthread_mutex_destroyp)(pthread_mutex_t *mutex);
}
/* TODO Support old preload, useless with got patching */
-int real_pthread_mutex_lock(pthread_mutex_t *mutex) {
+int real_pthread_mutex_lock(pthread_mutex_t *mutex)
+{
static int (*pthread_mutex_lockp)(pthread_mutex_t *mutex) = NULL;
GET_REAL_FUNC(pthread_mutex_lock, LIBPTHREAD);
return pthread_mutex_lockp(mutex);
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_mutex_lock, pthread_mutex_t *, mutex)
+HANDLER_WRAPPERS(thread_feature, int , pthread_mutex_lock,
+ pthread_mutex_t *, mutex)
{
int (*pthread_mutex_lockp)(pthread_mutex_t *mutex);
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int, pthread_mutex_timedlock, pthread_mutex_t *, mutex,
- const struct timespec *, abs_timeout)
+HANDLER_WRAPPERS(thread_feature, int, pthread_mutex_timedlock,
+ pthread_mutex_t *, mutex, const struct timespec *, abs_timeout)
{
int (*pthread_mutex_timedlockp)(pthread_mutex_t *mutex,
const struct timespec *abs_timeout);
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_mutex_trylock, pthread_mutex_t *, mutex)
+HANDLER_WRAPPERS(thread_feature, int , pthread_mutex_trylock,
+ pthread_mutex_t *, mutex)
{
int (*pthread_mutex_trylockp)(pthread_mutex_t *mutex);
}
/* TODO Support old preload, useless with got patching */
-int real_pthread_mutex_unlock(pthread_mutex_t *mutex) {
+int real_pthread_mutex_unlock(pthread_mutex_t *mutex)
+{
static int (*pthread_mutex_unlockp)(pthread_mutex_t *mutex) = NULL;
GET_REAL_FUNC(pthread_mutex_unlock, LIBPTHREAD);
return pthread_mutex_unlockp(mutex);
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_mutex_unlock, pthread_mutex_t *, mutex)
+HANDLER_WRAPPERS(thread_feature, int , pthread_mutex_unlock,
+ pthread_mutex_t *, mutex)
{
int (*pthread_mutex_unlockp)(pthread_mutex_t *mutex);
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_mutexattr_init, pthread_mutexattr_t *, attr)
+HANDLER_WRAPPERS(thread_feature, int , pthread_mutexattr_init,
+ pthread_mutexattr_t *, attr)
{
int (*pthread_mutexattr_initp)(pthread_mutexattr_t *attr);
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_mutexattr_destroy, pthread_mutexattr_t *, attr)
+HANDLER_WRAPPERS(thread_feature, int, pthread_mutexattr_destroy,
+ pthread_mutexattr_t *, attr)
{
int (*pthread_mutexattr_destroyp)(pthread_mutexattr_t *attr);
int prioceiling, int *old_ceiling);
*/
-HANDLER_WRAPPERS(thread_feature, int , pthread_cond_init, pthread_cond_t *, cond,
- const pthread_condattr_t *, attr)
+HANDLER_WRAPPERS(thread_feature, int , pthread_cond_init,
+ pthread_cond_t *, cond, const pthread_condattr_t *, attr)
{
int (*pthread_cond_initp)(pthread_cond_t *cond,
const pthread_condattr_t *attr);
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_cond_destroy, pthread_cond_t *, cond)
+HANDLER_WRAPPERS(thread_feature, int , pthread_cond_destroy,
+ pthread_cond_t *, cond)
{
int (*pthread_cond_destroyp)(pthread_cond_t *cond);
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_cond_wait, pthread_cond_t *, cond,
- pthread_mutex_t *, mutex)
+HANDLER_WRAPPERS(thread_feature, int , pthread_cond_wait,
+ pthread_cond_t *, cond, pthread_mutex_t *, mutex)
{
int (*pthread_cond_waitp)(pthread_cond_t *cond,
pthread_mutex_t *mutex);
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int, pthread_cond_timedwait, pthread_cond_t *, cond,
- pthread_mutex_t *, mutex, const struct timespec *, abstime)
+HANDLER_WRAPPERS(thread_feature, int, pthread_cond_timedwait,
+ pthread_cond_t *, cond, pthread_mutex_t *, mutex,
+ const struct timespec *, abstime)
{
int (*pthread_cond_timedwaitp)(pthread_cond_t *cond,
pthread_mutex_t *mutex, const struct timespec *abstime);
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_cond_signal, pthread_cond_t *, cond)
+HANDLER_WRAPPERS(thread_feature, int , pthread_cond_signal,
+ pthread_cond_t *, cond)
{
int (*pthread_cond_signalp)(pthread_cond_t *cond);
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_cond_broadcast, pthread_cond_t *, cond)
+HANDLER_WRAPPERS(thread_feature, int , pthread_cond_broadcast,
+ pthread_cond_t *, cond)
{
int (*pthread_cond_broadcastp)(pthread_cond_t *cond);
AFTER_PACK_ORIGINAL_SYNC(API_ID_pthread_cond_broadcast,
'd', ret, cond, SYNC_PTHREAD_COND_VARIABLE,
- SYNC_API_NOTIFY_ALL, "p", voidp_to_uint64(cond));
+ SYNC_API_NOTIFY_ALL, "p",
+ voidp_to_uint64(cond));
return ret;
}
#ifndef __LIBDASYNC_H__
#define __LIBDASYNC_H__
-HANDLER_WRAPPERS_DEF(int, pthread_mutex_init, pthread_mutex_t *, mutex, const pthread_mutexattr_t *, attr);
+HANDLER_WRAPPERS_DEF(int, pthread_mutex_init, pthread_mutex_t *, mutex,
+ const pthread_mutexattr_t *, attr);
HANDLER_WRAPPERS_DEF(int, pthread_mutex_destroy, pthread_mutex_t *, mutex);
HANDLER_WRAPPERS_DEF(int, pthread_mutex_lock, pthread_mutex_t *, mutex);
-HANDLER_WRAPPERS_DEF(int, pthread_mutex_timedlock, pthread_mutex_t *, mutex, const struct timespec *, abs_timeout);
+HANDLER_WRAPPERS_DEF(int, pthread_mutex_timedlock, pthread_mutex_t *, mutex,
+ const struct timespec *, abs_timeout);
HANDLER_WRAPPERS_DEF(int, pthread_mutex_trylock, pthread_mutex_t *, mutex);
HANDLER_WRAPPERS_DEF(int, pthread_mutex_unlock, pthread_mutex_t *, mutex);
HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_init, pthread_mutexattr_t *, attr);
-HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_destroy, pthread_mutexattr_t *, attr);
-HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_getprioceiling, const pthread_mutexattr_t *, attr, int *, prioceiling);
-HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_setprioceiling, pthread_mutexattr_t *, attr, int, prioceiling);
-HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_getprotocol, const pthread_mutexattr_t *, attr, int *, protocol);
-HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_setprotocol, pthread_mutexattr_t *, attr, int, protocol);
-HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_getpshared, const pthread_mutexattr_t *, attr, int *, pshared);
-HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_setpshared, pthread_mutexattr_t *, attr, int, pshared);
-HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_gettype, const pthread_mutexattr_t *, attr, int *, type);
-HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_settype, pthread_mutexattr_t *, attr, int, type);
-HANDLER_WRAPPERS_DEF(int, pthread_cond_init, pthread_cond_t *, cond, const pthread_condattr_t *, attr);
+HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_destroy,
+ pthread_mutexattr_t *, attr);
+HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_getprioceiling,
+ const pthread_mutexattr_t *, attr, int *, prioceiling);
+HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_setprioceiling,
+ pthread_mutexattr_t *, attr, int, prioceiling);
+HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_getprotocol,
+ const pthread_mutexattr_t *, attr, int *, protocol);
+HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_setprotocol,
+ pthread_mutexattr_t *, attr, int, protocol);
+HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_getpshared,
+ const pthread_mutexattr_t *, attr, int *, pshared);
+HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_setpshared,
+ pthread_mutexattr_t *, attr, int, pshared);
+HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_gettype,
+ const pthread_mutexattr_t *, attr, int *, type);
+HANDLER_WRAPPERS_DEF(int, pthread_mutexattr_settype,
+ pthread_mutexattr_t *, attr, int, type);
+HANDLER_WRAPPERS_DEF(int, pthread_cond_init, pthread_cond_t *, cond,
+ const pthread_condattr_t *, attr);
HANDLER_WRAPPERS_DEF(int, pthread_cond_destroy, pthread_cond_t *, cond);
-HANDLER_WRAPPERS_DEF(int, pthread_cond_wait, pthread_cond_t *, cond, pthread_mutex_t *, mutex);
-HANDLER_WRAPPERS_DEF(int, pthread_cond_timedwait, pthread_cond_t *, cond, pthread_mutex_t *, mutex, const struct timespec *, abstime);
+HANDLER_WRAPPERS_DEF(int, pthread_cond_wait, pthread_cond_t *, cond,
+ pthread_mutex_t *, mutex);
+HANDLER_WRAPPERS_DEF(int, pthread_cond_timedwait, pthread_cond_t *, cond,
+ pthread_mutex_t *, mutex,
+ const struct timespec *, abstime);
HANDLER_WRAPPERS_DEF(int, pthread_cond_signal, pthread_cond_t *, cond);
HANDLER_WRAPPERS_DEF(int, pthread_cond_broadcast, pthread_cond_t *, cond);
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
{
/* TODO Split LSan */
static int (*lsan_pthread_createp)(pthread_t *thread,
- const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg);
+ const pthread_attr_t *attr,
+ void *(*start_routine)(void *), void *arg);
int (*pthread_createp)(pthread_t *thread,
- const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg);
+ const pthread_attr_t *attr,
+ void *(*start_routine)(void *), void *arg);
DECLARE_VARIABLE_STANDARD;
if (lsan_init_succeeded && lsan_pthread_createp == NULL)
PRE_PROBEBLOCK();
- if(blockresult)
- {
+ if (blockresult) {
thread_routine_call *ptrc =
- (thread_routine_call *)malloc(sizeof(thread_routine_call));
+ (thread_routine_call *)malloc(sizeof(*ptrc));
if (!ptrc) {
PRINTERR("Can't allocate memory for ptrc");
return EAGAIN;
ptrc->thread_routine = start_routine;
ptrc->argument = arg;
- ret = pthread_createp(thread, attr, _da_ThreadProc, (void *) ptrc);
- }
- else // when pthread_create is called inside probe so (ex. custom chart, sampling thread)
- {
+ ret = pthread_createp(thread, attr, _da_ThreadProc,
+ (void *)ptrc);
+ } else {
ret = pthread_createp(thread, attr, start_routine, arg);
}
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_join, pthread_t, thread, void **, retval)
+HANDLER_WRAPPERS(thread_feature, int , pthread_join, pthread_t, thread,
+ void **, retval)
{
/* TODO Split LSan */
static int (*lsan_pthread_joinp)(pthread_t thread, void **retval);
API_ID_pthread_join,
"xp", (uint64_t)(thread), voidp_to_uint64(retval));
PACK_COMMON_END('d', 0, 0, probe_data);
- PACK_THREAD(thread, THREAD_PTHREAD, THREAD_API_WAIT_START, THREAD_CLASS_BLANK);
+ PACK_THREAD(thread, THREAD_PTHREAD, THREAD_API_WAIT_START,
+ THREAD_CLASS_BLANK);
FLUSH_LOCAL_BUF();
PRE_PROBEBLOCK_END();
(uint64_t)(thread),
voidp_to_uint64(retval));
PACK_COMMON_END('d', ret, errno, probe_data);
- PACK_THREAD(thread, THREAD_PTHREAD, THREAD_API_WAIT_END, THREAD_CLASS_BLANK);
+ PACK_THREAD(thread, THREAD_PTHREAD, THREAD_API_WAIT_END,
+ THREAD_CLASS_BLANK);
FLUSH_LOCAL_BUF();
errno = (newerrno != 0) ? newerrno : olderrno;
PRE_PROBEBLOCK_END();
- errno = (newerrno != 0) ? newerrno : olderrno;
+ errno = (newerrno != 0) ? newerrno : olderrno;
pthread_exitp(retval);
newerrno = errno;
AFTER_PACK_ORIGINAL_THREAD(API_ID_pthread_self,
- 'p', ret_pthr, ret_pthr, THREAD_API_OTHER, "", 0);
+ 'p', ret_pthr, ret_pthr, THREAD_API_OTHER,
+ "", 0);
return ret_pthr;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_equal, pthread_t, t1, pthread_t, t2)
+HANDLER_WRAPPERS(thread_feature, int , pthread_equal, pthread_t, t1,
+ pthread_t, t2)
{
int (*pthread_equalp)(pthread_t t1, pthread_t t2);
return pthread_setcancelstatep(state, oldstate);
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_setcancelstate, int, state, int *, oldstate)
+HANDLER_WRAPPERS(thread_feature, int , pthread_setcancelstate, int, state,
+ int *, oldstate)
{
pthread_t pSelf;
int (*pthread_setcancelstatep)(int state, int *oldstate);
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_setcanceltype, int, type, int *, oldtype)
+HANDLER_WRAPPERS(thread_feature, int , pthread_setcanceltype, int, type,
+ int *, oldtype)
{
pthread_t pSelf;
int (*pthread_setcanceltypep)(int type, int *oldtype);
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_attr_init, pthread_attr_t *, attr)
+HANDLER_WRAPPERS(thread_feature, int , pthread_attr_init,
+ pthread_attr_t *, attr)
{
pthread_t thread = 0;
int (*pthread_attr_initp)(pthread_attr_t *attr);
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_attr_destroy, pthread_attr_t *, attr)
+HANDLER_WRAPPERS(thread_feature, int , pthread_attr_destroy,
+ pthread_attr_t *, attr)
{
pthread_t thread = 0;
int (*pthread_attr_destroyp)(pthread_attr_t *attr);
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_attr_setdetachstate, pthread_attr_t *, attr,
- int, detachstate)
+HANDLER_WRAPPERS(thread_feature, int , pthread_attr_setdetachstate,
+ pthread_attr_t *, attr, int, detachstate)
{
pthread_t thread = 0;
int (*pthread_attr_setdetachstatep)(pthread_attr_t *attr,
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_attr_getstacksize, const pthread_attr_t *, attr,
- size_t *, stacksize)
+HANDLER_WRAPPERS(thread_feature, int , pthread_attr_getstacksize,
+ const pthread_attr_t *, attr, size_t *, stacksize)
{
pthread_t thread = 0;
int (*pthread_attr_getstacksizep)(const pthread_attr_t *attr,
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_attr_setstacksize, pthread_attr_t *, attr,
- size_t, stacksize)
+HANDLER_WRAPPERS(thread_feature, int , pthread_attr_setstacksize,
+ pthread_attr_t *, attr, size_t, stacksize)
{
pthread_t thread = 0;
int (*pthread_attr_setstacksizep)(pthread_attr_t *attr,
*
* happens on pthread-2.18 (target TV emul), not happens on pthread-2.13
*/
-HANDLER_WRAPPERS(thread_feature, int , pthread_attr_getstackaddr, const pthread_attr_t *, attr,
- void **, stackaddr)
+HANDLER_WRAPPERS(thread_feature, int , pthread_attr_getstackaddr,
+ const pthread_attr_t *, attr, void **, stackaddr)
{
pthread_t thread = 0;
static int (*pthread_attr_getstackaddrp)(const pthread_attr_t *attr,
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_attr_setstackaddr, pthread_attr_t *, attr,
- void *, stackaddr)
+HANDLER_WRAPPERS(thread_feature, int , pthread_attr_setstackaddr,
+ pthread_attr_t *, attr, void *, stackaddr)
{
pthread_t thread = 0;
static int (*pthread_attr_setstackaddrp)(pthread_attr_t *attr,
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_attr_setinheritsched, pthread_attr_t *, attr,
- int, inheritsched)
+HANDLER_WRAPPERS(thread_feature, int , pthread_attr_setinheritsched,
+ pthread_attr_t *, attr, int, inheritsched)
{
pthread_t thread = 0;
int (*pthread_attr_setinheritschedp)(pthread_attr_t *attr,
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int, pthread_attr_getschedparam, const pthread_attr_t *, attr,
- struct sched_param *, param)
+HANDLER_WRAPPERS(thread_feature, int, pthread_attr_getschedparam,
+ const pthread_attr_t *, attr, struct sched_param *, param)
{
pthread_t thread = 0;
int (*pthread_attr_getschedparamp)(const pthread_attr_t *attr,
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int, pthread_attr_setschedparam, pthread_attr_t *, attr,
- const struct sched_param *, param)
+HANDLER_WRAPPERS(thread_feature, int, pthread_attr_setschedparam,
+ pthread_attr_t *, attr, const struct sched_param *, param)
{
pthread_t thread = 0;
int (*pthread_attr_setschedparamp)(pthread_attr_t *attr,
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_attr_setschedpolicy, pthread_attr_t *, attr,
- int, policy)
+HANDLER_WRAPPERS(thread_feature, int , pthread_attr_setschedpolicy,
+ pthread_attr_t *, attr, int, policy)
{
pthread_t thread = 0;
int (*pthread_attr_setschedpolicyp)(pthread_attr_t *attr,
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_attr_getguardsize, const pthread_attr_t *, attr,
- size_t *, guardsize)
+HANDLER_WRAPPERS(thread_feature, int , pthread_attr_getguardsize,
+ const pthread_attr_t *, attr, size_t *, guardsize)
{
pthread_t thread = 0;
int (*pthread_attr_getguardsizep)(const pthread_attr_t *attr,
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_attr_setguardsize, pthread_attr_t *, attr,
- size_t, guardsize)
+HANDLER_WRAPPERS(thread_feature, int , pthread_attr_setguardsize,
+ pthread_attr_t *, attr, size_t, guardsize)
{
pthread_t thread = 0;
int (*pthread_attr_setguardsizep)(pthread_attr_t *attr,
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_attr_getscope, const pthread_attr_t *, attr,
- int *, contentionscope)
+HANDLER_WRAPPERS(thread_feature, int , pthread_attr_getscope,
+ const pthread_attr_t *, attr, int *, contentionscope)
{
pthread_t thread = 0;
int (*pthread_attr_getscopep)(const pthread_attr_t *attr,
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int , pthread_attr_setscope, pthread_attr_t *, attr,
- int, contentionscope)
+HANDLER_WRAPPERS(thread_feature, int , pthread_attr_setscope,
+ pthread_attr_t *, attr, int, contentionscope)
{
pthread_t thread = 0;
int (*pthread_attr_setscopep)(pthread_attr_t *attr,
AFTER_PACK_ORIGINAL_THREAD(API_ID_pthread_attr_setscope,
'd', ret, thread, THREAD_API_OTHER,
- "pd", voidp_to_uint64(attr), contentionscope);
+ "pd", voidp_to_uint64(attr),
+ contentionscope);
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int, pthread_attr_getstack, const pthread_attr_t *, attr,
- void **, stackaddr, size_t *, stacksize)
+HANDLER_WRAPPERS(thread_feature, int, pthread_attr_getstack,
+ const pthread_attr_t *, attr, void **, stackaddr,
+ size_t *, stacksize)
{
pthread_t thread = 0;
int (*pthread_attr_getstackp)(const pthread_attr_t *attr,
return ret;
}
-HANDLER_WRAPPERS(thread_feature, int, pthread_attr_setstack, pthread_attr_t *, attr,
- void *, stackaddr, size_t, stacksize)
+HANDLER_WRAPPERS(thread_feature, int, pthread_attr_setstack,
+ pthread_attr_t *, attr, void *, stackaddr, size_t, stacksize)
{
pthread_t thread = 0;
int (*pthread_attr_setstackp)(pthread_attr_t *attr,
API_ID__da_cleanup_handler,
"p", voidp_to_uint64(data));
PACK_COMMON_END('v', 0, 0, probe_data);
- PACK_THREAD(pSelf, THREAD_PTHREAD, THREAD_API_INTERNAL_STOP, THREAD_CLASS_BLANK);
+ PACK_THREAD(pSelf, THREAD_PTHREAD, THREAD_API_INTERNAL_STOP,
+ THREAD_CLASS_BLANK);
FLUSH_LOCAL_BUF();
PRE_UNCONDITIONAL_BLOCK_END();
API_ID__da_ThreadProc,
"p", voidp_to_uint64(params));
PACK_COMMON_END('p', 0, 0, probe_data);
- PACK_THREAD(pSelf, THREAD_PTHREAD, THREAD_API_INTERNAL_START, THREAD_CLASS_BLANK);
+ PACK_THREAD(pSelf, THREAD_PTHREAD, THREAD_API_INTERNAL_START,
+ THREAD_CLASS_BLANK);
FLUSH_LOCAL_BUF();
PRE_UNCONDITIONAL_BLOCK_END();
API_ID__da_ThreadProc,
"p", voidp_to_uint64(params));
PACK_COMMON_END('p', ret, 0, probe_data);
- PACK_THREAD(pSelf, THREAD_PTHREAD, THREAD_API_INTERNAL_STOP, THREAD_CLASS_BLANK);
+ PACK_THREAD(pSelf, THREAD_PTHREAD, THREAD_API_INTERNAL_STOP,
+ THREAD_CLASS_BLANK);
FLUSH_LOCAL_BUF();
PRE_UNCONDITIONAL_BLOCK_END();
typedef void *(*start_routine_t)(void *);
-HANDLER_WRAPPERS_DEF(int, pthread_create, pthread_t *, thread, const pthread_attr_t *, attr, start_routine_t, start_routine, void *, arg);
+HANDLER_WRAPPERS_DEF(int, pthread_create, pthread_t *, thread,
+ const pthread_attr_t *, attr,
+ start_routine_t, start_routine, void *, arg);
HANDLER_WRAPPERS_DEF(int, pthread_join, pthread_t, thread, void **, retval);
HANDLER_WRAPPERS_DEF(void, pthread_exit, void *, retval);
HANDLER_WRAPPERS_DEF(int, pthread_cancel, pthread_t, thread);
HANDLER_WRAPPERS_DEF(int, pthread_setcanceltype, int, type, int *, oldtype);
HANDLER_WRAPPERS_DEF(int, pthread_attr_init, pthread_attr_t *, attr);
HANDLER_WRAPPERS_DEF(int, pthread_attr_destroy, pthread_attr_t *, attr);
-HANDLER_WRAPPERS_DEF(int, pthread_attr_getdetachstate, const pthread_attr_t *, attr, int *, detachstate);
-HANDLER_WRAPPERS_DEF(int, pthread_attr_setdetachstate, pthread_attr_t *, attr, int, detachstate);
-HANDLER_WRAPPERS_DEF(int, pthread_attr_getstacksize, const pthread_attr_t *, attr, size_t *, stacksize);
-HANDLER_WRAPPERS_DEF(int, pthread_attr_setstacksize, pthread_attr_t *, attr, size_t, stacksize);
-//HANDLER_WRAPPERS_DEF(int, pthread_attr_getstackaddr, const pthread_attr_t *, attr, void **, stackaddr);
-//HANDLER_WRAPPERS_DEF(int, pthread_attr_setstackaddr, pthread_attr_t *, attr, void *, stackaddr);
-HANDLER_WRAPPERS_DEF(int, pthread_attr_getinheritsched, const pthread_attr_t *, attr, int *, inheritsched);
-HANDLER_WRAPPERS_DEF(int, pthread_attr_setinheritsched, pthread_attr_t *, attr, int, inheritsched);
-HANDLER_WRAPPERS_DEF(int, pthread_attr_getschedparam, const pthread_attr_t *, attr, struct sched_param *, param);
-HANDLER_WRAPPERS_DEF(int, pthread_attr_setschedparam, pthread_attr_t *, attr, const struct sched_param *, param);
-HANDLER_WRAPPERS_DEF(int, pthread_attr_getschedpolicy, const pthread_attr_t *, attr, int *, policy)
-HANDLER_WRAPPERS_DEF(int, pthread_attr_setschedpolicy, pthread_attr_t *, attr, int, policy)
-HANDLER_WRAPPERS_DEF(int, pthread_attr_getguardsize, const pthread_attr_t *, attr, size_t *, guardsize)
-HANDLER_WRAPPERS_DEF(int, pthread_attr_setguardsize, pthread_attr_t *, attr, size_t, guardsize)
-HANDLER_WRAPPERS_DEF(int, pthread_attr_getscope, const pthread_attr_t *, attr, int *, contentionscope)
-HANDLER_WRAPPERS_DEF(int, pthread_attr_setscope, pthread_attr_t *, attr, int, contentionscope)
-HANDLER_WRAPPERS_DEF(int, pthread_attr_getstack, const pthread_attr_t *, attr, void **, stackaddr, size_t *, stacksize);
-HANDLER_WRAPPERS_DEF(int, pthread_attr_setstack, pthread_attr_t *, attr, void *, stackaddr, size_t, stacksize);
+HANDLER_WRAPPERS_DEF(int, pthread_attr_getdetachstate,
+ const pthread_attr_t *, attr, int *, detachstate);
+HANDLER_WRAPPERS_DEF(int, pthread_attr_setdetachstate, pthread_attr_t *, attr,
+ int, detachstate);
+HANDLER_WRAPPERS_DEF(int, pthread_attr_getstacksize,
+ const pthread_attr_t *, attr, size_t *, stacksize);
+HANDLER_WRAPPERS_DEF(int, pthread_attr_setstacksize, pthread_attr_t *, attr,
+ size_t, stacksize);
+//HANDLER_WRAPPERS_DEF(int, pthread_attr_getstackaddr,
+// const pthread_attr_t *, attr, void **, stackaddr);
+//HANDLER_WRAPPERS_DEF(int, pthread_attr_setstackaddr, pthread_attr_t *, attr,
+// void *, stackaddr);
+HANDLER_WRAPPERS_DEF(int, pthread_attr_getinheritsched,
+ const pthread_attr_t *, attr, int *, inheritsched);
+HANDLER_WRAPPERS_DEF(int, pthread_attr_setinheritsched, pthread_attr_t *, attr,
+ int, inheritsched);
+HANDLER_WRAPPERS_DEF(int, pthread_attr_getschedparam,
+ const pthread_attr_t *, attr, struct sched_param *, param);
+HANDLER_WRAPPERS_DEF(int, pthread_attr_setschedparam, pthread_attr_t *, attr,
+ const struct sched_param *, param);
+HANDLER_WRAPPERS_DEF(int, pthread_attr_getschedpolicy,
+ const pthread_attr_t *, attr, int *, policy);
+HANDLER_WRAPPERS_DEF(int, pthread_attr_setschedpolicy, pthread_attr_t *, attr,
+ int, policy);
+HANDLER_WRAPPERS_DEF(int, pthread_attr_getguardsize,
+ const pthread_attr_t *, attr, size_t *, guardsize);
+HANDLER_WRAPPERS_DEF(int, pthread_attr_setguardsize, pthread_attr_t *, attr,
+ size_t, guardsize);
+HANDLER_WRAPPERS_DEF(int, pthread_attr_getscope, const pthread_attr_t *, attr,
+ int *, contentionscope);
+HANDLER_WRAPPERS_DEF(int, pthread_attr_setscope, pthread_attr_t *, attr,
+ int, contentionscope);
+HANDLER_WRAPPERS_DEF(int, pthread_attr_getstack, const pthread_attr_t *, attr,
+ void **, stackaddr, size_t *, stacksize);
+HANDLER_WRAPPERS_DEF(int, pthread_attr_setstack, pthread_attr_t *, attr,
+ void *, stackaddr, size_t, stacksize);
#endif /* __LIBDATHREAD_H__ */
X(PROBE_NAME(pthread_setcanceltype), pthread_setcanceltype) \
X(PROBE_NAME(pthread_attr_init), pthread_attr_init) \
X(PROBE_NAME(pthread_attr_destroy), pthread_attr_destroy) \
- X(PROBE_NAME(pthread_attr_getdetachstate), pthread_attr_getdetachstate) \
- X(PROBE_NAME(pthread_attr_setdetachstate), pthread_attr_setdetachstate) \
+ X(PROBE_NAME(pthread_attr_getdetachstate), \
+ pthread_attr_getdetachstate) \
+ X(PROBE_NAME(pthread_attr_setdetachstate), \
+ pthread_attr_setdetachstate) \
X(PROBE_NAME(pthread_attr_getstacksize), pthread_attr_getstacksize) \
X(PROBE_NAME(pthread_attr_setstacksize), pthread_attr_setstacksize) \
- X(PROBE_NAME(pthread_attr_getinheritsched), pthread_attr_getinheritsched) \
- X(PROBE_NAME(pthread_attr_setinheritsched), pthread_attr_setinheritsched) \
+ X(PROBE_NAME(pthread_attr_getinheritsched), \
+ pthread_attr_getinheritsched) \
+ X(PROBE_NAME(pthread_attr_setinheritsched), \
+ pthread_attr_setinheritsched) \
X(PROBE_NAME(pthread_attr_getschedparam), pthread_attr_getschedparam) \
X(PROBE_NAME(pthread_attr_setschedparam), pthread_attr_setschedparam) \
- X(PROBE_NAME(pthread_attr_getschedpolicy), pthread_attr_getschedpolicy) \
- X(PROBE_NAME(pthread_attr_setschedpolicy), pthread_attr_setschedpolicy) \
+ X(PROBE_NAME(pthread_attr_getschedpolicy), \
+ pthread_attr_getschedpolicy) \
+ X(PROBE_NAME(pthread_attr_setschedpolicy), \
+ pthread_attr_setschedpolicy) \
X(PROBE_NAME(pthread_attr_getguardsize), pthread_attr_getguardsize) \
X(PROBE_NAME(pthread_attr_setguardsize), pthread_attr_setguardsize) \
X(PROBE_NAME(pthread_attr_getscope), pthread_attr_getscope) \
X(PROBE_NAME(pthread_mutex_unlock), pthread_mutex_unlock) \
X(PROBE_NAME(pthread_mutexattr_init), pthread_mutexattr_init) \
X(PROBE_NAME(pthread_mutexattr_destroy), pthread_mutexattr_destroy) \
- X(PROBE_NAME(pthread_mutexattr_getprioceiling), pthread_mutexattr_getprioceiling) \
- X(PROBE_NAME(pthread_mutexattr_setprioceiling), pthread_mutexattr_setprioceiling) \
- X(PROBE_NAME(pthread_mutexattr_getprotocol), pthread_mutexattr_getprotocol) \
- X(PROBE_NAME(pthread_mutexattr_setprotocol), pthread_mutexattr_setprotocol) \
- X(PROBE_NAME(pthread_mutexattr_getpshared), pthread_mutexattr_getpshared) \
- X(PROBE_NAME(pthread_mutexattr_setpshared), pthread_mutexattr_setpshared) \
+ X(PROBE_NAME(pthread_mutexattr_getprioceiling), \
+ pthread_mutexattr_getprioceiling) \
+ X(PROBE_NAME(pthread_mutexattr_setprioceiling), \
+ pthread_mutexattr_setprioceiling) \
+ X(PROBE_NAME(pthread_mutexattr_getprotocol), \
+ pthread_mutexattr_getprotocol) \
+ X(PROBE_NAME(pthread_mutexattr_setprotocol), \
+ pthread_mutexattr_setprotocol) \
+ X(PROBE_NAME(pthread_mutexattr_getpshared), \
+ pthread_mutexattr_getpshared) \
+ X(PROBE_NAME(pthread_mutexattr_setpshared), \
+ pthread_mutexattr_setpshared) \
X(PROBE_NAME(pthread_mutexattr_gettype), pthread_mutexattr_gettype) \
X(PROBE_NAME(pthread_mutexattr_settype), pthread_mutexattr_settype) \
X(PROBE_NAME(pthread_cond_init), pthread_cond_init) \
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
+ * Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors:
* - S-Core Co., Ltd
* SNAPSHOT PROBE MACRO
*
* log format
- * SeqNumber`,ApiName`,Time`,Pid`,Tid`,InputParm`,Return`,PCAddr`,Error`,Size`,FUNCTYPE`,\n
- * callstack_start`,callstack`,callstack_end
+ * SeqNumber`,ApiName`,Time`,Pid`,Tid`,InputParm`,Return`,PCAddr`,Error`,Size`,FUNCTYPE`,\n
+ * callstack_start`,callstack`,callstack_end
*
* FUNCTYPE
- * SNAPSHOT_API_TYPE_PAGER,
- * SNAPSHOT_API_TYPE_CONTROLBAR,
- * SNAPSHOT_API_TYPE_NAVIFRAME,
- * SNAPSHOT_API_TYPE_OTHER
+ * SNAPSHOT_API_TYPE_PAGER,
+ * SNAPSHOT_API_TYPE_CONTROLBAR,
+ * SNAPSHOT_API_TYPE_NAVIFRAME,
+ * SNAPSHOT_API_TYPE_OTHER
*
**********************************************************************/
FUNCNAME ## p = (void *)GET_ORIG_FUNC(ui_feature, FUNCNAME)
-#define AFTER_ORIGINAL_SNAPSHOT(EVASOBJECT) \
- do { \
- static void (*__evas_event_callback_add_p)(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data); \
- static Evas *(*__evas_object_evas_get_p)(Evas_Object *obj);\
- \
- rtld_default_set_once(__evas_event_callback_add_p, "evas_event_callback_add"); \
- rtld_default_set_once(__evas_object_evas_get_p, "evas_object_evas_get"); \
- \
- __evas_event_callback_add_p(__evas_object_evas_get_p(EVASOBJECT), \
- EVAS_CALLBACK_RENDER_FLUSH_POST, \
- get_render_post_cb(), NULL); \
+#define AFTER_ORIGINAL_SNAPSHOT(EVASOBJECT) \
+ do { \
+ static void (*__evas_event_callback_add_p)(Evas *e, \
+ Evas_Callback_Type type, \
+ Evas_Event_Cb func, \
+ const void *data); \
+ static Evas *(*__evas_object_evas_get_p)(Evas_Object *obj); \
+ \
+ rtld_default_set_once(__evas_event_callback_add_p, \
+ "evas_event_callback_add"); \
+ rtld_default_set_once(__evas_object_evas_get_p, \
+ "evas_object_evas_get"); \
+ \
+ __evas_event_callback_add_p( \
+ __evas_object_evas_get_p(EVASOBJECT), \
+ EVAS_CALLBACK_RENDER_FLUSH_POST, \
+ get_render_post_cb(), NULL); \
} while(0)
#endif // __DA_SNAPSHOT_H__
using namespace Tizen::Ui::Animations;
using namespace Tizen::Ui::Controls;
-class DAFrameAnimationEventListener :
- public IFrameAnimatorEventListener
+class DAFrameAnimationEventListener: public IFrameAnimatorEventListener
{
public:
DAFrameAnimationEventListener();
virtual ~DAFrameAnimationEventListener();
- virtual void OnFormTransitionAnimationFinished (FrameAnimator &source, Frame &frame, Form &form1, Form &form2);
- virtual void OnFormTransitionAnimationStarted (FrameAnimator &source, Frame &frame, Form &form1, Form &form2);
- virtual void OnFormTransitionAnimationStopped (FrameAnimator &source, Frame &frame, Form &form1, Form &form2);
+ virtual void OnFormTransitionAnimationFinished(FrameAnimator &source, Frame &frame,
+ Form &form1, Form &form2);
+ virtual void OnFormTransitionAnimationStarted(FrameAnimator &source, Frame &frame,
+ Form &form1, Form &form2);
+ virtual void OnFormTransitionAnimationStopped(FrameAnimator &source, Frame &frame,
+ Form &form1, Form &form2);
static DAFrameAnimationEventListener& GetInstance(void);
#endif // __TIZEN_FRAMEANI_H__
-