-1, /* int stateTouch */
0, /* int init_complete */
0, /* int custom_chart_callback_count */
- 0, /* unsigned long optionflag */
+ {
+ 0, /* feature 0 */
+ 0 /* feature 1 */
+ }, /* features_t */
{
PTHREAD_MUTEX_INITIALIZER, /* pthread_mutex_t bins_mutex */
SLIST_HEAD_INITIALIZER(bins_list) /* struct head = NULL */
for (i = 0; i < features_cnt; i++) {
if (features[i] == NULL ||
- !isOptionEnabled(features[i]->feature))
+ !isOptionEnabled(features[i]->feature, 0))
continue;
_patch_target_bins(features[i]);
}
/* Iterate features to find target probe */
for (i = 0; i < features_cnt; i++) {
if (features[i] == NULL ||
- !isOptionEnabled(features[i]->feature))
+ !isOptionEnabled(features[i]->feature, 0))
continue;
if (_is_ignored(l->l_name) || (!target_bin &&
for (i = 0; i < features_cnt; i++) {
if (features[i] == NULL ||
- !isOptionEnabled(features[i]->feature))
+ !isOptionEnabled(features[i]->feature, 0))
continue;
is_for_all = _is_for_all_feature(features[i]);
(this means that these functions do not need to set enter/exit flag)
******************************************************************************/
+static inline void _parse_config(char *configstr)
+{
+ gTraceInfo.features.feature_0 = *(uint64_t *)configstr;
+ gTraceInfo.features.feature_1 = *(uint64_t *)(configstr + sizeof(uint64_t));
+}
+
/* runtime configure the probe option */
static void _configure(char* configstr)
{
- gTraceInfo.optionflag = atoll(configstr);
+ _parse_config(configstr);
init_features();
- if (isOptionEnabled(FL_SCREENSHOT)) {
+ if (isOptionEnabled(FL_SCREENSHOT, 0)) {
load_screenshot_library();
screenshot_set_call();
} else {
screenshot_unset_call();
}
- PRINTMSG("configure in probe : %s, %llx\n", configstr, gTraceInfo.optionflag);
+ PRINTMSG("configure in probe : %llx : %llx\n",
+ gTraceInfo.features.feature_0, gTraceInfo.features.feature_1);
}
static void _process_target_bins(char *data_buf)
int lsan_open_liblsan()
{
- if (!isOptionEnabled(FL_MEMORY_ALLOC_ALWAYS_PROBING) ||
- !isOptionEnabled(FL_LSAN))
+ if (!isOptionEnabled(FL_MEMORY_ALLOC_ALWAYS_PROBING, 0) ||
+ !isOptionEnabled(FL_LSAN, 0))
return 0;
liblsan_handle = dlopen(PROBELIB_LSAN, RTLD_NOW);
char *path;
};
+struct features_t {
+ uint64_t feature_0;
+ uint64_t feature_1;
+};
+
struct bins_info_t {
pthread_mutex_t bins_mutex;
SLIST_HEAD(head, bin_info_t) bins_list;
};
-
typedef struct {
__indexInfo index;
__socketInfo socket;
int stateTouch;
int init_complete;
int custom_chart_callback_count;
- uint64_t optionflag;
+ struct features_t features;
struct bins_info_t bins_info;
} __traceInfo;
void on_orientation_changed(int angle, bool capi);
/* query functions */
-#define isOptionEnabled(OPT) ((gTraceInfo.optionflag & OPT) != 0)
+#define isOptionEnabled(OPT0, OPT1) \
+ (((gTraceInfo.features.feature_0 & OPT0) != 0) || \
+ ((gTraceInfo.features.feature_1 & OPT1) != 0))
/* Binaries list functions */
int add_binary(char *path);
void on_orientation_changed(int angle, bool capi)
{
- if (isOptionEnabled(FL_USER_EVENT)) {
+ if (isOptionEnabled(FL_USER_EVENT, 0)) {
inc_current_event_index();
CREATE_GENERIC_PROBE_DATA((uint64_t)0xffffffff, 0, 0);
void GestureEventListener::OnCustomGestureCanceled (TouchGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnCustomGestureCanceled__TouchGestureDetector__gestureDetector_,
void GestureEventListener::OnCustomGestureChanged (TouchGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnCustomGestureChanged__TouchGestureDetector__gestureDetector_,
void GestureEventListener::OnCustomGestureFinished (TouchGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnCustomGestureFinished__TouchGestureDetector__gestureDetector_,
void GestureEventListener::OnCustomGestureStarted (TouchGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
PACK_GESTURE_EVENT(API_ID_void_GestureEventListener__OnCustomGestureStarted__TouchGestureDetector__gestureDetector_,
void GestureEventListener::OnFlickGestureCanceled (TouchFlickGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
void GestureEventListener::OnFlickGestureDetected (TouchFlickGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
void GestureEventListener::OnLongPressGestureCanceled (TouchLongPressGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
void GestureEventListener::OnLongPressGestureDetected (TouchLongPressGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
void GestureEventListener::OnPanningGestureCanceled (TouchPanningGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
void GestureEventListener::OnPanningGestureChanged (TouchPanningGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
void GestureEventListener::OnPanningGestureFinished (TouchPanningGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
void GestureEventListener::OnPanningGestureStarted (TouchPanningGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
void GestureEventListener::OnPinchGestureCanceled (TouchPinchGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
void GestureEventListener::OnPinchGestureChanged (TouchPinchGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
void GestureEventListener::OnPinchGestureFinished (TouchPinchGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
void GestureEventListener::OnPinchGestureStarted (TouchPinchGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
void GestureEventListener::OnRotationGestureCanceled (TouchRotationGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
void GestureEventListener::OnRotationGestureChanged (TouchRotationGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
void GestureEventListener::OnRotationGestureFinished (TouchRotationGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
void GestureEventListener::OnRotationGestureStarted (TouchRotationGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
void GestureEventListener::OnTapGestureCanceled (TouchTapGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
void GestureEventListener::OnTapGestureDetected (TouchTapGestureDetector &gestureDetector)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
probeBlockStart();
{
Eina_Bool PROBE_NAME(ecore_event_evas_key_down)(void *data, int type, void *event)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
if(event != NULL)
{
Eina_Bool PROBE_NAME(ecore_event_evas_key_up)(void *data, int type, void *event)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
if(event != NULL)
{
Eina_Bool PROBE_NAME(ecore_event_evas_mouse_button_down)(void *data, int type, void *event)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
if(event != NULL)
{
Eina_Bool PROBE_NAME(ecore_event_evas_mouse_button_up)(void *data, int type, void *event)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
if(event != NULL)
{
Eina_Bool PROBE_NAME(ecore_event_evas_mouse_move)(void *data, int type, void *event)
{
- if(isOptionEnabled(FL_USER_EVENT))
+ if(isOptionEnabled(FL_USER_EVENT, 0))
{
if(touch_pressed)
{
if (gTraceInfo.screenshot.state == 2)
gTraceInfo.screenshot.state = 1;
pthread_mutex_unlock(&(gTraceInfo.screenshot.ssMutex));
- if (old == 2 && isOptionEnabled(FL_SCREENSHOT))
+ if (old == 2 && isOptionEnabled(FL_SCREENSHOT, 0))
captureScreen();
return ECORE_CALLBACK_CANCEL;
gTraceInfo.screenshot.state = 1;
pthread_mutex_unlock(&(gTraceInfo.screenshot.ssMutex));
- if(old == 2 && isOptionEnabled(FL_SCREENSHOT))
+ if(old == 2 && isOptionEnabled(FL_SCREENSHOT, 0))
captureScreen();
}