INSTALLDIR = usr/lib
+HEADER_INSTALLDIR = /usr/local/include/
## Since include directives do not impose additional dependencies, we can make
## Makefile more clear, simply putting all includes we ever need in single
-I/usr/include/vconf \
-I/usr/lib/dbus-1.0/include \
-WARN_CFLAGS = \
+WARN_CFLAGS = -g \
-Wall \
-funwind-tables \
-fomit-frame-pointer \
TIZEN_CPPFLAGS = -DTIZENAPP $(SWAP_PROBE_DEFS)
TIZEN_LDFLAGS = -lstdc++
-all: capi tizen dummy
-tizen: headers $(TIZEN_TARGET)
-dummy: headers $(DUMMY_TARGET)
+all: capi tizen dummy
+tizen: headers $(TIZEN_TARGET)
+dummy: headers $(DUMMY_TARGET)
$(ASM_OBJ): $(ASM_SRC)
$(CC) $(ASMFLAG) -c $^ -o $@
+API_NAME_LIST = scripts/api_names_all.txt
GENERATED_CONFIG = include/api_config.h
GENERATED_HEADERS = include/api_id_mapping.h include/api_id_list.h include/id_list
-headers: $(GENERATED_CONFIG) $(GENERATED_HEADERS)
+SOURCE_HEADERS = include/api_ld_mapping.h
+
+headers: $(API_NAME_LIST) $(GENERATED_CONFIG) $(GENERATED_HEADERS)
rmheaders:
- rm -f $(GENERATED_CONFIG) $(GENERATED_HEADERS)
+ rm -f $(API_NAME_LIST) $(GENERATED_CONFIG) $(GENERATED_HEADERS) $(SOURCE_HEADERS)
$(GENERATED_CONFIG): ./scripts/gen_api_config.sh
sh $< > $@
+$(API_NAME_LIST):
+ if [ -f $@ ]; then rm $@;fi
+ cat */api_names.txt >> $@
+
+$(SOURCE_HEADERS): $(API_NAME_LIST)
+$(SOURCE_HEADERS): ./scripts/gen_maps_header.sh
+ bash $< $(API_NAME_LIST) $(TIZEN_TARGET) $(INSTALLDIR) > $@
+ cat $@
+
include/api_id_mapping.h: ./scripts/gen_api_id_mapping_header.awk
include/api_id_list.h: ./scripts/gen_api_id_mapping_header_list.awk
include/id_list: ./scripts/gen_api_id_mapping_list.awk
da_api_map: $(GENERATED_HEADERS)
-$(GENERATED_HEADERS): APINAMES=scripts/api_names.txt
-$(GENERATED_HEADERS): ./scripts/api_names.txt
$(GENERATED_HEADERS):
- awk -f $< < $(APINAMES) > $@
+ awk -f $< < $(API_NAME_LIST) > $@
$(TIZEN_TARGET): LDFLAGS+=$(TIZEN_LDFLAGS)
$(TIZEN_TARGET): CPPFLAGS+=$(TIZEN_CPPFLAGS)
$(DUMMY_TARGET): $(DUMMY_OBJS)
$(CC) $(LDFLAGS) $^ -o $@
-install: all
+ldheader: $(SOURCE_HEADERS)
+
+install: install_da install_ld
+
+install_da: all
[ -d "$(DESTDIR)/$(INSTALLDIR)" ] || mkdir -p $(DESTDIR)/$(INSTALLDIR)
install $(TIZEN_TARGET) $(DUMMY_TARGET) $(DESTDIR)/$(INSTALLDIR)/
install -m 644 include/id_list $(DESTDIR)/$(INSTALLDIR)/da_api_map
+
+install_ld: ldheader # var_addr
+ install -m 644 include/ld_preload_probes.h $(DESTDIR)/$(HEADER_INSTALLDIR)/ld_preload_probes.h
+ install -m 644 include/ld_preload_types.h $(DESTDIR)/$(HEADER_INSTALLDIR)/ld_preload_types.h
+ install -m 644 include/ld_preload_probe_lib.h $(DESTDIR)/$(HEADER_INSTALLDIR)/ld_preload_probe_lib.h
+
+
+
clean:
- rm -f *.so *.o $(GENERATED_HEADERS)
+ rm -f *.so *.o $(GENERATED_HEADERS) $(API_NAME_LIST) $(SOURCE_HEADERS)
-.PHONY: all capi tizen dummy clean install headers
+.PHONY: all capi tizen dummy clean install_ld install_da install headers
--- /dev/null
+#filename da_chart.c
+#lib "???"
+#feature ---
+_chart_timerThread
+da_mark
+da_create_chart
+da_create_series
+da_log
+da_create_default_series
+da_set_callback
+
+#filename da_chart_dummy.c
+#lib "???"
+#feature ---
sigset_t profsigmask;
interval_manager* pmanager = (interval_manager*)data;
- probeBlockStart();
-
sigemptyset(&profsigmask);
sigaddset(&profsigmask, SIGPROF);
pthread_sigmask(SIG_BLOCK, &profsigmask, NULL);
sleep(0);
}
- probeBlockEnd();
-
return NULL;
}
void __attribute__((constructor)) _init_lib()
{
- probeBlockStart();
-
memset(&chm, 0, sizeof(chm));
chm.interval_10ms.timerfd = -1;
chm.interval_100ms.timerfd = -1;
pthread_mutex_init(&chm.interval_10ms.list_mutex, NULL);
pthread_mutex_init(&chm.interval_100ms.list_mutex, NULL);
pthread_mutex_init(&chm.interval_1s.list_mutex, NULL);
-
- probeBlockEnd();
}
void __attribute__((destructor)) _fini_lib()
{
- probeBlockStart();
-
remove_all_callback_list();
if (chm.interval_10ms.timerfd != -1)
close(chm.interval_10ms.timerfd);
pthread_join(chm.interval_100ms.thread_handle, NULL);
if (chm.interval_1s.thread_handle != (pthread_t) -1)
pthread_join(chm.interval_1s.thread_handle, NULL);
-
- probeBlockEnd();
}
{
DECLARE_CHART_VARIABLE;
- probeBlockStart();
-
setProbePoint(&probeInfo);
PREPARE_LOCAL_BUF();
PACK_COMMON_END('v', 0, 0, 2);
PACK_CUSTOM(0, 0, mark_text, color, 0.0f);
FLUSH_LOCAL_BUF();
-
- probeBlockEnd();
}
da_handle da_create_chart(char* chart_name)
if(chart_name == NULL)
return ERR_WRONG_PARAMETER;
- probeBlockStart();
ret = ++(chm.chart_handle_index);
setProbePoint(&probeInfo);
PACK_CUSTOM(0, 0, chart_name, 0, 0.0f);
FLUSH_LOCAL_BUF();
- probeBlockEnd();
-
return ret;
}
if(chm.series_handle_index[(int)charthandle] + 1 >= MAX_SERIES_PER_CHART)
return ERR_MAX_CHART_NUMBER;
- probeBlockStart();
ret = ++(chm.series_handle_index[charthandle]);
ret += (10 * charthandle);
PACK_CUSTOM(charthandle, type, seriesname, color, 0.0f);
FLUSH_LOCAL_BUF();
- probeBlockEnd();
-
return ret;
}
if(interval == CHART_NO_CYCLE && callback != NULL)
return ERR_WRONG_PARAMETER;
- probeBlockStart();
-
// remove previously registered callback
remove_from_callback_list(cindex, series_handle);
re = start_callback_thread(interval);
PRINTMSG("start callback thread return %d\n", re);
}
- probeBlockEnd();
return 0;
}
if(sindex > chm.series_handle_index[(int)cindex])
return;
- probeBlockStart();
-
setProbePoint(&probeInfo);
PREPARE_LOCAL_BUF();
PACK_COMMON_END('v', 0, 0, 2);
PACK_CUSTOM(series_handle, 0, "", 0, uservalue);
FLUSH_LOCAL_BUF();
-
- probeBlockEnd();
}
void *main_symbol;
static const char *funcs[] = {"OspMain", "main"};
- probeBlockStart();
for (i = 0; i < (int)(sizeof(funcs)/sizeof(funcs[0])); i++){
main_symbol = dlsym(RTLD_NEXT, funcs[i]);
if(main_symbol != NULL) {
break;
}
}
- probeBlockEnd();
return ret;
}
--- /dev/null
+#filename daforkexec.c
+#lib "libc.so.6"
+#feature ---
+execl
+execlp
+execle
+execv
+execvp
+execve
+execvpe
+
+#filename dacapture.c
+#lib "---"
+#feature ---
+captureScreen
{
void *faddr = 0;
- (gProbeBlockCount++);
if (lib_handle[id] == ((void *)0)) {
lib_handle[id] = dlopen(lib_string[id],
RTLD_LAZY | RTLD_GLOBAL);
if (faddr == NULL || dlerror() != NULL)
probe_terminate_with_err("dlsym failed", func_name, id);
memcpy(func_pointer, &faddr, sizeof(faddr));
- (gProbeBlockCount--);
}
#endif
void *faddr;
probeInfo_t tempProbeInfo;
- probeBlockStart();
if (lib_handle[id] == ((void *)0)) {
lib_handle[id] = dlopen(lib_string[id], RTLD_LAZY);
if (lib_handle[id] == ((void *)0))
id);
memcpy(func_pointer, &faddr, sizeof(faddr));
- probeBlockEnd();
}
pthread_mutex_lock(&captureScreenLock);
- probeBlockStart();
-
setProbePoint(&probeInfo);
sdata.ximage = NULL;
scrimage = captureScreenShotX(&width, &height, &sdata);
if(ev)
destroy_canvas(ev);
- probeBlockEnd();
-
pthread_mutex_unlock(&captureScreenLock);
return ret;
}
static Eina_Bool _captureTimer(void __unused * data)
{
- probeBlockStart();
SCREENSHOT_TIMEOUT();
- probeBlockEnd();
return ECORE_CALLBACK_CANCEL;
}
void _cb_render_post(void __unused * data, Evas __unused * e,
void __unused * eventinfo)
{
- probeBlockStart();
SCREENSHOT_DONE();
- probeBlockEnd();
}
if (unlikely(psymbol == NULL))
return ERR_WRONGPARAMETER;
- probeBlockStart();
-
SYMBOLHASH_LOCK;
k = kh_get(symbol, SYMBOLHASH, (uint32_t)ptr);
if (k == kh_end(SYMBOLHASH)) // there is no entry for key
ret = 1;
}
SYMBOLHASH_UNLOCK;
- probeBlockEnd();
+
return ret;
}
if (unlikely(str == NULL))
return ERR_WRONGPARAMETER;
- probeBlockStart();
-
SYMBOLHASH_LOCK;
k = kh_put(symbol, SYMBOLHASH, (uint32_t)ptr, &rethash);
if (likely(rethash != 0)) // succeed to add in hash table
ret = 1;
}
SYMBOLHASH_UNLOCK;
- probeBlockEnd();
+
return ret;
}
if (unlikely(ptr == NULL))
return ERR_WRONGPARAMETER;
- probeBlockStart();
MEMORYHASH_LOCK;
k = kh_put(allocmap, MEMORYHASH, (uint32_t)ptr, &rethash);
if (likely(rethash != 0)) // succeed to add in hash table
ret = 1;
}
MEMORYHASH_UNLOCK;
- probeBlockEnd();
+
return ret;
}
if (unlikely(ptr == NULL))
return ERR_WRONGPARAMETER;
- probeBlockStart();
MEMORYHASH_LOCK;
k = kh_get(allocmap, MEMORYHASH, (uint32_t)ptr);
if (likely(k != kh_end(MEMORYHASH)))
ret = 1; // there is not entry in hash table
}
MEMORYHASH_UNLOCK;
- probeBlockEnd();
return ret;
}
if (unlikely(classname == NULL))
return ERR_WRONGPARAMETER;
- probeBlockStart();
-
UIOBJECTHASH_LOCK;
k = kh_get(uiobject, UIOBJECTHASH, (uint32_t)ptr);
if (unlikely(k == kh_end(UIOBJECTHASH))) // there is no entry for key
ret = 1;
}
UIOBJECTHASH_UNLOCK;
- probeBlockEnd();
+
return ret;
}
if (unlikely(classname == NULL))
return ERR_WRONGPARAMETER;
- probeBlockStart();
-
str_len = strlen(classname) + 1;
UIOBJECTHASH_LOCK;
ret = 1; // there is no entry
UIOBJECTHASH_UNLOCK;
- probeBlockEnd();
+
return ret;
}
if (unlikely(type == NULL))
return ERR_WRONGPARAMETER;
- probeBlockStart();
-
str_len = strlen(type) + 1;
UIOBJECTHASH_LOCK;
ret = 1;
UIOBJECTHASH_UNLOCK;
- probeBlockEnd();
+
return ret;
}
if (unlikely(ptr == NULL))
return ERR_WRONGPARAMETER;
- probeBlockStart();
UIOBJECTHASH_LOCK;
k = kh_get(uiobject, UIOBJECTHASH, (uint32_t)ptr);
if (likely(k != kh_end(UIOBJECTHASH))) // there is entry in hash table
ret = 1;
}
UIOBJECTHASH_UNLOCK;
- probeBlockEnd();
return ret;
}
if (unlikely(caller == NULL))
return ERR_WRONGPARAMETER;
- probeBlockStart();
-
OBJECTHASH_LOCK;
k = kh_get(object, OBJECTHASH, (uint32_t)ptr);
if (unlikely(k == kh_end(OBJECTHASH))) // there is no entry for key
ret = 1;
}
OBJECTHASH_UNLOCK;
- probeBlockEnd();
+
return ret;
}
if (unlikely(ptr == NULL))
return ERR_WRONGPARAMETER;
- probeBlockStart();
-
OBJECTHASH_LOCK;
k = kh_put(object, OBJECTHASH, (uint32_t)ptr, &rethash);
if (likely(rethash != 0)) // entry is already in hash table
}
OBJECTHASH_UNLOCK;
- probeBlockEnd();
+
return ret;
}
if (unlikely(caller == NULL))
return ERR_WRONGPARAMETER;
- probeBlockStart();
-
OBJECTHASH_LOCK;
k = kh_get(object, OBJECTHASH, (uint32_t)ptr);
if (likely(k != kh_end(OBJECTHASH))) // there is entry in hash table
ret = 1;
}
OBJECTHASH_UNLOCK;
- probeBlockEnd();
return ret;
}
if (unlikely(listener == NULL))
return ERR_WRONGPARAMETER;
- probeBlockStart();
-
DETECTORHASH_LOCK;
k = kh_put(detector, DETECTORHASH, (uint32_t)ptr, &rethash);
if (likely(rethash != 0)) // succeed to add in hash table
ret = 1;
}
DETECTORHASH_UNLOCK;
- probeBlockEnd();
+
return ret;
}
if (unlikely(ptr == NULL))
return ERR_WRONGPARAMETER;
- probeBlockStart();
DETECTORHASH_LOCK;
k = kh_get(detector, DETECTORHASH, (uint32_t)ptr);
if (likely(k != kh_end(DETECTORHASH))) // there is entry in hash table
ret = 1;
}
DETECTORHASH_UNLOCK;
- probeBlockEnd();
return ret;
}
return (struct data_list_t *)el->next;
}
-static void print_map(struct map_t *map)
-{
- PRINTMSG("mapp-> %p-%p %s %llx %s %llx %s",
- map->addr,
- map->endaddr,
- map->permissions,
- map->offset,
- map->device,
- map->inode,
- map->filename);
-}
-
static int read_mapping_line(FILE *mapfile, struct map_t *m)
{
char ch1, ch2;
return (ret != 0 && ret != EOF);
}
-static void print_list()
-{
- struct data_list_t *p = NULL;
- struct map_t *m = NULL;
- uint32_t i = 0;
-
- PRINTMSG("=====================================");
- for (p = get_first_el(§ions_list); p != NULL && i < sections_list.count; p = p->next) {
- m = (struct map_t *)p->data;
- PRINTMSG("mapp[%03d]-> %p-%p %s %llx %s %llx %s",
- ++i,
- m->addr,
- m->endaddr,
- m->permissions,
- m->offset,
- m->device,
- m->inode,
- m->filename);
- usleep(500);
- }
-
-}
-
static struct data_list_t *new_data(void)
{
struct data_list_t *el = (*real_malloc)(sizeof(*el));
print_list_sorted(name_hash_table);
}
-static struct map_t *get_map_by_addr(void *addr)
-{
- struct map_t *d = NULL;
- struct map_t *res = NULL;
- uint32_t left, right, cur;
-
- if (addr_hash_table_el_count_buzy == 0)
- goto find_exit;
-
- if (addr < addr_hash_table[0]->addr)
- goto find_exit;
-
- if (addr > addr_hash_table[addr_hash_table_el_count_buzy - 1]->endaddr)
- goto find_exit;
-
- left = 0;
- right = addr_hash_table_el_count_buzy - 1;
- cur = 0;
- while (left < right) {
- cur = (left + right) >> 1;
-
- d = (struct map_t *)addr_hash_table[cur];
- if (addr < d->addr) {
- right = cur - 1;
- continue;
- }
- if (addr > d->endaddr) {
- left = cur + 1;
- continue;
- }
-
- /* success */
- return (addr_hash_table[cur]);
- }
-
- if (left == right) {
- d = (struct map_t *)addr_hash_table[left];
- if ((d->addr <= addr) && (addr <= d->endaddr))
- res = addr_hash_table[left];
- }
-
-find_exit:
- return res;
-}
-
static void maps_reader_lock_all()
{
int i;
return res;
}
-int maps_print_maps_by_addr(const void *addr)
-{
- int res = -1;
- struct map_t *map = NULL;
-
- maps_reader_lock();
- map = get_map_by_addr((void *)addr);
- if (map != NULL)
- print_map(map);
- maps_reader_unlock();
-
- return res;
-}
-
-int maps_is_instrument_section_by_addr_no_remap(const void *addr)
-{
- int res = -1;
- struct map_t *map;
-
- maps_reader_lock();
- map = get_map_by_addr((void *)addr);
- if (map != NULL)
- res = map->is_instrument;
- maps_reader_unlock();
-
- return res;
-
-}
-
-/* interface function */
-int maps_is_instrument_section_by_addr(const void *addr)
-{
- int ret = maps_is_instrument_section_by_addr_no_remap(addr);
-
- if (ret == -1) {
- PRINTMSG("========> hz addr %p. remap", addr);
- if (maps_make() != 0) {
- PRINTERR("maps make failed\n");
- ret = -1;
- goto exit;
- }
- ret = maps_is_instrument_section_by_addr_no_remap(addr);
- if (ret == -1) {
- print_list();
- PRINTERR("!!!!unknown addr %p", addr);
- get_map_by_addr((void *)addr);
- sleep(2);
- exit(0);
- ret = 0;
- }
- }
-
-exit:
- return ret;
-}
-
/* must be called ones */
int maps_init()
{
int res = 0;
- probeBlockStart();
res = sem_init(&readers_mutex, 0, MAX_READERS_COUNT);
set_map_inst_list(NULL, 0);
- probeBlockEnd();
return res;
}
#define UDS_NAME "/tmp/da.socket"
#define TIMERFD_INTERVAL 100000000 // 0.1 sec
-__thread int gProbeBlockCount = 0;
__thread int gProbeDepth = 0;
pid_t gPid = -1;
__thread pid_t gTid = -1;
if(gTraceInfo.socket.daemonSock == -1)
return NULL;
- probeBlockStart();
-
sigemptyset(&profsigmask);
sigaddset(&profsigmask, SIGPROF);
pthread_sigmask(SIG_BLOCK, &profsigmask, NULL);
if (data_buf)
free(data_buf);
- probeBlockEnd();
return NULL;
}
return err;
}
-int _init_(void)
+void _init_(void)
{
- int res = 0;
-
- probeBlockStart();
-
/* redirect stderr and stdout.*/
/* if there is no std - print call will crash app */
__redirect_std();
getpid());
gTraceInfo.init_complete = 1;
- if (maps_make() != 0) {
- PRINTERR("maps make failed\n");
- res = -1;
- goto unlock_exit;
- }
-
-unlock_exit:
- probeBlockEnd();
-
- return res;
+ maps_make();
}
void __attribute__((constructor)) _init_probe()
void _uninit_(void)
{
int i;
- probeBlockStart();
gTraceInfo.init_complete = -1;
PRINTMSG("dynamic analyzer probe helper so unloading... pid[%d]\n",
dlclose(lib_handle[i]);
}
}
-
- probeBlockEnd();
}
void __attribute__((destructor)) _fini_probe()
if(unlikely(log == NULL))
return false;
- probeBlockStart();
log->type = msgType;
len = sizeof(log->type) + sizeof(log->length) + log->length;
real_pthread_mutex_lock(&(gTraceInfo.socket.sockMutex));
res = send(gTraceInfo.socket.daemonSock, log, len, 0);
real_pthread_mutex_unlock(&(gTraceInfo.socket.sockMutex));
- probeBlockEnd();
return (res == len);
}
if(unlikely(gTraceInfo.socket.daemonSock == -1))
return false;
- probeBlockStart();
-
/* fill message */
log.type = msgType;
if (str != NULL)
real_pthread_mutex_lock(&(gTraceInfo.socket.sockMutex));
res = send(gTraceInfo.socket.daemonSock, &log, len, 0);
real_pthread_mutex_unlock(&(gTraceInfo.socket.sockMutex));
- probeBlockEnd();
return (res == len);
}
/* Check connection status */
- probeBlockStart();
-
/* fill message */
log.type = msgType;
real_pthread_mutex_unlock(&(gTraceInfo.socket.sockMutex));
- probeBlockEnd();
-
/* return result */
return (res == len);
}
if(log == NULL)
return 0;
- probeBlockStart();
-
initsize = log->length;
curlen = initsize;
log->data[curlen] = '\0'; // is this necessary ?
log->length = curlen;
}
- probeBlockEnd();
return (int)(size - TRIM_STACK_DEPTH);
}
else
{
- probeBlockEnd();
return 0;
}
}
return user;
}
-int preBlockBegin(const void *caller, bool bFiltering, enum DaOptions option)
+int preBlockBegin(void)
{
- bool opt_nofilt;
-
- if (gTraceInfo.socket.daemonSock == -1)
- return 0;
-
- if(gProbeBlockCount != 0 || gProbeDepth != 0)
- return 0;
-
if(gTraceInfo.init_complete <= 0)
return 0;
- opt_nofilt = isNoFiltOptionEnabled(option);
+ probingStart();
- /* Actually we are considering 3 variables here:
- - regular option is enabled
- - non-filtering (always) option is enabled
- - per-probe filtering
- */
- if (!isOptionEnabled(option) && !opt_nofilt)
- return 0;
- else if (opt_nofilt)
- bFiltering = false;
-
- probeBlockStart();
-
- if (maps_is_instrument_section_by_addr(caller) == 1) {
- probingStart();
- return 2; /* user call */
- } else {
- if (bFiltering) {
- probeBlockEnd();
- return 0; /* not probing */
- } else {
- probingStart();
- return 1; /* internal call */
- }
- }
-}
-
-int postBlockBegin(int preresult)
-{
- if(preresult)
- {
- probeBlockStart();
- }
-
- return preresult;
-}
-
-void preBlockEnd()
-{
- probeBlockEnd();
+ return 1;
}
void postBlockEnd()
{
probingEnd();
- probeBlockEnd();
}
/*************************************************************************
* helper info getter functions
*************************************************************************/
+
// return current time in 1/10000 sec unit
unsigned long getCurrentTime()
{
return (uint64_t)tv.tv_sec * 1000 * 1000 * 1000 + tv.tv_usec * 1000;
}
+unsigned long get_caller_addr(unsigned long caller_addr)
+{
+ return caller_addr;
+}
+
+unsigned char get_call_type(unsigned char call_type)
+{
+ return call_type;
+}
+
/************************************************************************
* probe functions
************************************************************************/
return false;
}
- probeBlockStart();
-
// atomic operaion(gcc builtin) is more expensive then pthread_mutex
- real_pthread_mutex_lock(&(gTraceInfo.index.eventMutex));
- iProbe->eventIndex = gTraceInfo.index.eventIndex++;
- real_pthread_mutex_unlock(&(gTraceInfo.index.eventMutex));
-
+ // ...but it leads to a great workaround when using with the new preload.
+ iProbe->eventIndex = __sync_add_and_fetch(&gTraceInfo.index.eventIndex, 1);
iProbe->currentTime = getCurrentTime();
iProbe->pID = _getpid();
iProbe->tID = _gettid();
iProbe->callDepth = gProbeDepth;
- probeBlockEnd();
return true;
}
{
void *symbol;
- probeBlockStart();
-
symbol = dlsym(RTLD_NEXT, symname);
if (symbol == NULL || dlerror() != NULL) {
PRINTERR("dlsym failed <%s>\n", symname);
exit(41);
}
- probeBlockEnd();
-
return symbol;
}
#define MAX_LOCAL_BUF_SIZE (MAX_SHADER_LEN + ADD_LOCAL_BUF_SIZE)
#define LOCAL_BUF msg_buf
-// TODO: remove this copy-paste
-#define CALLER_ADDRESS \
- ((void*) __builtin_extract_return_addr(__builtin_return_address(0)))
-
static inline uint64_t voidp_to_uint64(const void *p)
{
return (uint64_t)(uintptr_t)p;
do { /* PACK_COMMON_END */ \
BUF_PTR = pack_ret(RET_PTR, ret_type, (uintptr_t)ret); /* return val */ \
BUF_PTR = pack_int64(BUF_PTR, (uint64_t)errn); /* errno */ \
- BUF_PTR = pack_int32(BUF_PTR, (uint32_t)intern_call); /* internal call*/ \
+ BUF_PTR = pack_int32(BUF_PTR, (uint32_t)CALL_TYPE); /* internal call*/ \
BUF_PTR = pack_int64(BUF_PTR, (uintptr_t)CALLER_ADDRESS); /*caller addr*/\
BUF_PTR = pack_int32(BUF_PTR, 0); /* reserved */ \
BUF_PTR = pack_int32(BUF_PTR, 0); /* reserved */ \
#define POST_PACK_PROBEBLOCK_BEGIN() \
newerrno = errno; \
- if(postBlockBegin(blockresult)) {
+ do {
#define POST_PACK_PROBEBLOCK_END() \
postBlockEnd(); \
- } \
+ } while (0); \
errno = (newerrno != 0) ? newerrno : olderrno
#define POST_PACK_PROBEBLOCK_ADD_END() \
- preBlockEnd(); \
- } \
+ } while(0); \
errno = (newerrno != 0) ? newerrno : olderrno
/* return 0; */
/* } */
-extern int _init_(void);
+extern void _init_(void);
extern void _uninit_(void);
#endif /* __BIN_PROTO_H__ */
extern int maps_init();
-extern int maps_make();
-extern int maps_is_instrument_section_by_addr(const void *addr);
+extern void maps_make();
extern int set_map_inst_list(char **maps_set, uint32_t maps_count);
#define DEFAULT_TOKEN "`,"
+unsigned long get_caller_addr(unsigned long caller_addr);
+unsigned char get_call_type(unsigned char call_type);
+
#define CALLER_ADDRESS \
- ((void*) __builtin_extract_return_addr(__builtin_return_address(0)))
+ ((void*) get_caller_addr(0xbadbeef))
+
+#define CALL_TYPE \
+ ((uint32_t) get_call_type(0xff))
#define BACKTRACE_SYMBOLS cached_backtrace_symbols
unsigned int callDepth;
} probeInfo_t;
-extern __thread int gProbeBlockCount;
extern __thread int gProbeDepth;
-#define probeBlockStart() (gProbeBlockCount++)
-#define probeBlockEnd() (gProbeBlockCount--)
#define probingStart() (gProbeDepth++)
#define probingEnd() (gProbeDepth--)
* helper apis
***************************************************************************/
-int preBlockBegin(const void *caller, bool bFiltering, enum DaOptions);
-void preBlockEnd();
-
-int postBlockBegin(int preresult);
+int preBlockBegin(void);
void postBlockEnd();
unsigned int getCurrentEventIndex();
#define DECLARE_VARIABLE_STANDARD \
probeInfo_t probeInfo; \
int blockresult = 0; \
- bool bfiltering = true; \
DECLARE_ERRNO_VARS; \
int __attribute__((unused)) ret = 0
#define DECLARE_VARIABLE_STANDARD_NORET \
probeInfo_t probeInfo; \
int blockresult; \
- bool bfiltering = true; \
int olderrno, newerrno; \
// ========================== get function pointer =========================
#define GET_REAL_FUNCP_STR(FUNCNAME, SONAME, FUNCTIONPOINTER) \
do { \
if (!FUNCTIONPOINTER) { \
- probeBlockStart(); \
if (lib_handle[SONAME] == NULL) { \
lib_handle[SONAME] = dlopen(lib_string[SONAME], RTLD_LAZY); \
if (lib_handle[SONAME] == NULL) { \
PRINTMSG("dlsym failed : <" FUNCNAME ">\n"); \
exit(0); \
} \
- probeBlockEnd(); \
} \
} while(0)
#define GET_REAL_FUNCP_RTLD_NEXT(FUNCNAME, FUNCTIONPOINTER) \
do { \
if(!FUNCTIONPOINTER) { \
- probeBlockStart(); \
FUNCTIONPOINTER = dlsym(RTLD_NEXT, #FUNCNAME); \
if(FUNCTIONPOINTER == NULL || dlerror() != NULL) \
probe_terminate_with_err("function not found", #FUNCNAME, LIB_NO); \
- probeBlockEnd(); \
} \
} while(0)
#define GET_REAL_FUNCP_RTLD_NEXT_CPP(FUNCNAME, FUNCTIONPOINTER) \
do { \
if(!FUNCTIONPOINTER) { \
- probeBlockStart(); \
void* funcp = dlsym(RTLD_NEXT, #FUNCNAME); \
if(funcp == NULL || dlerror() != NULL) { \
fprintf(stderr, "dlsym failed <%s>\n", #FUNCNAME); \
exit(0); \
} \
memcpy(&FUNCTIONPOINTER, &funcp, sizeof(void*)); \
- probeBlockEnd(); \
} \
} while(0)
// ======================= pre block macro ================================
-#define PRE_PROBEBLOCK_BEGIN() \
- if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) { \
+#define PRE_PROBEBLOCK_BEGIN() \
+ if((blockresult = preBlockBegin()) != 0) { \
setProbePoint(&probeInfo)
#define PRE_PROBEBLOCK_END() \
- preBlockEnd(); \
} \
olderrno = errno; \
errno = 0
#define PRE_UNCONDITIONAL_BLOCK_BEGIN() \
do { \
- probeBlockStart(); \
setProbePoint(&probeInfo)
#define PRE_UNCONDITIONAL_BLOCK_END() \
- probeBlockEnd(); \
} while(0)
// =========================== post block macro ===========================
#define POST_PROBEBLOCK_BEGIN(LCTYPE, RETTYPE, RETVALUE, INPUTFORMAT, ...) \
newerrno = errno; \
- if(postBlockBegin(blockresult)) { \
+ do { \
PREPARE_LOCAL_BUF(); \
PACK_COMMON_BEGIN(MSG_PROBE_NETWORK, vAPI_ID, INPUTFORMAT, __VA_ARGS__);\
PACK_COMMON_END(RETTYPE, RETVALUE, errno, blockresult);
#define POST_PROBEBLOCK_END() \
FLUSH_LOCAL_BUF(); \
postBlockEnd(); \
- } \
+ } while(0); \
errno = (newerrno != 0) ? newerrno : olderrno
+#define POST_PROBEBLOCK_FUNC_START_END() \
+ postBlockEnd(); \
+ } while(0); \
+ olderrno = errno; \
+ errno = 0
+
// ========================= simplify macro ================================
#define BEFORE_ORIGINAL(FUNCNAME, LIBNAME) \
#define BEFORE_ORIGINAL_NOFILTER(FUNCNAME, LIBNAME) \
DECLARE_VARIABLE_STANDARD; \
GET_REAL_FUNC(FUNCNAME, LIBNAME); \
- bfiltering = false; \
PRE_PROBEBLOCK()
#ifdef __cplusplus
enum DaOptions
{
- OPT_ALWAYSOFF = 0x000000000,
- OPT_ALLOC = 0x000000008,
- OPT_FILE = 0x000000010,
- OPT_THREAD = 0x000000020,
- OPT_UI = 0x000000040,
- OPT_SNAPSHOT = 0x000000080,
- OPT_EVENT = 0x000000100,
- OPT_RECORD = 0x000000200,
- OPT_NETWORK = 0x000020000,
- OPT_GLES = 0x000040000,
- OPT_ALWAYSON = 0xfffffffff,
- OPT_ALLOC_ALWAYS = 0x010000000,
- OPT_FILE_ALWAYS = 0x020000000,
- OPT_THREAD_ALWAYS = 0x040000000,
- OPT_UI_ALWAYS = 0x080000000,
- OPT_NETWORK_ALWAYS = 0x100000000ULL,
- OPT_GLES_ALWAYS = 0x200000000ULL
+ 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
+
+/* TODO replace all "OPT_*" in code by "FL_*" like in swap-manager */
+ OPT_ALWAYSOFF = 0x000000000,
+ OPT_ALLOC = FL_MEMORY_ALLOC_PROBING,
+ OPT_FILE = FL_FILE_API_PROBING,
+ OPT_THREAD = FL_THREAD_API_PROBING,
+ OPT_UI = FL_OSP_UI_API_PROBING,
+ OPT_SNAPSHOT = FL_SCREENSHOT,
+ OPT_EVENT = FL_USER_EVENT,
+ OPT_RECORD = FL_RECORDING,
+ OPT_NETWORK = FL_NETWORK_API_PROBING,
+ OPT_GLES = FL_OPENGL_API_PROBING,
+ OPT_ALWAYSON = 0xfffffffff,
+ OPT_ALLOC_ALWAYS = FL_MEMORY_ALLOC_ALWAYS_PROBING,
+ OPT_FILE_ALWAYS = FL_FILE_API_ALWAYS_PROBING,
+ OPT_THREAD_ALWAYS = FL_THREAD_API_ALWAYS_PROBING,
+ OPT_UI_ALWAYS = FL_OSP_UI_API_ALWAYS_PROBING,
+ OPT_NETWORK_ALWAYS = FL_NETWORK_API_ALWAYS_PROBING,
+ OPT_GLES_ALWAYS = FL_OPENGL_API_ALWAYS_PROBING
};
#define GET_REAL_FUNC_TIZEN(FUNCNAME, LIBNAME, FUNCTIONPOINTER) \
do { \
if(!FUNCTIONPOINTER) { \
- probeBlockStart(); \
if(lib_handle[LIBNAME] == NULL) { \
lib_handle[LIBNAME] = dlopen(lib_string[LIBNAME], RTLD_LAZY); \
if(lib_handle[LIBNAME] == NULL) { \
exit(0); \
} \
memcpy(&FUNCTIONPOINTER, &funcp, sizeof(void*)); \
- probeBlockEnd(); \
} \
} while(0)
#define PRE_PROBEBLOCK_TIZEN(FILTER) \
do { \
- if((blockresult = preBlockBegin(CALLER_ADDRESS, FILTER, _sopt)) != 0) { \
+ if((blockresult = preBlockBegin()) != 0) { \
setProbePoint(&probeInfo); \
- preBlockEnd(); \
} \
} while(0)
-Name: swap-probe
+Name: swap-probe-total
Summary: SWAP probe library
Version: 3.0
Release: 1
SWAP probe is a part of data collection back-end for DA.
This library will be installed in target.
+%package -n swap-probe
+Provides: swap-probe
+Summary: SWAP probe library
+
+%description -n swap-probe
+SWAP probe is a part of data collection back-end for DA.
+This library will be installed in target.
+
+
+%package -n swap-probe-devel
+Provides: swap-probe-devel
+Summary: SWAP probe library
+
+%description -n swap-probe-devel
+SWAP probe is a part of data collection back-end for DA.
+This library will be installed in target.
+
%prep
%setup -q -n %{name}_%{version}
make rmheaders
make headers
make -j
+make ldheader
%install
rm -rf ${RPM_BUILD_ROOT}
mkdir -p %{buildroot}/usr/share/license
cp LICENSE %{buildroot}/usr/share/license/%{name}
+mkdir -p %{buildroot}/usr/local/include
+
%make_install
-%files
+%files -n swap-probe
/usr/share/license/%{name}
%manifest swap-probe.manifest
%{_prefix}/lib/libdaprobe.so
%{_prefix}/lib/da_api_map
+%files -n swap-probe-devel
+/usr/local/include/ld_preload_*.h
-%changelog
+%changelog
--- /dev/null
+#filename capi_appfw.c
+#lib "libcapi-appfw-application.so.0"
+#feature ---
+app_efl_main __nonblocking_probe__
+ui_app_main __nonblocking_probe__
+_dalc_app_create
+_dalc_app_terminate
+_dalc_app_pause
+_dalc_app_resume
+_dalc_app_service
{
bool bret = false;
DECLARE_ERRNO_VARS;
- int blockresult = 1;
+// int blockresult = 1;
bret = gAppCallback.create(user_data);
static void _dalc_app_terminate(void *user_data)
{
DECLARE_ERRNO_VARS;
- int blockresult = 1;
+// int blockresult = 1;
gAppCallback.terminate(user_data);
static void _dalc_app_pause(void *user_data)
{
DECLARE_ERRNO_VARS;
- int blockresult = 1;
+// int blockresult = 1;
gAppCallback.pause(user_data);
static void _dalc_app_resume(void *user_data)
{
DECLARE_ERRNO_VARS;
- int blockresult = 1;
+// int blockresult = 1;
gAppCallback.resume(user_data);
#endif /* PRIVATE_CAPI_APPFW */
{
DECLARE_ERRNO_VARS;
- int blockresult = 1;
+// int blockresult = 1;
#ifdef PRIVATE_CAPI_APPFW
gAppCallback.app_control(handle, user_data);
GET_REAL_FUNCP_RTLD_NEXT(app_efl_main, app_efl_mainp);
- probeBlockStart();
handler = register_orientation_event_listener();
gAppCallback.create = callback->create;
gAppCallback.terminate = callback->terminate;
callback->service = _dalc_app_service;
#endif /* PRIVATE_CAPI_APPFW */
callback->device_orientation = _dalc_app_deviceorientationchanged;
- probeBlockEnd();
ret = app_efl_mainp(argc, argv, callback, user_data);
- probeBlockStart();
unregister_orientation_event_listener(handler);
callback->create = gAppCallback.create;
callback->terminate = gAppCallback.terminate;
callback->service = gAppCallback.service;
#endif /* PRIVATE_CAPI_APPFW */
callback->device_orientation = gAppCallback.device_orientation;
- probeBlockEnd();
return ret;
}
{
bool bret = false;
DECLARE_ERRNO_VARS;
- int blockresult = 1;
+// int blockresult = 1;
bret = uiAppCallback.create(user_data);
static void _ui_dalc_app_terminate(void *user_data)
{
DECLARE_ERRNO_VARS;
- int blockresult = 1;
+// int blockresult = 1;
uiAppCallback.terminate(user_data);
static void _ui_dalc_app_pause(void *user_data)
{
DECLARE_ERRNO_VARS;
- int blockresult = 1;
+// int blockresult = 1;
uiAppCallback.pause(user_data);
static void _ui_dalc_app_resume(void *user_data)
{
DECLARE_ERRNO_VARS;
- int blockresult = 1;
+// int blockresult = 1;
uiAppCallback.resume(user_data);
static void _ui_dalc_app_control(app_control_h handle, void *user_data)
{
DECLARE_ERRNO_VARS;
- int blockresult = 1;
+// int blockresult = 1;
uiAppCallback.app_control(handle, user_data);
GET_REAL_FUNCP_RTLD_NEXT(ui_app_main, ui_app_mainp);
- probeBlockStart();
handler = register_orientation_event_listener();
uiAppCallback.create = callback->create;
uiAppCallback.terminate = callback->terminate;
if (callback->app_control)
callback->app_control = _ui_dalc_app_control;
- probeBlockEnd();
-
ret = ui_app_mainp(argc, argv, callback, user_data);
- probeBlockStart();
unregister_orientation_event_listener(handler);
callback->create = uiAppCallback.create;
callback->resume = uiAppCallback.resume;
callback->app_control = uiAppCallback.app_control;
- probeBlockEnd();
-
return ret;
}
--- /dev/null
+#filename gesture.cpp
+#lib "???"
+#feature ---
+void GestureEventListener::OnCustomGestureCanceled (TouchGestureDetector &gestureDetector)
+void GestureEventListener::OnCustomGestureChanged (TouchGestureDetector &gestureDetector)
+void GestureEventListener::OnCustomGestureFinished (TouchGestureDetector &gestureDetector)
+void GestureEventListener::OnCustomGestureStarted (TouchGestureDetector &gestureDetector)
+void GestureEventListener::OnFlickGestureCanceled (TouchFlickGestureDetector &gestureDetector)
+void GestureEventListener::OnFlickGestureDetected (TouchFlickGestureDetector &gestureDetector)
+void GestureEventListener::OnLongPressGestureCanceled (TouchLongPressGestureDetector &gestureDetector)
+void GestureEventListener::OnLongPressGestureDetected (TouchLongPressGestureDetector &gestureDetector)
+void GestureEventListener::OnPanningGestureCanceled (TouchPanningGestureDetector &gestureDetector)
+void GestureEventListener::OnPanningGestureChanged (TouchPanningGestureDetector &gestureDetector)
+void GestureEventListener::OnPanningGestureFinished (TouchPanningGestureDetector &gestureDetector)
+void GestureEventListener::OnPanningGestureStarted (TouchPanningGestureDetector &gestureDetector)
+void GestureEventListener::OnPinchGestureCanceled (TouchPinchGestureDetector &gestureDetector)
+void GestureEventListener::OnPinchGestureChanged (TouchPinchGestureDetector &gestureDetector)
+void GestureEventListener::OnPinchGestureFinished (TouchPinchGestureDetector &gestureDetector)
+void GestureEventListener::OnPinchGestureStarted (TouchPinchGestureDetector &gestureDetector)
+void GestureEventListener::OnRotationGestureCanceled (TouchRotationGestureDetector &gestureDetector)
+void GestureEventListener::OnRotationGestureChanged (TouchRotationGestureDetector &gestureDetector)
+void GestureEventListener::OnRotationGestureFinished (TouchRotationGestureDetector &gestureDetector)
+void GestureEventListener::OnRotationGestureStarted (TouchRotationGestureDetector &gestureDetector)
+void GestureEventListener::OnTapGestureCanceled (TouchTapGestureDetector &gestureDetector)
+void GestureEventListener::OnTapGestureDetected (TouchTapGestureDetector &gestureDetector)
+
+#filename orientation.c
+#lib "???"
+#feature ---
+Ecore_Event_Handler *register_orientation_event_listener()
+void unregister_orientation_event_listener(Ecore_Event_Handler **handler)
+
+#filename da_event.c
+#lib "???"
+#feature ---
+on_orientation_changed
+
+#filename keytouch.c
+#lib "libecore_input_evas.so.1"
+#feature FL_USER_EVENT
+ecore_event_evas_key_down
+ecore_event_evas_key_up
+ecore_event_evas_mouse_button_down
+ecore_event_evas_mouse_button_up
+ecore_event_evas_mouse_move
{
probeInfo_t probeInfo;
- probeBlockStart();
-
internal_angle = angle;
external_angle = internal_angle;
// {
// SCREENSHOT_DONE();
// }
-
- probeBlockEnd();
}
int getOrientation()
if(isOptionEnabled(OPT_EVENT))
{
- probeBlockStart();
if(event != NULL)
{
Ecore_Event_Key* pEv = (Ecore_Event_Key*)event;
data, type, event);
}
}
- probeBlockEnd();
}
return ecore_event_evas_key_downp(data, type, event);
if(isOptionEnabled(OPT_EVENT))
{
- probeBlockStart();
if(event != NULL)
{
Ecore_Event_Key* pEv = (Ecore_Event_Key*)event;
data, type, event);
}
}
- probeBlockEnd();
}
return ecore_event_evas_key_upp(data, type, event);
if(isOptionEnabled(OPT_EVENT))
{
- probeBlockStart();
if(event != NULL)
{
Ecore_Event_Mouse_Button* pEv = (Ecore_Event_Mouse_Button*)event;
_EVENT_TOUCH, _TOUCH_PRESSED, pEv->root.x, pEv->root.y, "", pEv->multi.device, \
data, type, event);
}
- probeBlockEnd();
}
return ecore_event_evas_mouse_button_downp(data, type, event);
if(isOptionEnabled(OPT_EVENT))
{
- probeBlockStart();
if(event != NULL)
{
Ecore_Event_Mouse_Button* pEv = (Ecore_Event_Mouse_Button*)event;
_EVENT_TOUCH, _TOUCH_RELEASED, pEv->root.x, pEv->root.y, "", pEv->multi.device, \
data, type, event);
}
- probeBlockEnd();
}
return ecore_event_evas_mouse_button_upp(data, type, event);
if(isOptionEnabled(OPT_EVENT))
{
- probeBlockStart();
if(touch_pressed)
{
if(event != NULL)
data, type, event);
}
}
- probeBlockEnd();
}
return ecore_event_evas_mouse_movep(data, type, event);
{
Ecore_X_Event_Client_Message *pClientEvent;
- probeBlockStart();
pClientEvent = (Ecore_X_Event_Client_Message*)pEvent;
if (pClientEvent != NULL) {
//This code from ecore_x
//So I don't know what 32 does mean
- if (pClientEvent->format != 32) {
- probeBlockEnd();
+ if (pClientEvent->format != 32)
return ECORE_CALLBACK_PASS_ON;
- }
if (pClientEvent->message_type ==
ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_PREPARE) {
on_orientation_changed(orientation, false);
}
}
- probeBlockEnd();
return ECORE_CALLBACK_RENEW;
}
Ecore_Event_Handler *register_orientation_event_listener()
{
Ecore_Event_Handler *handler;
- probeBlockStart();
handler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
_da_onclientmessagereceived, NULL);
- probeBlockEnd();
-
return handler;
}
void unregister_orientation_event_listener(Ecore_Event_Handler *handler)
{
- probeBlockStart();
-
if (handler)
ecore_event_handler_del(handler);
-
- probeBlockEnd();
}
EAPI int ecore_x_init(const char *name)
--- /dev/null
+#filename da_io_stdc.c
+#lib "libc.so.6"
+#feature FL_FILE_API_PROBING
+#feature_always FL_FILE_API_ALWAYS_PROBING
+clearerr
+fclose
+fdopen
+feof
+ferror
+fflush
+fgetc
+fgetpos
+fileno
+fopen
+fprintf
+fputc
+fputs
+fread
+freopen
+fscanf
+fseek
+fsetpos
+ftell
+fwrite
+getc
+getchar
+gets
+printf
+putc
+putchar
+puts
+rewind
+scanf
+setbuf
+setbuffer
+setlinebuf
+setvbuf
+tmpfile
+ungetc
+vfprintf
+vfscanf
+
+#filename da_io_posix.c
+#lib "libc.so.6"
+#feature FL_FILE_API_PROBING
+#feature_always FL_FILE_API_ALWAYS_PROBING
+close
+creat
+dup
+dup2
+fchmod
+fchown
+fcntl
+fdatasync
+fsync
+ftruncate
+futimens
+lockf
+lseek
+open
+openat
+pread
+pwrite
+read
+readv
+write
#include "binproto.h"
-static enum DaOptions _sopt = OPT_FILE;
-
static inline char *get_abs_path(int fd, const char *fname,
char *buf, size_t bufsiz)
{
GET_REAL_FUNC(close, LIBC);
- bfiltering = false;
PRE_PROBEBLOCK_BEGIN();
_fstatret = fstat(fd, &_statbuf);
PRE_PROBEBLOCK_END();
#include "binproto.h"
-static enum DaOptions _sopt = OPT_FILE;
-
static inline char *get_abs_path(FILE *file, const char *fname,
char *buf, size_t bufsiz)
{
--- /dev/null
+#filename "da_evas_gl.c"
+#lib "???"
+#feature FL_OPENGL_API_PROBING
+#feature_always FL_OPENGL_API_ALWAYS_PROBING
+evas_gl_free
+evas_gl_config_free
+evas_gl_surface_destroy
+evas_gl_context_destroy
+evas_gl_new
+evas_gl_config_new
+evas_gl_surface_create
+evas_gl_context_create
+evas_gl_make_current
+evas_gl_string_query
+evas_gl_proc_address_get
+evas_gl_native_surface_get
+evas_gl_api_get
+elm_glview_gl_api_get
+
+
+#filename "da_gl_api_init.c"
+#lib "???"
+
+#filename "da_egl_native.c"
+#lib "libEGL.so"
+eglBindAPI
+eglBindTexImage
+eglChooseConfig
+eglCopyBuffers
+eglCreateContext
+eglCreatePbufferFromClientBuffer
+eglCreatePbufferSurface
+eglCreatePixmapSurface
+eglCreateWindowSurface
+eglDestroyContext
+eglDestroySurface
+eglGetConfigAttrib
+eglGetConfigs
+eglGetCurrentContext
+eglGetCurrentDisplay
+eglGetCurrentSurface
+eglGetDisplay
+eglGetError
+eglGetProcAddress
+eglInitialize
+eglMakeCurrent
+eglQueryAPI
+eglQueryContext
+eglQueryString
+eglQuerySurface
+eglReleaseTexImage
+eglReleaseThread
+eglSurfaceAttrib
+eglSwapBuffers
+eglSwapInterval
+eglTerminate
+eglUpdateBufferOSP
+eglWaitClient
+eglWaitGL
+eglWaitNative
+
+#filename "da_egl_tizen.c"
+#lib "???"
+#feature FL_OPENGL_API_PROBING
+#feature_always FL_OPENGL_API_ALWAYS_PROBING
+_SglBindAPI
+_SglBindTexImage
+_SglChooseConfig
+_SglCopyBuffers
+_SglCreateContext
+_SglCreatePbufferFromClientBuffer
+_SglCreatePbufferSurface
+_SglCreatePixmapSurface
+_SglCreateWindowSurface
+_SglDestroyContext
+_SglDestroySurface
+_SglGetConfigAttrib
+_SglGetConfigs
+_SglGetCurrentContext
+_SglGetCurrentDisplay
+_SglGetCurrentSurface
+_SglGetDisplay
+_SglGetError
+_SglGetProcAddress
+_SglInitialize
+_SglMakeCurrent
+_SglQueryAPI
+_SglQueryContext
+_SglQueryString
+_SglQuerySurface
+_SglReleaseTexImage
+_SglReleaseThread
+_SglSurfaceAttrib
+_SglSwapBuffers
+_SglSwapInterval
+_SglTerminate
+_SglUpdateBufferOSP
+_SglWaitClient
+_SglWaitGL
+_SglWaitNative
+
+
+#filename "da_gles20_kiran.c"
+#lib "???"
+
+#filename "da_gles20_native.c"
+#lib "libGLESv2.so"
+#feature FL_OPENGL_API_PROBING
+#feature_always FL_OPENGL_API_ALWAYS_PROBING
+glActiveTexture
+glAttachShader
+glBindAttribLocation
+glBindBuffer
+glBindFramebuffer
+glBindRenderbuffer
+glBindTexture
+glBlendColor
+glBlendEquation
+glBlendEquationSeparate
+glBlendFunc
+glBlendFuncSeparate
+glBufferData
+glBufferSubData
+glClear
+glClearColor
+glClearDepthf
+glClearStencil
+glColorMask
+glCompileShader
+glCompressedTexImage2D
+glCompressedTexSubImage2D
+glCopyTexImage2D
+glCopyTexSubImage2D
+glCullFace
+glDeleteBuffers
+glDeleteFramebuffers
+glDeleteProgram
+glDeleteRenderbuffers
+glDeleteShader
+glDeleteTextures
+glDepthFunc
+glDepthMask
+glDepthRangef
+glDetachShader
+glDisable
+glDisableVertexAttribArray
+glDrawArrays
+glDrawElements
+glEnable
+glEnableVertexAttribArray
+glFinish
+glFlush
+glFramebufferRenderbuffer
+glFramebufferTexture2D
+glFrontFace
+glGenBuffers
+glGenFramebuffers
+glGenRenderbuffers
+glGenTextures
+glGenerateMipmap
+glGetBooleanv
+glGetFloatv
+glGetIntegerv
+glGetActiveAttrib
+glGetActiveUniform
+glGetAttachedShaders
+glGetAttribLocation
+glGetBufferParameteriv
+glGetFramebufferAttachmentParameteriv
+glGetProgramInfoLog
+glGetProgramiv
+glGetRenderbufferParameteriv
+glGetShaderInfoLog
+glGetShaderPrecisionFormat
+glGetShaderSource
+glGetShaderiv
+glGetTexParameterfv
+glGetTexParameteriv
+glGetUniformfv
+glGetUniformiv
+glGetVertexAttribfv
+glGetVertexAttribiv
+glGetVertexAttribPointerv
+glHint
+glLineWidth
+glLinkProgram
+glPixelStorei
+glPolygonOffset
+glReadPixels
+glReleaseShaderCompiler
+glRenderbufferStorage
+glSampleCoverage
+glScissor
+glShaderBinary
+glShaderSource
+glStencilFunc
+glStencilFuncSeparate
+glStencilMask
+glStencilMaskSeparate
+glStencilOp
+glStencilOpSeparate
+glTexImage2D
+glTexParameterf
+glTexParameterfv
+glTexParameteri
+glTexParameteriv
+glTexSubImage2D
+glUniform1f
+glUniform2f
+glUniform3f
+glUniform4f
+glUniform1fv
+glUniform2fv
+glUniform3fv
+glUniform4fv
+glUniform1i
+glUniform2i
+glUniform3i
+glUniform4i
+glUniform1iv
+glUniform2iv
+glUniform3iv
+glUniformMatrix2fv
+glUniformMatrix3fv
+glUniformMatrix4fv
+glUniform4iv
+glUseProgram
+glValidateProgram
+glVertexAttrib1f
+glVertexAttrib2f
+glVertexAttrib3f
+glVertexAttrib4f
+glVertexAttrib1fv
+glVertexAttrib2fv
+glVertexAttrib3fv
+glVertexAttrib4fv
+glVertexAttribPointer
+glViewport
+
+glCheckFramebufferStatus
+glCreateProgram
+glCreateShader
+glGetError
+glGetString
+glGetUniformLocation
+glIsBuffer
+glIsEnabled
+glIsFramebuffer
+glIsProgram
+glIsRenderbuffer
+glIsShader
+glIsTexture
+
+
+
+#filename "da_gles20_tizen.c"
+#lib "???"
+
#include "binproto.h"
#include "common_probe_init.h"
-static enum DaOptions _sopt = OPT_GLES;
-
/* Evas open gl API functions */
void evas_gl_free(Evas_GL *evas_gl)
* - Samsung RnD Institute Russia
*
*/
-
#include "da_gles20.h"
#include "daprobe.h"
#include "binproto.h"
#define TYPEDEF(type) typedef type
#endif
-static char contextValue[MAX_GL_CONTEXT_VALUE_SIZE]; /* maybe it should not be gobal static variable */
-static enum DaOptions _sopt = OPT_GLES;
+static char contextValue[MAX_GL_CONTEXT_VALUE_SIZE];
static __thread GLenum gl_error_external = GL_NO_ERROR;
static void __ui_array_to_str(char *to, GLuint *arr ,int count, size_t bufsize)
--- /dev/null
+#filename libdamemmanage.c
+#lib "libc.so.6"
+#feature FL_MEMORY_ALLOC_PROBING
+#feature_always FL_MEMORY_ALLOC_ALWAYS_PROBING
+memset
+memcmp
+memcpy
+
+
+#filename libdanew.cpp
+#lib "???"
+#feature FL_MEMORY_ALLOC_PROBING
+#feature_always FL_MEMORY_ALLOC_ALWAYS_PROBING
+void *operator new(std::size_t size) throw (std::bad_alloc)
+void *operator new[](std::size_t size) throw (std::bad_alloc)
+void operator delete(void *ptr) throw()
+void operator delete[](void *ptr) throw()
+void *operator new(std::size_t size, const std::nothrow_t& nothrow) throw()
+void *operator new[](std::size_t size, const std::nothrow_t& nothrow) throw()
+void operator delete(void *ptr, const std::nothrow_t& nothrow) throw()
+void operator delete[](void *ptr, const std::nothrow_t& nothrow) throw()
+
+
+#filename libdamemalloc.c
+#lib "libc.so.6"
+#feature FL_MEMORY_ALLOC_PROBING
+#feature_always FL_MEMORY_ALLOC_ALWAYS_PROBING
+malloc
+free
+realloc
+calloc
#include "da_memory.h"
#include "binproto.h"
-static enum DaOptions _sopt = OPT_ALLOC;
-
void *malloc(size_t size)
{
static void* (*mallocp)(size_t);
pret = (*mallocp)(size);
- if(pret != NULL && gProbeBlockCount == 0)
+ if(pret != NULL)
add_memory_hash(pret, size, MEMTYPE_ALLOC,
blockresult ? MEM_EXTERNAL : MEM_INTERNAL);
PRE_PROBEBLOCK();
- if(ptr != NULL && gProbeBlockCount == 0)
+ if(ptr != NULL)
del_memory_hash(ptr, MEMTYPE_FREE, NULL);
(*freep)(ptr);
rtdl_next_current_set_once(reallocp);
PRE_PROBEBLOCK();
- if(memblock != NULL && gProbeBlockCount == 0)
+ if(memblock != NULL)
del_memory_hash(memblock, MEMTYPE_FREE, NULL);
pret = (*reallocp)(memblock, size);
- if(pret != NULL && gProbeBlockCount == 0)
+ if(pret != NULL)
add_memory_hash(pret, size, MEMTYPE_ALLOC,
blockresult ? MEM_EXTERNAL : MEM_INTERNAL);
pret = (*callocp)(nelem, elsize);
- if(pret != NULL && gProbeBlockCount == 0)
+ if(pret != NULL)
add_memory_hash(pret, nelem * elsize, MEMTYPE_ALLOC,
blockresult ? MEM_EXTERNAL : MEM_INTERNAL);
#include "binproto.h"
#include "common_probe_init.h"
-static enum DaOptions _sopt = OPT_ALLOC;
void *memset(void *memblock, int c, size_t n)
{
#include "da_memory.h"
#include "binproto.h"
-static enum DaOptions _sopt = OPT_ALLOC;
void *operator new(std::size_t size) throw (std::bad_alloc)
{
GET_REAL_FUNCP_RTLD_NEXT_CPP(_Znwj,newp);
- bfiltering = INTERNAL_NEW_FILTERING;
PRE_PROBEBLOCK();
pret = newp(size);
- if(pret != NULL && gProbeBlockCount == 0)
+ if(pret != NULL)
{
add_memory_hash(pret, size, MEMTYPE_NEW, blockresult ? MEM_EXTERNAL : MEM_INTERNAL);
}
GET_REAL_FUNCP_RTLD_NEXT_CPP(_Znaj, newp);
- bfiltering = INTERNAL_NEW_FILTERING;
PRE_PROBEBLOCK();
pret = newp(size);
- if(pret != NULL && gProbeBlockCount == 0)
+ if(pret != NULL)
{
add_memory_hash(pret, size, MEMTYPE_NEW, blockresult ? MEM_EXTERNAL : MEM_INTERNAL);
}
GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZdlPv, deletep);
- bfiltering = INTERNAL_DELETE_FILTERING;
PRE_PROBEBLOCK();
- if(ptr != NULL && gProbeBlockCount == 0)
+ if(ptr != NULL)
{
- probeBlockStart();
ret = del_memory_hash(ptr, MEMTYPE_DELETE, &caller);
if(blockresult == 0 && ret == 0 && caller == MEM_EXTERNAL)
{
blockresult = 2;
probingStart();
}
- probeBlockEnd();
}
deletep(ptr);
GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZdaPv, deletep);
- bfiltering = INTERNAL_DELETE_FILTERING;
PRE_PROBEBLOCK();
- if(ptr != NULL && gProbeBlockCount == 0)
+ if(ptr != NULL)
{
- probeBlockStart();
ret = del_memory_hash(ptr, MEMTYPE_DELETE, &caller);
if(blockresult == 0 && ret == 0 && caller == MEM_EXTERNAL)
{
blockresult = 2;
probingStart();
}
- probeBlockEnd();
}
deletep(ptr);
GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZnwjRKSt9nothrow_t, newp);
- bfiltering = INTERNAL_NEW_FILTERING;
PRE_PROBEBLOCK();
pret = newp(size, nothrow);
- if(pret != NULL && gProbeBlockCount == 0)
+ if(pret != NULL)
{
add_memory_hash(pret, size, MEMTYPE_NEW, blockresult ? MEM_EXTERNAL : MEM_INTERNAL);
}
GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZnajRKSt9nothrow_t, newp);
- bfiltering = INTERNAL_NEW_FILTERING;
PRE_PROBEBLOCK();
pret = newp(size, nothrow);
- if(pret != NULL && gProbeBlockCount == 0)
+ if(pret != NULL)
{
add_memory_hash(pret, size, MEMTYPE_NEW, blockresult ? MEM_EXTERNAL : MEM_INTERNAL);
}
GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZdlPvRKSt9nothrow_t, deletep);
- bfiltering = INTERNAL_DELETE_FILTERING;
PRE_PROBEBLOCK();
- if(ptr != NULL && gProbeBlockCount == 0)
+ if(ptr != NULL)
{
- probeBlockStart();
ret = del_memory_hash(ptr, MEMTYPE_DELETE, &caller);
if(blockresult == 0 && ret == 0 && caller == MEM_EXTERNAL)
{
blockresult = 2;
probingStart();
}
- probeBlockEnd();
}
deletep(ptr, nothrow);
GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZdaPvRKSt9nothrow_t, deletep);
- bfiltering = INTERNAL_DELETE_FILTERING;
PRE_PROBEBLOCK();
- if(ptr != NULL && gProbeBlockCount == 0)
+ if(ptr != NULL)
{
- probeBlockStart();
ret = del_memory_hash(ptr, MEMTYPE_DELETE, &caller);
if(blockresult == 0 && ret == 0 && caller == MEM_EXTERNAL)
{
blockresult = 2;
probingStart();
}
- probeBlockEnd();
}
deletep(ptr, nothrow);
--- /dev/null
+#filename libdasocket.c
+#lib "libc.so.6"
+#feature FL_NETWORK_API_PROBING
+#feature_always FL_NETWORK_API_ALWAYS_PROBING
+accept
+accept4
+#be16toh
+#be32toh
+#be64toh
+bind
+connect
+#endhostent
+#endnetent
+#endprotoent
+#endservent
+epoll_create
+epoll_create1
+epoll_ctl
+epoll_pwait
+epoll_wait
+#freeaddrinfo
+#freeifaddrs
+#gai_cancel
+#gai_error
+#gai_strerror
+#gai_suspend
+#getaddrinfo
+#getaddrinfo_a
+#getdomainname
+#gethostbyaddr
+#gethostbyaddr_r
+#gethostbyname
+#gethostbyname2
+#gethostbyname2_r
+#gethostbyname_r
+#gethostent
+#gethostent_r
+#gethostname
+#getifaddrs
+#getnameinfo
+#getnetbyaddr
+#getnetbyaddr_r
+#getnetbyname
+#getnetbyname_r
+#getnetent
+#getnetent_r
+getpeername
+#getprotobyname
+#getprotobyname_r
+#getprotobynumber
+#getprotobynumber_r
+#getprotoent
+#getprotoent_r
+#getservbyname
+#getservbyname_r
+#getservbyport
+#getservbyport_r
+#getservent
+#getservent_r
+getsockname
+getsockopt
+#herror
+#hstrerror
+#htobe16
+#htobe32
+#htobe64
+#htole16
+#htole32
+#htole64
+#htonl
+#htons
+#if_freenameindex
+#if_indextoname
+#if_nameindex
+#if_nametoindex
+#inet_addr
+#inet_aton
+#inet_lnaof
+#inet_makeaddr
+#inet_netof
+#inet_network
+#inet_ntoa
+#inet_ntop
+#inet_pton
+isfdtype
+#le16toh
+#le32toh
+#le64toh
+listen
+#ntohl
+#ntohs
+poll
+ppoll
+pselect
+recv
+recvfrom
+recvmsg
+select
+send
+sendmsg
+sendto
+#setdomainname
+#sethostent
+#sethostname
+#setnetent
+#setprotoent
+#setservent
+setsockopt
+shutdown
+sockatmark
+socket
+socketpair
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(); \
- PRE_PROBEBLOCK_END()
+ POST_PROBEBLOCK_FUNC_START_END()
#define POST_PROBEBLOCK_FUNC_START_BEGIN(LCTYPE, RTYPE, RETVALUE, INPUTFORMAT, ...) \
newerrno = errno; \
- if(postBlockBegin(blockresult)) { \
+ do { \
PREPARE_LOCAL_BUF(); \
PACK_COMMON_BEGIN(MSG_PROBE_NETWORK, vAPI_ID, INPUTFORMAT, __VA_ARGS__);\
PACK_COMMON_END(RTYPE, RETVALUE, errno, blockresult)
#define POST_PROBEBLOCK_FUNC_END_BEGIN(LCTYPE, RTYPE, RETVALUE, INPUTFORMAT, ...) \
newerrno = errno; \
- if(postBlockBegin(blockresult)) { \
+ do { \
setProbePoint(&probeInfo); \
PREPARE_LOCAL_BUF(); \
PACK_COMMON_BEGIN(MSG_PROBE_NETWORK, vAPI_ID, INPUTFORMAT, __VA_ARGS__);\
POST_PROBEBLOCK_END()
#define POST_PROBEBLOCK_TIZEN_BEGIN(APINAME, LCTYPE, RTYPE, RETVALUE, INPUTFORMAT, ...) \
- if(postBlockBegin(blockresult)) { \
+ do { \
PREPARE_LOCAL_BUF(); \
PACK_COMMON_BEGIN(MSG_PROBE_NETWORK, vAPI_ID, INPUTFORMAT, __VA_ARGS__);\
PACK_COMMON_END(RTYPE, RETVALUE, errno, blockresult)
probeInfo.currentTime, probeInfo.pID, probeInfo.tID)
#define POST_PROBEBLOCK_TIZEN_FUNC_START_BEGIN(APINAME, LCTYPE, RTYPE, RETVALUE, INPUTFORMAT, ...) \
- if(postBlockBegin(blockresult)) { \
+ do { \
PREPARE_LOCAL_BUF(); \
PACK_COMMON_BEGIN(MSG_PROBE_NETWORK, vAPI_ID, INPUTFORMAT, __VA_ARGS__);\
PACK_COMMON_END(RTYPE, RETVALUE, errno, blockresult)
#define POST_PROBEBLOCK_TIZEN_FUNC_END_BEGIN(APINAME, LCTYPE, RTYPE, RETVALUE, INPUTFORMAT, ...) \
- if(postBlockBegin(blockresult)) { \
+ do { \
setProbePoint(&probeInfo); \
PREPARE_LOCAL_BUF(); \
PACK_COMMON_BEGIN(MSG_PROBE_NETWORK, vAPI_ID, INPUTFORMAT, __VA_ARGS__);\
#define OBJ_DUMMY 0
-static enum DaOptions _sopt = OPT_NETWORK;
void getAddress(const struct sockaddr *sa, char *address) {
char buff[INET6_ADDRSTRLEN];
char *path;
--- /dev/null
+#filename libdaemon.c
+#lib "???"
+#feature ---
+daemon_close_allv
GET_REAL_FUNCP(daemon_close_allv, LIBDAEMON, daemon_close_allvp);
- probeBlockStart();
// get number of fds
for(i = 0; ; i++)
{
{
// do nothing
}
- probeBlockEnd();
// call original function
if(fds)
ret = daemon_close_allvp(except_fds);
}
- probeBlockStart();
saved_errno = errno;
free(fds);
errno = saved_errno;
- probeBlockEnd();
return ret;
}
--- /dev/null
+#filename libdasync.c
+#lib "libpthread.so.0"
+#feature FL_THREAD_API_PROBING
+#feature_always FL_THREAD_API_ALWAYS_PROBING
+pthread_mutex_init
+pthread_mutex_destroy
+real_pthread_mutex_lock
+pthread_mutex_lock
+pthread_mutex_timedlock
+pthread_mutex_trylock
+real_pthread_mutex_unlock
+pthread_mutex_unlock
+pthread_mutexattr_init
+pthread_mutexattr_destroy
+pthread_mutexattr_getprioceiling
+pthread_mutexattr_setprioceiling
+pthread_mutexattr_getprotocol
+pthread_mutexattr_setprotocol
+pthread_mutexattr_getpshared
+pthread_mutexattr_setpshared
+pthread_mutexattr_gettype
+pthread_mutexattr_settype
+pthread_cond_init
+pthread_cond_destroy
+pthread_cond_wait
+pthread_cond_timedwait
+pthread_cond_signal
+pthread_cond_broadcast
+
+#filename libdathread.c
+#lib "libpthread.so.0"
+#feature FL_THREAD_API_PROBING
+#feature_always FL_THREAD_API_ALWAYS_PROBING
+_da_cleanup_handler
+_da_ThreadProc
+pthread_create
+pthread_join
+pthread_exit
+pthread_cancel
+pthread_detach
+pthread_self
+pthread_equal
+pthread_setcancelstate
+pthread_setcanceltype
+pthread_attr_init
+pthread_attr_destroy
+pthread_attr_getdetachstate
+pthread_attr_setdetachstate
+pthread_attr_getstacksize
+pthread_attr_setstacksize
+pthread_attr_getstackaddr
+pthread_attr_setstackaddr
+pthread_attr_getinheritsched
+pthread_attr_setinheritsched
+pthread_attr_getschedparam
+pthread_attr_setschedparam
+pthread_attr_getschedpolicy
+pthread_attr_setschedpolicy
+pthread_attr_getguardsize
+pthread_attr_setguardsize
+pthread_attr_getscope
+pthread_attr_setscope
+pthread_attr_getstack
+pthread_attr_setstack
#include "binproto.h"
-static enum DaOptions _sopt = OPT_THREAD;
int pthread_mutex_init(pthread_mutex_t *mutex,
const pthread_mutexattr_t *attr) {
// send WAIT_END log
newerrno = errno;
- if(postBlockBegin(blockresult)) {
- setProbePoint(&probeInfo);
+ setProbePoint(&probeInfo);
- PREPARE_LOCAL_BUF();
- PACK_COMMON_BEGIN(MSG_PROBE_SYNC,
- API_ID_pthread_mutex_lock,
- "p", voidp_to_uint64(mutex));
- PACK_COMMON_END('d', ret, errno, blockresult);
- PACK_SYNC(mutex, SYNC_PTHREAD_MUTEX, SYNC_API_ACQUIRE_WAIT_END);
- FLUSH_LOCAL_BUF();
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_SYNC,
+ API_ID_pthread_mutex_lock,
+ "p", voidp_to_uint64(mutex));
+ PACK_COMMON_END('p', ret, errno, blockresult);
+ PACK_SYNC(mutex, SYNC_PTHREAD_MUTEX, SYNC_API_ACQUIRE_WAIT_END);
+ FLUSH_LOCAL_BUF();
- postBlockEnd();
- }
- errno = (newerrno != 0) ? newerrno : olderrno;
+ postBlockEnd();
+ errno = (newerrno != 0) ? newerrno : olderrno;
return ret;
}
// send WAIT_END log
newerrno = errno;
- if(postBlockBegin(blockresult)) {
- setProbePoint(&probeInfo);
+ setProbePoint(&probeInfo);
- PREPARE_LOCAL_BUF();
- PACK_COMMON_BEGIN(MSG_PROBE_SYNC,
- API_ID_pthread_mutex_timedlock,
- "pp", voidp_to_uint64(mutex),
- voidp_to_uint64(abs_timeout));
- PACK_COMMON_END('d', ret, errno, blockresult);
- PACK_SYNC(mutex, SYNC_PTHREAD_MUTEX, SYNC_API_ACQUIRE_WAIT_END);
- FLUSH_LOCAL_BUF();
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_SYNC,
+ API_ID_pthread_mutex_timedlock,
+ "pp", voidp_to_uint64(mutex),
+ voidp_to_uint64(abs_timeout));
+ PACK_COMMON_END('d', ret, errno, blockresult);
+ PACK_SYNC(mutex, SYNC_PTHREAD_MUTEX, SYNC_API_ACQUIRE_WAIT_END);
+ FLUSH_LOCAL_BUF();
- postBlockEnd();
- }
+ postBlockEnd();
- errno = (newerrno != 0) ? newerrno : olderrno;
+ errno = (newerrno != 0) ? newerrno : olderrno;
return ret;
}
// send WAIT_END log
newerrno = errno;
- if(postBlockBegin(blockresult)) {
setProbePoint(&probeInfo);
- PREPARE_LOCAL_BUF();
- PACK_COMMON_BEGIN(MSG_PROBE_SYNC,
- API_ID_pthread_cond_wait,
- "pp",
- voidp_to_uint64(cond),
- voidp_to_uint64(mutex));
- PACK_COMMON_END('d', ret, errno, blockresult);
- PACK_SYNC(cond, SYNC_PTHREAD_COND_VARIABLE, SYNC_API_COND_WAIT_END);
- FLUSH_LOCAL_BUF();
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_SYNC,
+ API_ID_pthread_cond_wait,
+ "pp",
+ voidp_to_uint64(cond),
+ voidp_to_uint64(mutex));
+ PACK_COMMON_END('d', ret, errno, blockresult);
+ PACK_SYNC(cond, SYNC_PTHREAD_COND_VARIABLE, SYNC_API_COND_WAIT_END);
+ FLUSH_LOCAL_BUF();
- postBlockEnd();
- }
- errno = (newerrno != 0) ? newerrno : olderrno;
+ postBlockEnd();
+ errno = (newerrno != 0) ? newerrno : olderrno;
return ret;
}
// send WAIT_END log
newerrno = errno;
- if(postBlockBegin(blockresult)) {
- setProbePoint(&probeInfo);
+ setProbePoint(&probeInfo);
+
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_SYNC,
+ API_ID_pthread_cond_timedwait,
+ "ppp",
+ voidp_to_uint64(cond),
+ voidp_to_uint64(mutex),
+ voidp_to_uint64(abstime));
+ PACK_COMMON_END('d', ret, errno, blockresult);
+ PACK_SYNC(cond, SYNC_PTHREAD_COND_VARIABLE, SYNC_API_COND_WAIT_END);
+ FLUSH_LOCAL_BUF();
+
+ postBlockEnd();
- PREPARE_LOCAL_BUF();
- PACK_COMMON_BEGIN(MSG_PROBE_SYNC,
- API_ID_pthread_cond_timedwait,
- "ppp",
- voidp_to_uint64(cond),
- voidp_to_uint64(mutex),
- voidp_to_uint64(abstime));
- PACK_COMMON_END('d', ret, errno, blockresult);
- PACK_SYNC(cond, SYNC_PTHREAD_COND_VARIABLE, SYNC_API_COND_WAIT_END);
- FLUSH_LOCAL_BUF();
-
- postBlockEnd();
- }
-
- errno = (newerrno != 0) ? newerrno : olderrno;
+ errno = (newerrno != 0) ? newerrno : olderrno;
return ret;
}
void *argument;
} thread_routine_call;
-static enum DaOptions _sopt = OPT_THREAD;
-
// called when pthread_exit, pthread_cancel is called
void _da_cleanup_handler(void *data)
{
if(blockresult)
{
- probeBlockStart();
thread_routine_call *ptrc =
(thread_routine_call *) malloc(sizeof(thread_routine_call));
ptrc->thread_routine = start_routine;
ptrc->argument = arg;
- probeBlockEnd();
ret = pthread_createp(thread, attr, _da_ThreadProc, (void *) ptrc);
}
// send WAIT_END log
newerrno = errno;
- if(postBlockBegin(blockresult)) {
- setProbePoint(&probeInfo);
-
- PREPARE_LOCAL_BUF();
- PACK_COMMON_BEGIN(MSG_PROBE_THREAD,
- API_ID_pthread_join,
- "xp",
- (uint64_t)(thread),
- voidp_to_uint64(retval));
- PACK_COMMON_END('d', ret, errno, blockresult);
- PACK_THREAD(thread, THREAD_PTHREAD, THREAD_API_WAIT_END, THREAD_CLASS_BLANK);
- FLUSH_LOCAL_BUF();
-
- postBlockEnd();
- }
+ setProbePoint(&probeInfo);
- errno = (newerrno != 0) ? newerrno : olderrno;
+ PREPARE_LOCAL_BUF();
+ PACK_COMMON_BEGIN(MSG_PROBE_THREAD,
+ API_ID_pthread_join,
+ "xp",
+ (uint64_t)(thread),
+ voidp_to_uint64(retval));
+ PACK_COMMON_END('d', ret, errno, blockresult);
+ PACK_THREAD(thread, THREAD_PTHREAD, THREAD_API_WAIT_END, THREAD_CLASS_BLANK);
+ FLUSH_LOCAL_BUF();
+
+ postBlockEnd();
+
+ errno = (newerrno != 0) ? newerrno : olderrno;
return ret;
}
--- /dev/null
+#filename capi_capture.c
+#lib "libelementary.so.1"
+#feature ---
+elm_win_add
+elm_controlbar_add
+elm_naviframe_add
+elm_pager_add
#define AFTER_ORIGINAL_SNAPSHOT(EVASOBJECT) \
do { \
- probeBlockStart(); \
evas_event_callback_add(evas_object_evas_get(EVASOBJECT), \
EVAS_CALLBACK_RENDER_FLUSH_POST, \
_cb_render_post, NULL); \
- probeBlockEnd(); \
} while(0)
#endif // __DA_SNAPSHOT_H__
--- /dev/null
+#filename libdauserfunc.c
+#lib "???"
void *profil_log_func(void __unused * data)
{
- probeBlockStart();
-
sigset_t profsigmask;
sigemptyset(&profsigmask);
sigaddset(&profsigmask, SIGPROF);
}
usleep(PROFIL_LOG_SENDING_INTERVAL_USEC);
}
- probeBlockEnd();
return NULL;
}
sigaddset(&profsigmask, SIGPROF);
pthread_sigmask(SIG_BLOCK, &profsigmask, &oldsigmask);
- probeBlockStart();
do {
// remove custom chart callback function
if(gTraceInfo.custom_chart_callback_count > 0)
elapsed_time_index++;
} while(0);
- probeBlockEnd();
pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL);
return;
sigaddset(&profsigmask, SIGPROF);
pthread_sigmask(SIG_BLOCK, &profsigmask, &oldsigmask);
- probeBlockStart();
do {
// remove custom chart callback function
if(gTraceInfo.custom_chart_callback_count > 0)
setProbePoint(&probeInfo);
} while(0);
- probeBlockEnd();
pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL);
return;
if((pc >= (void*)(&profil_count - 0x18)) && (pc <= (void*)(&profil_count)))
return;
#endif
- if(gProbeBlockCount != 0)
- return;
-
- probeBlockStart();
real_pthread_mutex_lock(&profil_log_mutex);
do {
sample_write_index = (sample_write_index + 1) % SAMPLE_MAX_IN_INTERVAL;
} while(0);
real_pthread_mutex_unlock(&profil_log_mutex);
-
- probeBlockEnd();
}
#if defined(__i386__)
high_pc = highpc;
pthread_mutex_init(&profil_log_mutex, NULL);
- probeBlockStart();
profil_thread_on = 1;
__profil(profil_option);
if(pthread_create(&profil_log_thread, NULL, &profil_log_func, NULL) < 0)
{
perror("Fail to create profil_log thread");
}
- probeBlockEnd();
return;
}
+++ /dev/null
-result UiApp::Execute(UiAppInstanceFactory pUiAppFactory, const IList* pArguments)
-void _AppImpl::OnTerminate(void* user_data)
-void _AppInfo::SetAppState(AppState appState)
-void _UiAppImpl::OnBackground(void)
-void _UiAppImpl::OnForeground(void)
-
-result Mutex::Create(void)
-result Mutex::Create(const Tizen::Base::String& name)
-result Mutex::Release(void)
-result Mutex::Acquire(void)
-result Mutex::TryToAcquire(void)
-result Semaphore::Create(int count)
-result Semaphore::Create(const Tizen::Base::String& name, int count)
-result Semaphore::Acquire(long timeout)
-result Semaphore::TryToAcquire(void)
-result Semaphore::Release(void)
-result Monitor::Construct(void)
-result Monitor::Enter(void)
-result Monitor::Exit(void)
-result Monitor::Wait(void)
-result Monitor::Notify(void)
-result Monitor::NotifyAll(void)
-
-void *_ThreadImpl::ThreadProc(void* params)
-result Thread::Sleep(long milliSeconds)
-result Thread::Yield(void)
-result Thread::Exit(int exitCode)
-result Thread::Construct(ThreadType threadType, long stackSize, ThreadPriority priority)
-result Thread::Construct(long stackSize, ThreadPriority priority)
-result Thread::Construct(const Tizen::Base::String &name, long stackSize, ThreadPriority priority)
-result Thread::Construct(const Tizen::Base::String &name, ThreadType threadType, long stackSize, ThreadPriority priority)
-result Thread::Construct(IRunnable &target, long stackSize, ThreadPriority priority)
-result Thread::Construct(const Tizen::Base::String &name, IRunnable &target, long stackSize, ThreadPriority priority)
-result Thread::GetExitCode(int &exitCode) const
-const Tizen::Base::String & Thread::GetName(void) const
-result Thread::Join(void)
-result Thread::Start(void)
-result Thread::Stop(void)
-result EventDrivenThread::Construct(long stackSize, ThreadPriority priority)
-result EventDrivenThread::Construct(const Tizen::Base::String &name, long stackSize, ThreadPriority priority)
-result EventDrivenThread::Quit()
-
-result File::Construct(const Tizen::Base::String& filePath, const Tizen::Base::String& openMode, bool createParentDirectories)
-result File::Construct(const Tizen::Base::String& filePath, const Tizen::Base::String& openMode)
-result File::Construct(const Tizen::Base::String& filePath, const char *pOpenMode)
-result File::Construct(const Tizen::Base::String& filePath, const char *pOpenMode, const Tizen::Base::ByteBuffer& secretKey)
-result File::Flush(void)
-Tizen::Base::String File::GetName(void) const
-result File::Read(Tizen::Base::String& buffer)
-result File::Read(Tizen::Base::ByteBuffer& buffer)
-int File::Read(void *buffer, int length)
-result File::Seek(FileSeekPosition position, long offset)
-int File::Tell(void) const
-result File::Truncate(int length)
-result File::Write(const void *buffer, int length)
-result File::Write(const Tizen::Base::ByteBuffer& buffer)
-result File::Write(const Tizen::Base::String& buffer)
-File::~File(void)
-
-result UiApp::AddFrame(const Tizen::Ui::Controls::Frame& frame)
-result UiApp::RemoveFrame(const Tizen::Ui::Controls::Frame &frame)
-void Control::SetName(const Tizen::Base::String &name)
-result Container::AddControl(const Control &control)
-result Container::RemoveControl(const Control &control)
-result Container::RemoveControl(int index)
-void Container::RemoveAllControls(void)
-
-_chart_timerThread
-da_mark
-da_create_chart
-da_create_series
-da_log
-
-malloc
-free
-realloc
-calloc
-
-void *operator new(std::size_t size) throw (std::bad_alloc)
-void *operator new[](std::size_t size) throw (std::bad_alloc)
-void operator delete(void *ptr) throw()
-void operator delete[](void *ptr) throw()
-void *operator new(std::size_t size, const std::nothrow_t& nothrow) throw()
-void *operator new[](std::size_t size, const std::nothrow_t& nothrow) throw()
-void operator delete(void *ptr, const std::nothrow_t& nothrow) throw()
-void operator delete[](void *ptr, const std::nothrow_t& nothrow) throw()
-
-memset
-memcmp
-memcpy
-
-_dalc_app_create
-_dalc_app_terminate
-_dalc_app_pause
-_dalc_app_resume
-_dalc_app_service
-
-_da_cleanup_handler
-_da_ThreadProc
-pthread_create
-pthread_join
-pthread_exit
-pthread_cancel
-pthread_detach
-pthread_self
-pthread_equal
-pthread_setcancelstate
-pthread_setcanceltype
-pthread_attr_init
-pthread_attr_destroy
-pthread_attr_getdetachstate
-pthread_attr_setdetachstate
-pthread_attr_getstacksize
-pthread_attr_setstacksize
-pthread_attr_getstackaddr
-pthread_attr_setstackaddr
-pthread_attr_getinheritsched
-pthread_attr_setinheritsched
-pthread_attr_getschedparam
-pthread_attr_setschedparam
-pthread_attr_getschedpolicy
-pthread_attr_setschedpolicy
-pthread_attr_getguardsize
-pthread_attr_setguardsize
-pthread_attr_getscope
-pthread_attr_setscope
-pthread_attr_getstack
-pthread_attr_setstack
-
-pthread_mutex_init
-pthread_mutex_destroy
-real_pthread_mutex_lock
-pthread_mutex_lock
-pthread_mutex_timedlock
-pthread_mutex_trylock
-real_pthread_mutex_unlock
-pthread_mutex_unlock
-pthread_mutexattr_init
-pthread_mutexattr_destroy
-pthread_mutexattr_getprioceiling
-pthread_mutexattr_setprioceiling
-pthread_mutexattr_getprotocol
-pthread_mutexattr_setprotocol
-pthread_mutexattr_getpshared
-pthread_mutexattr_setpshared
-pthread_mutexattr_gettype
-pthread_mutexattr_settype
-pthread_cond_init
-pthread_cond_destroy
-pthread_cond_wait
-pthread_cond_timedwait
-pthread_cond_signal
-pthread_cond_broadcast
-
-open
-openat
-creat
-close
-access
-faccessat
-lseek
-fsync
-fdatasync
-truncate
-ftruncate
-mkfifo
-mkfifoat
-mknod
-mknodat
-chown
-fchownat
-fchown
-lchown
-lockf
-chmod
-fchmodat
-fchmod
-pread
-read
-pwrite
-write
-readv
-rmdir
-fchdir
-chdir
-link
-linkat
-unlink
-unlinkat
-symlink
-symlinkat
-readlink
-readlinkat
-mkdir
-mkdirat
-closedir
-fdopendir
-opendir
-readdir
-readdir_r
-rewinddir
-seekdir
-telldir
-fcntl
-dup
-dup2
-fstatat
-lstat
-futimens
-utimensat
-utimes
-utime
-
-clearerr
-fclose
-fdopen
-feof
-ferror
-fflush
-fgetc
-fgetpos
-fileno
-fopen
-fprintf
-fputc
-fputs
-fread
-freopen
-fscanf
-fseek
-fsetpos
-fwrite
-getc
-getchar
-gets
-int
-perror
-printf
-putc
-putchar
-puts
-remove
-rename
-rewind
-scanf
-setbuf
-setbuffer
-setlinebuf
-setvbuf
-tmpnam
-ungetc
-vfprintf
-vfscanf
-
-void SceneManagerEventListener::OnSceneTransitionCompleted(const SceneId &previousSceneId, const SceneId ¤tSceneId)
-
-void GestureEventListener::OnCustomGestureCanceled (TouchGestureDetector &gestureDetector)
-void GestureEventListener::OnCustomGestureChanged (TouchGestureDetector &gestureDetector)
-void GestureEventListener::OnCustomGestureFinished (TouchGestureDetector &gestureDetector)
-void GestureEventListener::OnCustomGestureStarted (TouchGestureDetector &gestureDetector)
-void GestureEventListener::OnFlickGestureCanceled (TouchFlickGestureDetector &gestureDetector)
-void GestureEventListener::OnFlickGestureDetected (TouchFlickGestureDetector &gestureDetector)
-void GestureEventListener::OnLongPressGestureCanceled (TouchLongPressGestureDetector &gestureDetector)
-void GestureEventListener::OnLongPressGestureDetected (TouchLongPressGestureDetector &gestureDetector)
-void GestureEventListener::OnPanningGestureCanceled (TouchPanningGestureDetector &gestureDetector)
-void GestureEventListener::OnPanningGestureChanged (TouchPanningGestureDetector &gestureDetector)
-void GestureEventListener::OnPanningGestureFinished (TouchPanningGestureDetector &gestureDetector)
-void GestureEventListener::OnPanningGestureStarted (TouchPanningGestureDetector &gestureDetector)
-void GestureEventListener::OnPinchGestureCanceled (TouchPinchGestureDetector &gestureDetector)
-void GestureEventListener::OnPinchGestureChanged (TouchPinchGestureDetector &gestureDetector)
-void GestureEventListener::OnPinchGestureFinished (TouchPinchGestureDetector &gestureDetector)
-void GestureEventListener::OnPinchGestureStarted (TouchPinchGestureDetector &gestureDetector)
-void GestureEventListener::OnRotationGestureCanceled (TouchRotationGestureDetector &gestureDetector)
-void GestureEventListener::OnRotationGestureChanged (TouchRotationGestureDetector &gestureDetector)
-void GestureEventListener::OnRotationGestureFinished (TouchRotationGestureDetector &gestureDetector)
-void GestureEventListener::OnRotationGestureStarted (TouchRotationGestureDetector &gestureDetector)
-void GestureEventListener::OnTapGestureCanceled (TouchTapGestureDetector &gestureDetector)
-void GestureEventListener::OnTapGestureDetected (TouchTapGestureDetector &gestureDetector)
-
-on_orientation_changed
-
-ecore_event_evas_key_down
-ecore_event_evas_key_up
-ecore_event_evas_mouse_button_down
-ecore_event_evas_mouse_button_up
-ecore_event_evas_mouse_move
-
-elm_glview_gl_api_get
-
-evas_gl_free
-evas_gl_config_free
-evas_gl_surface_destroy
-evas_gl_context_destroy
-evas_gl_new
-evas_gl_config_new
-evas_gl_surface_create
-evas_gl_context_create
-evas_gl_make_current
-evas_gl_string_query
-evas_gl_proc_address_get
-evas_gl_native_surface_get
-evas_gl_api_get
-
-accept
-accept4
-bind
-gai_strerror
-hstrerror
-inet_ntop
-connect
-endhostent
-endnetent
-endprotoent
-endservent
-freeaddrinfo
-freeifaddrs
-gai_cancel
-gai_error
-gai_suspend
-getaddrinfo
-getaddrinfo_a
-getdomainname
-gethostbyaddr_r
-gethostbyname2_r
-gethostbyname_r
-gethostent_r
-gethostname
-getifaddrs
-getnameinfo
-getnetbyaddr_r
-getnetbyname_r
-getnetent_r
-getpeername
-getprotobyname_r
-getprotobynumber_r
-getprotoent_r
-getservbyname_r
-getservbyport_r
-getservent_r
-getsockname
-getsockopt
-herror
-gethostbyaddr
-gethostbyname
-gethostbyname2
-gethostent
-htonl
-htons
-if_freenameindex
-if_indextoname
-if_nameindex
-inet_makeaddr
-inet_addr
-inet_aton
-inet_lnaof
-inet_netof
-inet_network
-inet_ntoa
-inet_pton
-if_nametoindex
-le32toh
-le64toh
-listen
-getnetbyaddr
-getnetbyname
-getnetent
-ntohl
-ntohs
-getprotobyname
-getprotobynumber
-getprotoent
-pselect
-recv
-recvfrom
-recvmsg
-select
-send
-sendmsg
-sendto
-getservbyname
-getservbyport
-getservent
-setdomainname
-sethostent
-sethostname
-setnetent
-setprotoent
-setservent
-setsockopt
-shutdown
-socket
-socketpair
-sockatmark
-isfdtype
-poll
-ppoll
-epoll_create
-epoll_create1
-epoll_wait
-epoll_pwait
-epoll_ctl
-
-Thread* Thread::GetCurrentThread(void)
-
-tmpfile
-ftell
-
-captureScreen
-result Container::AddControl(Control* control)
-result Container::RemoveControl(Control* control)
-
-glActiveTexture
-glAttachShader
-glBindAttribLocation
-glBindBuffer
-glBindFramebuffer
-glBindRenderbuffer
-glBindTexture
-glBlendColor
-glBlendEquation
-glBlendEquationSeparate
-glBlendFunc
-glBlendFuncSeparate
-glBufferData
-glBufferSubData
-glClear
-glClearColor
-glClearDepthf
-glClearStencil
-glColorMask
-glCompileShader
-glCompressedTexImage2D
-glCompressedTexSubImage2D
-glCopyTexImage2D
-glCopyTexSubImage2D
-glCullFace
-glDeleteBuffers
-glDeleteFramebuffers
-glDeleteProgram
-glDeleteRenderbuffers
-glDeleteShader
-glDeleteTextures
-glDepthFunc
-glDepthMask
-glDepthRangef
-glDetachShader
-glDisable
-glDisableVertexAttribArray
-glDrawArrays
-glDrawElements
-glEnable
-glEnableVertexAttribArray
-glFinish
-glFlush
-glFramebufferRenderbuffer
-glFramebufferTexture2D
-glFrontFace
-glGenBuffers
-glGenFramebuffers
-glGenRenderbuffers
-glGenTextures
-glGenerateMipmap
-glGetBooleanv
-glGetFloatv
-glGetIntegerv
-glGetActiveAttrib
-glGetActiveUniform
-glGetAttachedShaders
-glGetAttribLocation
-glGetBufferParameteriv
-glGetFramebufferAttachmentParameteriv
-glGetProgramInfoLog
-glGetProgramiv
-glGetRenderbufferParameteriv
-glGetShaderInfoLog
-glGetShaderPrecisionFormat
-glGetShaderSource
-glGetShaderiv
-glGetTexParameterfv
-glGetTexParameteriv
-glGetUniformfv
-glGetUniformiv
-glGetVertexAttribfv
-glGetVertexAttribiv
-glGetVertexAttribPointerv
-glHint
-glLineWidth
-glLinkProgram
-glPixelStorei
-glPolygonOffset
-glReadPixels
-glReleaseShaderCompiler
-glRenderbufferStorage
-glSampleCoverage
-glScissor
-glShaderBinary
-glShaderSource
-glStencilFunc
-glStencilFuncSeparate
-glStencilMask
-glStencilMaskSeparate
-glStencilOp
-glStencilOpSeparate
-glTexImage2D
-glTexParameterf
-glTexParameterfv
-glTexParameteri
-glTexParameteriv
-glTexSubImage2D
-glUniform1f
-glUniform2f
-glUniform3f
-glUniform4f
-glUniform1fv
-glUniform2fv
-glUniform3fv
-glUniform4fv
-glUniform1i
-glUniform2i
-glUniform3i
-glUniform4i
-glUniform1iv
-glUniform2iv
-glUniform3iv
-glUniformMatrix2fv
-glUniformMatrix3fv
-glUniformMatrix4fv
-glUniform4iv
-glUseProgram
-glValidateProgram
-glVertexAttrib1f
-glVertexAttrib2f
-glVertexAttrib3f
-glVertexAttrib4f
-glVertexAttrib1fv
-glVertexAttrib2fv
-glVertexAttrib3fv
-glVertexAttrib4fv
-glVertexAttribPointer
-glViewport
-
-glCheckFramebufferStatus
-glCreateProgram
-glCreateShader
-glGetError
-glGetString
-glGetUniformLocation
-glIsBuffer
-glIsEnabled
-glIsFramebuffer
-glIsProgram
-glIsRenderbuffer
-glIsShader
-glIsTexture
-
-eglBindAPI
-eglBindTexImage
-eglChooseConfig
-eglCopyBuffers
-eglCreateContext
-eglCreatePbufferFromClientBuffer
-eglCreatePbufferSurface
-eglCreatePixmapSurface
-eglCreateWindowSurface
-eglDestroyContext
-eglDestroySurface
-eglGetConfigAttrib
-eglGetConfigs
-eglGetCurrentContext
-eglGetCurrentDisplay
-eglGetCurrentSurface
-eglGetDisplay
-eglGetError
-eglGetProcAddress
-eglInitialize
-eglMakeCurrent
-eglQueryAPI
-eglQueryContext
-eglQueryString
-eglQuerySurface
-eglReleaseTexImage
-eglReleaseThread
-eglSurfaceAttrib
-eglSwapBuffers
-eglSwapInterval
-eglTerminate
-eglUpdateBufferOSP
-eglWaitClient
-eglWaitGL
-eglWaitNative
-
-_SglBindAPI
-_SglBindTexImage
-_SglChooseConfig
-_SglCopyBuffers
-_SglCreateContext
-_SglCreatePbufferFromClientBuffer
-_SglCreatePbufferSurface
-_SglCreatePixmapSurface
-_SglCreateWindowSurface
-_SglDestroyContext
-_SglDestroySurface
-_SglGetConfigAttrib
-_SglGetConfigs
-_SglGetCurrentContext
-_SglGetCurrentDisplay
-_SglGetCurrentSurface
-_SglGetDisplay
-_SglGetError
-_SglGetProcAddress
-_SglInitialize
-_SglMakeCurrent
-_SglQueryAPI
-_SglQueryContext
-_SglQueryString
-_SglQuerySurface
-_SglReleaseTexImage
-_SglReleaseThread
-_SglSurfaceAttrib
-_SglSwapBuffers
-_SglSwapInterval
-_SglTerminate
-_SglUpdateBufferOSP
-_SglWaitClient
-_SglWaitGL
-_SglWaitNative
-
-
-_ZN5Tizen3Net7Sockets6Socket10SetSockOptENS1_17NetSocketOptLevelENS1_16NetSocketOptNameEi###Socket::SetSockOpt
-_ZN5Tizen3Net7Sockets6Socket10SetSockOptENS1_17NetSocketOptLevelENS1_16NetSocketOptNameERKNS1_12LingerOptionE###Socket::SetSockOpt
-_ZN5Tizen3Net7Sockets6Socket17AddSocketListenerERNS1_20ISocketEventListenerE###Socket::AddSocketListener
-_ZN5Tizen3Net7Sockets6Socket20RemoveSocketListenerERNS1_20ISocketEventListenerE###Socket::RemoveSocketListener
-_ZN5Tizen3Net7Sockets6Socket21AsyncSelectByListenerEm###Socket::AsyncSelectByListener
-_ZN5Tizen3Net7Sockets6Socket4BindERKNS0_11NetEndPointE###Socket::Bind
-_ZN5Tizen3Net7Sockets6Socket4SendERNS_4Base10ByteBufferE###Socket::Send
-_ZN5Tizen3Net7Sockets6Socket5CloseEv###Socket::Close
-_ZN5Tizen3Net7Sockets6Socket6ListenEi###Socket::Listen
-_ZN5Tizen3Net7Sockets6Socket6SendToEPviRKNS0_11NetEndPointERi###Socket::SendTo
-_ZN5Tizen3Net7Sockets6Socket6SendToERNS_4Base10ByteBufferERKNS0_11NetEndPointE###Socket::SendTo
-_ZN5Tizen3Net7Sockets6Socket7ConnectERKNS0_11NetEndPointE###Socket::Connect
-_ZN5Tizen3Net7Sockets6Socket9ConstructENS1_22NetSocketAddressFamilyENS1_13NetSocketTypeENS1_17NetSocketProtocolE###Socket::Construct
-_ZN5Tizen3Net7Sockets6Socket9ConstructERKNS0_13NetConnectionENS1_22NetSocketAddressFamilyENS1_13NetSocketTypeENS1_17NetSocketProtocolE###Socket::Construct
-_ZNK5Tizen3Net7Sockets6Socket10GetSockOptENS1_17NetSocketOptLevelENS1_16NetSocketOptNameERi###Socket::GetSockOpt
-_ZNK5Tizen3Net7Sockets6Socket10GetSockOptENS1_17NetSocketOptLevelENS1_16NetSocketOptNameERNS1_12LingerOptionE###Socket::GetSockOpt
-_ZNK5Tizen3Net7Sockets6Socket11ReceiveFromEPviRNS0_11NetEndPointERi###Socket::Receive/Socket::ReceiveFrom
-_ZNK5Tizen3Net7Sockets6Socket11ReceiveFromERNS_4Base10ByteBufferERNS0_11NetEndPointE###Socket::ReceiveFrom
-_ZNK5Tizen3Net7Sockets6Socket5IoctlENS1_17NetSocketIoctlCmdERm###Socket::Ioctl
-_ZNK5Tizen3Net7Sockets6Socket7AcceptNEv###Socket::AcceptN
-_ZNK5Tizen3Net7Sockets6Socket7ReceiveERNS_4Base10ByteBufferE###Socket::Receive
-_ZZN5Tizen3Net7Sockets6Socket4SendEPviRiE19__PRETTY_FUNCTION__###Socket::Send
-
-_ZN5Tizen3Net4Http11HttpRequest15SetCustomMethodERKNS_4Base6StringE###Http::HttpRequest::SetCustomMethod
-_ZN5Tizen3Net4Http11HttpRequest6SetUriERKNS_4Base6StringE###Http::HttpRequest::SetAcceptEncoding/SetUri/SetVersion/
-_ZN5Tizen3Net4Http11HttpRequest9ReadBodyNEv###Http::HttpRequest::ReadBodyN
-_ZN5Tizen3Net4Http11HttpRequest9SetCookieERKNS_4Base6StringE###Http::HttpRequest::SetCookie
-_ZN5Tizen3Net4Http11HttpRequest9SetEntityERNS1_11IHttpEntityE###Http::HttpRequest::SetEntity
-_ZN5Tizen3Net4Http11HttpRequest9SetMethodENS1_13NetHttpMethodE###Http::HttpRequest::SetMethod
-_ZN5Tizen3Net4Http11HttpRequest9WriteBodyERKNS_4Base10ByteBufferE###Http::HttpRequest::WriteBody
-_ZN5Tizen3Net4Http11HttpSession16CloseTransactionERNS1_15HttpTransactionE###Http::HttpSession::CloseTransaction
-_ZN5Tizen3Net4Http11HttpSession16OpenTransactionNERKNS1_18HttpAuthenticationE###Http::HttpSession::OpenTransactionN
-_ZN5Tizen3Net4Http11HttpSession16OpenTransactionNEv###Http::HttpSession::OpenTransactionN
-_ZN5Tizen3Net4Http11HttpSession17CancelTransactionERNS1_15HttpTransactionE###Http::HttpSession::CancelTransaction
-_ZN5Tizen3Net4Http11HttpSession20CloseAllTransactionsEv###Http::HttpSession::CloseAllTransactions
-_ZN5Tizen3Net4Http11HttpSession25SetAutoRedirectionEnabledEb###Http::HttpSession::SetAutoRedirectionEnabled
-_ZN5Tizen3Net4Http11HttpSession9ConstructENS1_18NetHttpSessionModeEPKNS_4Base6StringERS6_PKNS1_10HttpHeaderENS1_17NetHttpCookieFlagE###Http::HttpSession::Construct
-_ZN5Tizen3Net4Http11HttpSession9ConstructERKNS0_13NetConnectionENS1_18NetHttpSessionModeEPKNS_4Base6StringERS9_PKNS1_10HttpHeaderENS1_17NetHttpCookieFlagE###Http::HttpSession::Construct
-_ZN5Tizen3Net4Http12HttpResponse10SetVersionERKNS_4Base6StringE###Http::HttpResponse::SetVersion
-_ZN5Tizen3Net4Http12HttpResponse13SetStatusCodeENS1_17NetHttpStatusCodeE###Http::HttpResponse::SetStatusCode
-_ZN5Tizen3Net4Http12HttpResponse13SetStatusTextERKNS_4Base6StringE###Http::HttpResponse::SetStatusText
-_ZN5Tizen3Net4Http12HttpResponse17SetHttpStatusCodeEi###Http::HttpResponse::SetHttpStatusCode
-_ZN5Tizen3Net4Http12HttpResponse4ReadEiiRiS3_###Http::HttpResponse::Read
-_ZN5Tizen3Net4Http12HttpResponse9ReadBodyNEv###Http::HttpResponse::ReadBodyN
-_ZN5Tizen3Net4Http12HttpResponse9SetCookieEPNS1_10HttpHeaderE###Http::HttpResponse::SetCookie
-_ZN5Tizen3Net4Http12HttpResponse9WriteBodyERKNS_4Base10ByteBufferE###Http::HttpResponse::WriteBody
-_ZN5Tizen3Net4Http15HttpTransaction10SetTimeoutEi###Http::HttpTransaction::SetTimeout
-_ZN5Tizen3Net4Http15HttpTransaction13SetUserObjectEPKNS_4Base6ObjectE###Http::HttpTransaction::SetUserObject
-_ZN5Tizen3Net4Http15HttpTransaction20SetClientCertificateEi###Http::HttpTransaction::SetClientCertificate
-_ZN5Tizen3Net4Http15HttpTransaction23SetHttpProgressListenerERNS1_26IHttpProgressEventListenerE###Http::HttpTransaction::SetHttpProgressListener
-_ZN5Tizen3Net4Http15HttpTransaction26AddHttpTransactionListenerERNS1_29IHttpTransactionEventListenerE###Http::HttpTransaction::AddHttpTransactionListener
-_ZN5Tizen3Net4Http15HttpTransaction29EnableTransactionReadyToWriteEv###Http::HttpTransaction::EnableTransactionReadyToWrite
-_ZN5Tizen3Net4Http15HttpTransaction29RemoveHttpTransactionListenerERNS1_29IHttpTransactionEventListenerE###Http::HttpTransaction::RemoveHttpTransactionListener
-_ZN5Tizen3Net4Http15HttpTransaction32SetServerCertificateVerificationENS1_34NetHttpCertificateVerificationFlagE###Http::HttpTransaction::SetServerCertificateVerification
-_ZN5Tizen3Net4Http15HttpTransaction5PauseEv###Http::HttpTransaction::Pause
-_ZN5Tizen3Net4Http15HttpTransaction6ResumeEv###Http::HttpTransaction::Resume
-_ZN5Tizen3Net4Http15HttpTransaction6SubmitEv###Http::HttpTransaction::Submit
-_ZNK5Tizen3Net4Http10HttpHeader13GetRawHeaderNEv###Http::HttpHeader::GetRawHeaderN
-_ZNK5Tizen3Net4Http11HttpRequest17GetAcceptEncodingEv###Http::HttpRequest::GetAcceptEncoding
-_ZNK5Tizen3Net4Http11HttpRequest9GetCookieEv###Http::HttpRequest::GetCookie
-_ZNK5Tizen3Net4Http11HttpRequest9GetHeaderEv###Http::HttpRequest::GetHeader
-_ZNK5Tizen3Net4Http11HttpSession22GetMaxTransactionCountEv###Http::HttpSession::GetMaxTransactionCount
-_ZNK5Tizen3Net4Http11HttpSession23GetCookieStorageManagerEv###Http::HttpSession::GetCookieStorageManager
-_ZNK5Tizen3Net4Http11HttpSession24IsAutoRedirectionEnabledEv###Http::HttpSession::IsAutoRedirectionEnabled
-_ZNK5Tizen3Net4Http11HttpSession25GetActiveTransactionCountEv###Http::HttpSession::GetActiveTransactionCount
-_ZNK5Tizen3Net4Http12HttpResponse10GetCookiesEv###Http::HttpResponse::GetCookies
-_ZNK5Tizen3Net4Http12HttpResponse10GetVersionEv###Http::HttpResponse::GetVersion
-_ZNK5Tizen3Net4Http12HttpResponse13GetStatusTextEv###Http::HttpResponse::GetStatusText
-_ZNK5Tizen3Net4Http12HttpResponse17GetHttpStatusCodeEv###Http::HttpResponse::GetHttpStatusCode/GetStatusCode
-_ZNK5Tizen3Net4Http12HttpResponse9GetHeaderEv###Http::HttpResponse::GetHeader
-_ZNK5Tizen3Net4Http15HttpTransaction10GetRequestEv###Http::HttpTransaction::GetRequest/OpenAuthenticationInfoN
-_ZNK5Tizen3Net4Http15HttpTransaction11GetResponseEv###Http::HttpTransaction::GetResponse
-_ZNK5Tizen3Net4Http15HttpTransaction13GetUserObjectEv###Http::HttpTransaction::GetUserObject
-
print "/*"
print " * this file genereted by <swap-probe> project with cmd <make headers>"
print " */"
- print
+ print ""
print "#ifndef __API_ID_MAP__"
print "#define __API_ID_MAP__"
- print
+ print ""
print "#ifdef __cplusplus"
print "extern \"C\"{"
print "#endif"
- print
+ print ""
api_id = 1
macro_prefix = "API_ID_"
} {
- if ( $0 == "" ) {
- print
+ orig = $0
+ if ( orig == "" ) {
+ print ""
+ } else if ( substr(orig,1,1) == "#" ) {
+ printf "/* %s */\n", orig
} else {
- orig = $0
def = orig
split(def, splited, "###")
def = splited[1]
}
}
END {
- print
+ print ""
print "#ifdef __cplusplus"
print "}"
print "#endif"
- print
+ print ""
print "#endif /* __API_ID_MAP__ */"
}
print "/*"
print " * this file genereted by <swap-probe> project with cmd <make headers>"
print " */"
- print
+ print ""
print "#ifdef __cplusplus"
print "extern \"C\"{"
print "#endif"
- print
+ print ""
print "const char *api_id_list[] = {"
} {
- if ( $0 == "" ) {
- print
+ orig = $0
+ if ( orig == "" ) {
+ print ""
+ } else if ( substr(orig,1,1) == "#" ) {
+ printf "/* %s */\n", orig
} else {
- orig = $0
def = orig
split(def, splited, "###")
if (splited[2] != ""){
}
END {
- print
+ print ""
print "#ifdef __cplusplus"
print "}"
print "#endif"
- print
+ print ""
print "};"
}
BEGIN {
api_id = 1
} {
- if ( $0 != "" ) {
+ if (( $0 != "" ) && ( substr($0,1,1) != "#" )) {
api_name = $0
split(api_name, splited, "###")
if (splited[2] != ""){
--- /dev/null
+#!/bin/bash
+func_list_file=$1
+da_lib=$2
+da_inst_dir=$3
+da_lib_func_list="/tmp/$2.list"
+probe_tmp="/tmp/probe_list.tmp"
+lib_tmp="/tmp/lib_list.tmp"
+
+py_output=/tmp/res.py
+c_output=include/ld_preload_probes.h
+c_output_types=include/ld_preload_types.h
+c_output_probe_lib=include/ld_preload_probe_lib.h
+c_output_feature_list_tmp=/tmp/res_feature_list.tmp
+c_output_libs_arr_tmp=/tmp/res_libs_arr.tmp
+
+cur_feature=""
+cur_lib=""
+cur_func=""
+cur_filename=""
+
+last_lib=""
+last_feature=""
+
+function print_license()
+{
+ filename=$1
+ license=\
+"/********************************************************\n"\
+" * !!!!!!!!!! Autogenerated header !!!!!!!!!!\n"\
+" * !!!!!!!!!! do not edit this file !!!!!!!!!!\n"\
+" *\n"\
+" * DA probe\n"\
+" *\n"\
+" * Copyright (c) 2000 - `date +%Y` Samsung Electronics Co., Ltd. All rights reserved.\n"\
+" *\n"\
+" * Contact:\n"\
+" *\n"\
+" * Vitaliy Cherepanov <v.cherepanov@samsung.com>\n"\
+" *\n"\
+" * This library is free software; you can redistribute it and/or modify it under\n"\
+" * the terms of the GNU Lesser General Public License as published by the\n"\
+" * Free Software Foundation; either version 2.1 of the License, or (at your option)\n"\
+" * any later version.\n"\
+" *\n"\
+" * This library is distributed in the hope that it will be useful, but WITHOUT ANY\n"\
+" * WARRANTY; without even the implied warranty of MERCHANTABILITY or\n"\
+" * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public\n"\
+" * License for more details.\n"\
+" *\n"\
+" * You should have received a copy of the GNU Lesser General Public License\n"\
+" * along with this library; if not, write to the Free Software Foundation, Inc., 51\n"\
+" * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n"\
+" *\n"\
+" * Contributors:\n"\
+" * - Samsung RnD Institute Russia\n"\
+" *\n"\
+" */\n"
+
+ echo -e "$license" >> $filename
+}
+
+###############################################
+# Print functions #
+###############################################
+
+# python genarating
+function print_section_begin_py()
+{
+ echo -e "lib_inst_list = [\n\t{\n">>$py_output
+}
+
+function print_section_end_py()
+{
+ echo -e "\t\t}\n]\n">>$py_output
+}
+
+function print_feature_begin_py()
+{
+ echo -e "\t\t#FEATURE: $1">>$py_output
+}
+
+function print_feature_end_py()
+{
+ echo -e "\t\t#---------------">>$py_output
+}
+
+function print_lib_begin_py()
+{
+ echo -e "\t\t\"$1\" :[">>$py_output
+}
+
+function print_lib_end_py()
+{
+ echo -e "\t\t],\n">>$py_output
+}
+
+function print_lib_probe_py()
+{
+ addr=$1
+ handl_addr=$2
+ block_type=$3
+ func=$4
+ echo -e "\t\t\t(0x$addr, 2, (0x$handl_addr, $block_type, \"xxxx\", \"p\", \"$func\")),">>$py_output
+}
+
+# C genarating
+feature_count=0
+
+function print_section_begin_c()
+{
+# echo -e "struct some_type arr[] = {\n">>$c_output
+
+ print_license "$c_output"
+
+ echo -e "#ifndef __LD_PRELOAD_PROBES__" >> $c_output
+ echo -e "#define __LD_PRELOAD_PROBES__" >> $c_output
+
+ echo -e "#include \"${c_output_types##*\/}\"" >> $c_output
+
+ print_license "$c_output_types"
+
+ echo -e "#ifndef __LD_PRELOAD_TYPES__" >> $c_output_types
+ echo -e "#define __LD_PRELOAD_TYPES__\n" >> $c_output_types
+
+ echo -e "#define NOFEATURE 0xFFFFFFFF\n" >> $c_output_types
+
+ echo -e "struct ld_probe_el_t{" >> $c_output_types
+ echo -e "\tuint64_t orig_addr;" >> $c_output_types
+ echo -e "\tuint64_t handler_addr;" >> $c_output_types
+ echo -e "\tuint8_t block_type;" >> $c_output_types
+ echo -e "};\n" >> $c_output_types
+
+ echo -e "struct ld_lib_list_el_t{" >> $c_output_types
+ echo -e "\tchar *lib_name;" >> $c_output_types
+ echo -e "\tuint32_t probe_count;" >> $c_output_types
+ echo -e "\tstruct ld_probe_el_t *probes;" >> $c_output_types
+ echo -e "};\n" >> $c_output_types
+
+ echo -e "struct ld_feature_list_el_t{" >> $c_output_types
+ echo -e "\tuint32_t lib_count;" >> $c_output_types
+ echo -e "\tstruct ld_lib_list_el_t *libs;" >> $c_output_types
+ echo -e "};\n" >> $c_output_types
+
+ echo -e "struct feature_list_t{" >> $c_output_types
+ echo -e "\tenum feature_code feature_value;" >> $c_output_types
+ echo -e "\tstruct ld_feature_list_el_t **feature_ld;" >> $c_output_types
+ echo -e "};\n" >> $c_output_types
+
+ print_license "$c_output_probe_lib"
+
+ echo -e "#ifndef __LD_PRELOAD_PROBE_LIB_H__" >> $c_output_probe_lib
+ echo -e "#define __LD_PRELOAD_PROBE_LIB_H__\n" >> $c_output_probe_lib
+
+ echo -e "static const char *probe_lib = \"$da_inst_dir/$da_lib\";" >> $c_output_probe_lib
+ echo -e "static unsigned long get_caller_addr = 0x$(readelf -sW $da_lib | grep get_caller_addr$ | awk '{print $2}' | uniq);" >> $c_output_probe_lib
+ echo -e "static unsigned long get_call_type_addr = 0x$(readelf -sW $da_lib | grep get_call_type$ | awk '{print $2}' | uniq);" >> $c_output_probe_lib
+
+ echo end>&2
+}
+
+function print_section_end_c()
+{
+# echo -e "}\n">>$c_output
+
+ echo -e "int feature_to_data_count = $feature_count;" >> $c_output
+ echo -e "struct feature_list_t feature_to_data[] = {" >> $c_output
+ cat $c_output_feature_list_tmp >> $c_output
+ echo -e "};" >> $c_output
+# cat $c_output >> $c_output
+# mv $c_output $c_output
+ echo -e "#endif /* __LD_PRELOAD_PROBES__ */" >> $c_output
+
+ echo -e "#endif /* __LD_PRELOAD_TYPES__ */" >> $c_output_types
+
+ echo -e "#endif /* __LD_PRELOAD_PROBE_LIB_H__ */\n" >> $c_output_probe_lib
+ echo end>&2
+}
+
+lib_count=0
+
+function print_feature_begin_c()
+{
+
+ echo -e "/*************************** $1 *****************************/" >> $c_output
+
+ let lib_count=0
+ let feature_count=${feature_count}+1
+ feature=$1
+ if [ "$cur_feature" == "---" ]; then
+ feature="0x000000"
+ fi
+
+# echo -e "\t\t{ $feature, /* FEATURE */\n">>$c_output
+}
+
+
+function print_feature_end_c()
+{
+ feature=$last_feature
+ if [ "$feature" == "---" ]; then
+ feature="NOFEATURE"
+ fi
+
+ echo -e "struct ld_lib_list_el_t ${feature}_lib_list[] = {" >> $c_output
+ cat $c_output_libs_arr_tmp >> $c_output
+ echo -e "}; /* ${feature}_lib_list */\n" >> $c_output
+
+ echo -e "struct ld_feature_list_el_t ${feature}_list = {" >> $c_output
+ echo -e "\t $lib_count, ${feature}_lib_list" >> $c_output
+ echo -e "}; /* ${feature}_list */\n" >> $c_output
+
+ echo -e "\t{$feature, (struct ld_feature_list_el_t **)&${feature}_list}," >> $c_output_feature_list_tmp
+
+ rm $c_output_libs_arr_tmp
+
+# echo -e "\t\t{\n">>$c_output
+# cat $c_output_libs_arr_tmp >> $c_output
+# echo -e "\t\t},\n">>$c_output
+
+# echo -e "\t\t},\n">>$c_output
+}
+
+probe_count=0
+
+function print_lib_begin_c()
+{
+
+ let probe_count=0
+ let lib_count=$lib_count+1
+
+ feature=$cur_feature
+ if [ "$feature" == "---" ]; then
+ feature="NOFEATURE"
+ fi
+ var=`echo ${cur_lib##*/} | sed -e 's/-/__/g'`
+ var=${var%%.*}
+ var=${feature}_${var}
+
+ echo -e "/* \"$1\" */" >> $c_output
+ echo -e "struct ld_probe_el_t ${var}_probe_list[] = {">>$c_output
+
+# echo -e "\t\t\t{ $var, /* lib name */\n">>$c_output
+}
+
+function print_lib_end_c()
+{
+ feature=$last_feature
+ if [ "$feature" == "---" ]; then
+ feature="NOFEATURE"
+ fi
+# var=${last_lib##*/}
+# var=${var%%.*}
+# var=${feature}_${var}
+
+ echo -e "};\n">>$c_output
+
+ echo -e "\t{\"`get_real_path ${last_lib}`\", $probe_count, ${var}_probe_list}," >> $c_output_libs_arr_tmp
+# echo -e "\t\t\t\t$probe_count, /* probe count */" >> $c_output
+# cat $c_output_pr_list_tmp >> $c_output
+# rm $c_output_pr_list_tmp
+
+
+# echo -e "\t\t\t\t${var}_probe_list, /* probe list */" >> $c_output
+
+# echo -e "\t\t\t},\n">>$c_output
+
+ echo "/* ================================================================ */" >> $c_output
+
+
+
+# if [ -f "$c_output" ]; then
+# rm $c_output
+# fi
+}
+
+function print_lib_probe_c()
+{
+ addr=$1
+ handl_addr=$2
+ block_type=$3
+ func=$4
+ let probe_count=${probe_count}+1
+ echo -e "\t\t\t\t{0x$addr, 0x$handl_addr, $block_type /* \"$func\" */},">>$c_output
+}
+#####################
+# global generation #
+#####################
+function print_section_begin()
+{
+ print_section_begin_py
+ print_section_begin_c
+}
+
+function print_section_end()
+{
+ print_section_end_py
+ print_section_end_c
+}
+
+function print_feature_begin()
+{
+ print_feature_begin_py $1
+ print_feature_begin_c $1
+}
+
+function print_feature_end()
+{
+ print_feature_end_py $1
+ print_feature_end_c $1
+}
+
+function print_lib_begin()
+{
+ print_lib_begin_py $1
+ print_lib_begin_c $1
+}
+
+function print_lib_end()
+{
+ print_lib_end_py
+ print_lib_end_c
+}
+
+function print_lib_probe()
+{
+ print_lib_probe_py $1 $2 $3 $4
+ print_lib_probe_c $1 $2 $3 $4
+}
+###############################################
+# Generate functions #
+###############################################
+function get_real_path()
+{
+ lib=$1
+ if [ -f "/usr/lib/$lib" ];then
+ lib="/usr/lib/$lib"
+ elif [ -f "/lib/$lib" ];then
+ lib="/lib/$lib"
+ else
+ echo "file not found <$lib>" >&2
+ exit 2
+ fi
+ echo $lib
+}
+
+function print_libs()
+{
+ lib="HZ"
+ while read line; do
+ if [ "$line" != "" ];then
+ if [ "${line:0:4}" == "#lib" ];then
+ lib="${line#\#lib*\ }"
+ lib="${lib#\"*}"
+ lib="${lib%*\"}"
+
+ if [ "$lib" == "???" ];then
+ continue
+ elif [ "$lib" == "---" ];then
+ continue
+ fi
+
+ lib=`get_real_path $lib`
+ echo $lib
+ fi
+ fi
+ done < $1
+}
+
+function print_probes()
+{
+ lib="HZ"
+ filename="hz"
+ feature="hz"
+ feature_always="hz"
+ while read line; do
+ if [ "$line" != "" ];then
+ if [ "${line:0:1}" != "#" ];then
+ #echo "$lib"
+ if [ "$lib" == "???" ];then
+ echo "WARNING skip <$line> filename<$filename> lib is <$lib>">&2
+ continue
+ elif [ "$lib" == "---" ];then
+ echo "WARNING skip <$line> filename<$filename> lib is <$lib>">&2
+ continue
+ fi
+
+ echo "$feature $lib $line $filename"
+ if [ $feature_always != "hz" ];then
+ echo "$feature_always $lib $line $filename"
+ fi
+ elif [ "${line:0:5}" == "#lib " ];then
+ lib="${line#\#lib*\ }"
+ lib="${lib#\"*}"
+ lib="${lib%*\"}"
+ elif [ "${line:0:9}" == "#filename" ];then
+ filename="${line#\#filename*\ }"
+ filename="${filename#\"*}"
+ filename="${filename%*\"}"
+ elif [ "${line:0:9}" == "#feature " ];then
+ feature="${line#\#feature*\ }"
+ feature_always="hz"
+ elif [ "${line:0:16}" == "#feature_always " ];then
+ feature_always="${line#\#feature_always*\ }"
+ fi
+ fi
+ done < $1
+}
+
+function generate_libs_probe_list()
+{
+ while read filename; do
+ short=${filename##*/}
+ readelf $filename -sW > /tmp/$short.list
+ done < $1
+
+ readelf $da_lib -sW > $da_lib_func_list
+}
+
+function get_elem()
+{
+ count=0;
+ n=$1
+ st=$2
+ for i in $st; do
+ let count=$count+1
+ if [ n -eq count ];then
+ return
+ fi
+ done;
+}
+
+function generate_addres_list()
+{
+
+ print_section_begin
+
+ while read line; do
+ if [ "$line" != "" ];then
+ cur_feature=`echo $line | awk '{print $1}'`
+ cur_lib=`echo $line | awk '{print $2}'`
+ cur_func=`echo $line | awk '{print $3}'`
+ if [ `echo $line | awk '{print $4}'` == "__nonblocking_probe__" ]; then
+ cur_block_type="0"
+ cur_filename=`echo $line | awk '{print $5}'`
+ else
+ cur_block_type="1"
+ cur_filename=`echo $line | awk '{print $4}'`
+ fi
+
+ if [ "$last_feature" != "$cur_feature" ];then
+ if [ "$last_feature" != "" ];then
+ print_lib_end
+ print_feature_end
+ fi
+ last_feature=$cur_feature
+ last_lib=""
+ print_feature_begin $cur_feature
+ fi
+
+ if [ "$last_lib" != "$cur_lib" ];then
+ if [ "$last_lib" != "" ];then
+ print_lib_end
+ fi
+ last_lib=$cur_lib
+ print_lib_begin `get_real_path $cur_lib`
+ fi
+
+ addr=`cat /tmp/$cur_lib.list | grep -e " $cur_func\$" | awk '{print $2}'| sort | uniq`
+
+ if [[ "$addr" == "" || 0x$addr -eq 0x0 ]];then
+ addr=`cat /tmp/$cur_lib.list | grep -e " $cur_func@@" | awk '{print $2}'| sort | uniq`
+ fi
+
+ handl_addr=`cat $da_lib_func_list | grep " $cur_func\$" | awk '{print $2}'| sort | uniq`
+
+ if [[ "$handl_addr" == "" || 0x$handl_addr -eq 0x0 ]];then
+ echo "WARNING: func <$cur_func> not found in $da_lib file<$cur_filename>">&2
+ continue
+ fi
+
+ if [[ "$addr" == "" || 0x$addr -eq 0x0 ]];then
+ echo "WARNING: func <$cur_func> not found in $cur_lib. addr=$addr file<$cur_filename>">&2
+ continue
+ fi
+
+ print_lib_probe "$addr" "$handl_addr" "$cur_block_type" "$cur_func"
+
+ fi
+ done < $1
+
+ print_lib_end
+ print_feature_end
+ print_section_end
+
+}
+
+rm $lib_tmp
+rm $probe_tmp
+
+rm $py_output
+rm $c_output
+rm $c_output_types
+rm $c_output_probe_lib
+
+rm $c_output_libs_arr_tmp
+#rm $c_output_pr_list_tmp
+rm $c_output_feature_list_tmp
+
+print_libs $func_list_file | sort -t " " --key=1,1 | uniq > $lib_tmp
+print_probes $func_list_file | sort -t " " --key=1,2 > $probe_tmp
+generate_libs_probe_list $lib_tmp
+
+generate_addres_list $probe_tmp