./probe_ui/probe_ui.c
PROBE_CAPI_SRCS = \
- ./probe_capi/capi_appfw.c \
- ./probe_capi/probe_capi.c
+ ./probe_capi/capi_appfw.c
PROBE_SCREENSHOT_SRCS = ./probe_screenshot/dacapture_generic.c
#include "probeinfo.h"
#include "probe_screenshot.h"
#include "probe_helper.h"
-#include "probe_capi.h"
#include "probe_event.h"
#include "probe_file.h"
#include "probe_graphics.h"
#include "dahelper.h"
#include "probe_screenshot.h"
#include "probe_helper.h"
-#include "probe_capi.h"
#include "probe_event.h"
#include "probe_file.h"
#include "probe_graphics.h"
#include "multiprobe_helper.h"
#include <probeinfo.h>
+#include <multiprobe.h>
+#include <app.h>// for ui_app_lifecycle_callback_s
+
+
+static int mprobe_ui_app_main(int argc, char **argv, ui_app_lifecycle_callback_s *callback, void *user_data);
static struct probe_desc_t probes[] = {
- // add probes describe
+ {
+ .handler_ptr = (ElfW(Addr))&mprobe_ui_app_main,
+ .orig_name = "ui_app_main",
+ .flags = GT_TARGET_PROBE,
+ .orig_ptr = (ElfW(Addr))0,
+ },
};
struct feature_desc_t multiprobe_helper_feature = {
.cnt = sizeof(probes) / sizeof(probes[0]),
.probes = probes,
};
+
+
+static int mprobe_ui_app_main(int argc, char **argv,
+ ui_app_lifecycle_callback_s *callback, void *user_data)
+{
+ typedef int (*func_t)(int, char **, ui_app_lifecycle_callback_s *, void *);
+ static void *handle = nullptr;
+
+ if (!handle) {
+ struct probe_desc_t *probe = &probes[0];
+
+ multiprobe_set_default_handler(probe->orig_name, (void *)probe->orig_ptr);
+ handle = multiprobe_reg(probe->orig_name, (void *)mprobe_ui_app_main, true);
+ }
+
+ return MULTIPROBE_CALL(handle, func_t, argc, argv, callback, user_data);
+}
#include <app.h>
#include <Ecore.h>
-#include "daprobe.h"
-#include "dahelper.h"
-#include "probeinfo.h"
#include "binproto.h"
-#include "common_probe_init.h"
-#include "capi_probes_list.h"
-#include "probe_capi.h"
+#include <multiprobe.h>
voidp_to_uint64(user_data));
}
-int PROBE_NAME(ui_app_main)(int argc, char **argv, ui_app_lifecycle_callback_s *callback, void *user_data)
+static void *handle_ui_app_main;
+
+static int handler_ui_app_main(int argc, char **argv, ui_app_lifecycle_callback_s *callback, void *user_data)
{
- int (*ui_app_mainp)(int argc, char **argv, ui_app_lifecycle_callback_s *callback, void *user_data);
+ typedef int (*func_t)(int, char **, ui_app_lifecycle_callback_s *, void *);
int ret;
- ui_app_mainp = (void *)GET_ORIG_FUNC(capi_feature, ui_app_main);
-
uiAppCallback.create = callback->create;
uiAppCallback.terminate = callback->terminate;
uiAppCallback.pause = callback->pause;
if (callback->app_control)
callback->app_control = _ui_dalc_app_control;
- ret = ui_app_mainp(argc, argv, callback, user_data);
+ ret = MULTIPROBE_CALL(handle_ui_app_main, func_t, argc, argv, callback, user_data);
callback->create = uiAppCallback.create;
callback->terminate = uiAppCallback.terminate;
return ret;
}
+
+static void __attribute__((constructor)) ctor()
+{
+ handle_ui_app_main = multiprobe_reg("ui_app_main", (void *)handler_ui_app_main, true);
+}
+++ /dev/null
-#ifndef __CAPI_APPFW_H__
-#define __CAPI_APPFW_H__
-
-
-int PROBE_NAME(ui_app_main)(int argc, char **argv, ui_app_lifecycle_callback_s *callback, void *user_data);
-
-#endif /* __CAPI_APPFW_H__ */
+++ /dev/null
-#ifndef __CAPI_PROBES_LIST_H__
-#define __CAPI_PROBES_LIST_H__
-
-
-/* TODO generate PROBES_LIST with api_names.txt */
-
-#define PROBES_LIST \
- X(PROBE_NAME(ui_app_main), ui_app_main)
-
-
-#define X(func_name, orig_name) \
- GET_FUNC_ID(func_name, orig_name),
-enum capi_funcs_id_t {
- PROBES_LIST
-};
-#undef X
-
-enum capi_funcs_id_t get_capi_feature_id(void *ptr);
-
-#endif /* __CAPI_PROBES_LIST_H__ */
+++ /dev/null
-#include <stddef.h>
-#include "api_names_global.h"
-#include "probeinfo.h"
-#include "daprobe.h"
-
-#include "capi_probes_list.h"
-
-/* X-macros replaced by function defenitions */
-/* We need this only to get symbol address - so don't care
- * about real prototype */
-#define X(func_name, orig_name) \
- void func_name(void);
-
-PROBES_LIST
-
-#undef X
-
-
-/* This function returns function's id by its pointer */
-#define X(func_name, orig_name) \
- if (ptr == & func_name) \
- return GET_FUNC_ID(func_name, orig_name);
-
-enum capi_funcs_id_t get_capi_feature_id(void *ptr)
-{
- PROBES_LIST
-
- PRINTERR("Invalid function pointer %p at <%s>!\n", ptr, __func__);
-
- return 0;
-}
-
-#undef X
-
-
-/* X-macros replaced by structures defenitions */
-/* Used only for probes from target file */
-#define X(func_name, orig_name) \
- { (ElfW(Addr)) & func_name, #orig_name, GT_ALWAYS_PROBE, (ElfW(Addr))0 },
-
-static struct probe_desc_t capi_probes[] = {
- PROBES_LIST
-};
-
-#undef X
-
-/* X-macros replaced by counted additions */
-#define X(func_name, orig_name) +1
-
-struct feature_desc_t capi_feature = {
- /* Always feature */
- .feature = 0xffffffff,
- .cnt = (PROBES_LIST),
- .probes = capi_probes
-};
-
-#undef X
-
-#undef PROBES_LIST
+++ /dev/null
-#ifndef __PROBE_CAPI_H__
-#define __PROBE_CAPI_H__
-
-extern struct feature_desc_t capi_feature;
-
-#endif /* __PROBE_CAPI_H__*/