./probe_socket/libdasocket.c \
./probe_event/da_event.c \
./probe_event/keytouch.c \
+ ./probe_event/orientation.c \
./probe_third/libdaemon.c \
./probe_thread/libdathread.c \
./probe_thread/libdasync.c \
}
}
- if((!user) && bFiltering)
+ if(user)
{
- TRACE_STATE_UNSET(TS_ENTER_PROBE_BLOCK);
- return 0;
+ gProbeDepth++;
+ return 2; // user call
}
else
{
- // nothing to do
+ if(bFiltering)
+ {
+ TRACE_STATE_UNSET(TS_ENTER_PROBE_BLOCK);
+ return 0; // not probing
+ }
+ else
+ {
+ gProbeDepth++;
+ return 1; // internal call
+ }
}
-
- gProbeDepth++;
-
- if(user)
- return 2; // user call
- else
- return 1; // internal call
}
int postBlockBegin(int preresult)
*
* Copyright (File::*c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
*
- * Contact:
+ * Contact:
*
* Jaewon Lim <jaewon81.lim@samsung.com>
* Woojin Jung <woojin2.jung@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
* Anastasia Lyupa <a.lyupa@samsung.com>
- *
+ *
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
- *
+ *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* Contributors:
* - S-Core Co., Ltd
* - Samsung RnD Institute Russia
- *
+ *
*/
#include <app.h>
+#include <Ecore.h>
#include <FApp.h>
#include <FBase.h>
#include "osp_probe.h"
#include "binproto.h"
+extern "C"
+{
+Ecore_Event_Handler* register_orientation_event_listener();
+void unregister_orientation_event_listener(Ecore_Event_Handler* handler);
+}
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
class _AppImpl
{
static void OnTerminate(void* user_data);
- static void OnDeviceOrientationChanged(app_device_orientation_e orientation, void* user_data);
+// static void OnDeviceOrientationChanged(app_device_orientation_e orientation, void* user_data);
};
-class _UiAppImpl
+class _UiAppImpl
// : public Tizen::Base::Object
// , public _IAppImpl
{
{
typedef result (*methodType)(UiAppInstanceFactory pFactory, const IList* pArgs);
static methodType uiapp_executep;
- probeInfo_t probeInfo;
- result ret;
+ DECLARE_VARIABLE_STANDARD;
+ Ecore_Event_Handler* handler;
GET_REAL_FUNC_OSP(_ZN5Tizen3App5UiApp7ExecuteEPFPS1_vEPKNS_4Base10Collection5IListE,
LIBOSP_UIFW, uiapp_executep);
probeBlockStart();
+ handler = register_orientation_event_listener();
if(gTraceInfo.exec_map.map_start == NULL)
{
get_map_address(CALLER_ADDRESS, &(gTraceInfo.exec_map.map_start),
PACK_COMMON_END(ret, 0, 0);
FLUSH_LOCAL_BUF();
+ unregister_orientation_event_listener(handler);
probeBlockEnd();
return ret;
typedef void (*methodType)(void*);
static methodType appimpl_onterminatep;
probeInfo_t probeInfo;
-
+
GET_REAL_FUNC_OSP(_ZN5Tizen3App8_AppImpl11OnTerminateEPv, LIBOSP_APPFW, appimpl_onterminatep);
probeBlockStart();
appimpl_onterminatep(user_data);
}
-
+/*
void _AppImpl::OnDeviceOrientationChanged(app_device_orientation_e orientation, void* user_data)
{
typedef void (*methodType)(app_device_orientation_e, void*);
static methodType appimpl_ondeviceorientationchangedp;
-
+
GET_REAL_FUNC_OSP(_ZN5Tizen3App8_AppImpl26OnDeviceOrientationChangedE24app_device_orientation_ePv,
LIBOSP_APPFW, appimpl_ondeviceorientationchangedp);
appimpl_ondeviceorientationchangedp(orientation, user_data);
}
-
+*/
void _AppInfo::SetAppState(AppState appState)
{
typedef void (*methodType)(AppState appstate);
static methodType appinfo_setappstatep;
probeInfo_t probeInfo;
-
+
GET_REAL_FUNC_OSP(_ZN5Tizen3App8_AppInfo11SetAppStateENS0_8AppStateE, LIBOSP_APPFW, appinfo_setappstatep);
probeBlockStart();
typedef void (_UiAppImpl::*methodType)(void);
static methodType uiappimpl_onbackgroundp;
probeInfo_t probeInfo;
-
+
GET_REAL_FUNC_OSP(_ZN5Tizen3App10_UiAppImpl12OnBackgroundEv, LIBOSP_UIFW, uiappimpl_onbackgroundp);
probeBlockStart();
typedef void (_UiAppImpl::*methodType)(void);
static methodType uiappimpl_onforegroundp;
probeInfo_t probeInfo;
-
+
GET_REAL_FUNC_OSP(_ZN5Tizen3App10_UiAppImpl12OnForegroundEv, LIBOSP_UIFW, uiappimpl_onforegroundp);
probeBlockStart();
{
typedef void (*methodType)(_UiAppImpl* th, app_device_orientation_e orientation);
static methodType uiappimpl_ondeviceorientationchangedp;
-
+
GET_REAL_FUNC_OSP(_ZThn4_N5Tizen3App10_UiAppImpl26OnDeviceOrientationChangedE24app_device_orientation_e,
LIBOSP_UIFW, uiappimpl_ondeviceorientationchangedp);
}
*/
} } // end of namespace
-
--- /dev/null
+/*
+ * DA probe
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ *
+ * Jaewon Lim <jaewon81.lim@samsung.com>
+ * Woojin Jung <woojin2.jung@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <Ecore.h>
+#include <Ecore_X.h>
+
+#include "daprobe.h"
+#include "dahelper.h"
+
+Eina_Bool _da_onclientmessagereceived(void* pData, int type, void* pEvent)
+{
+ Ecore_X_Event_Client_Message* pClientEvent;
+
+ probeBlockStart();
+ pClientEvent = (Ecore_X_Event_Client_Message*)pEvent;
+
+ if(pClientEvent != NULL)
+ {
+ if(pClientEvent->message_type == ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_REQUEST)
+ {
+ int orientation = pClientEvent->data.l[1];
+ on_orientation_changed(orientation, false);
+ }
+ }
+ probeBlockEnd();
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+Ecore_Event_Handler* register_orientation_event_listener()
+{
+ Ecore_Event_Handler* handler;
+
+ probeBlockStart();
+ ecore_init();
+ ecore_x_init(NULL);
+ 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();
+}
#include "daprobe.h"
+//#define INTERNALFILTERING (!isEnableInternalMalloc())
+#define INTERNAL_MALLOC_FILTERING true
+#define INTERNAL_FREE_FILTERING true
+#define INTERNAL_NEW_FILTERING true
+#define INTERNAL_DELETE_FILTERING true
+
/*******************************************************************
* MEMORY PROBE MACRO
*
*
* Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
*
- * Contact:
+ * Contact:
*
* Jaewon Lim <jaewon81.lim@samsung.com>
* Woojin Jung <woojin2.jung@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
* Anastasia Lyupa <a.lyupa@samsung.com>
* Dmitry Bogatov <d.bogatov@samsung.com>
- *
+ *
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
- *
+ *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* Contributors:
* - S-Core Co., Ltd
* - Samsung RnD Institute Russia
- *
+ *
*/
#include <stdio.h>
#include "da_memory.h"
#include "binproto.h"
-//#define INTERNALFILTERING (!isEnableInternalMalloc())
-#define INTERNALFILTERING true
static enum DaOptions _sopt = OPT_ALLOC;
static void* (*saved_malloc_hook)(size_t, const void*);
void *pret;
teardown_memory_hooks();
- bfiltering = INTERNALFILTERING;
PRE_PROBEBLOCK();
pret = malloc(size);
}
POST_PACK_PROBEBLOCK_BEGIN();
-
+
PREPARE_LOCAL_BUF();
PACK_COMMON_BEGIN(MSG_PROBE_MEMORY,
API_ID_malloc,
PACK_COMMON_END(pret, newerrno, blockresult);
PACK_MEMORY(size, MEMORY_API_ALLOC, pret);
FLUSH_LOCAL_BUF();
-
+
POST_PACK_PROBEBLOCK_END();
install_memory_hooks();
teardown_memory_hooks();
- bfiltering = INTERNALFILTERING;
PRE_PROBEBLOCK();
if(ptr != NULL && getTraceState() == 0)
free(ptr);
POST_PACK_PROBEBLOCK_BEGIN();
-
+
PREPARE_LOCAL_BUF();
PACK_COMMON_BEGIN(MSG_PROBE_MEMORY,
API_ID_free,
PACK_COMMON_END(0, newerrno, blockresult);
PACK_MEMORY(0, MEMORY_API_FREE, ptr);
FLUSH_LOCAL_BUF();
-
+
POST_PACK_PROBEBLOCK_END();
install_memory_hooks();
teardown_memory_hooks();
- bfiltering = INTERNALFILTERING;
PRE_PROBEBLOCK();
if(memblock != NULL && getTraceState() == 0)
}
POST_PACK_PROBEBLOCK_BEGIN();
-
+
PREPARE_LOCAL_BUF();
PACK_COMMON_BEGIN(MSG_PROBE_MEMORY,
API_ID_realloc,
PACK_COMMON_END(pret, newerrno, blockresult);
PACK_MEMORY(size, MEMORY_API_ALLOC, pret);
FLUSH_LOCAL_BUF();
-
+
POST_PACK_PROBEBLOCK_END();
install_memory_hooks();
DECLARE_VARIABLE_STANDARD;
void *pret;
size_t size = nelem * elsize;
- bfiltering = INTERNALFILTERING;
PRE_PROBEBLOCK();
pret = (size < elsize) ? NULL : malloc(size);
- if (pret)
- adhoc_bzero(pret, nelem * elsize);
+ if (pret) /* `memset' somewhy deadloops */
+ adhoc_bzero(pret, nelem * elsize);
if(pret != NULL && getTraceState() == 0)
{
return pret;
}
-
#include "da_memory.h"
#include "binproto.h"
-//#define INTERNALFILTERING (!isEnableInternalMalloc())
-#define INTERNALFILTERING true
-
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 = INTERNALFILTERING;
+ bfiltering = INTERNAL_NEW_FILTERING;
PRE_PROBEBLOCK();
pret = newp(size);
GET_REAL_FUNCP_RTLD_NEXT_CPP(_Znaj, newp);
- bfiltering = INTERNALFILTERING;
+ bfiltering = INTERNAL_NEW_FILTERING;
PRE_PROBEBLOCK();
pret = newp(size);
GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZdlPv, deletep);
- bfiltering = INTERNALFILTERING;
+ bfiltering = INTERNAL_DELETE_FILTERING;
PRE_PROBEBLOCK();
if(ptr != NULL && getTraceState() == 0)
GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZdaPv, deletep);
- bfiltering = INTERNALFILTERING;
+ bfiltering = INTERNAL_DELETE_FILTERING;
PRE_PROBEBLOCK();
if(ptr != NULL && getTraceState() == 0)
GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZnwjRKSt9nothrow_t, newp);
- bfiltering = INTERNALFILTERING;
+ bfiltering = INTERNAL_NEW_FILTERING;
PRE_PROBEBLOCK();
pret = newp(size, nothrow);
GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZnajRKSt9nothrow_t, newp);
- bfiltering = INTERNALFILTERING;
+ bfiltering = INTERNAL_NEW_FILTERING;
PRE_PROBEBLOCK();
pret = newp(size, nothrow);
GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZdlPvRKSt9nothrow_t, deletep);
- bfiltering = INTERNALFILTERING;
+ bfiltering = INTERNAL_DELETE_FILTERING;
PRE_PROBEBLOCK();
if(ptr != NULL && getTraceState() == 0)
GET_REAL_FUNCP_RTLD_NEXT_CPP(_ZdaPvRKSt9nothrow_t, deletep);
- bfiltering = INTERNALFILTERING;
+ bfiltering = INTERNAL_DELETE_FILTERING;
PRE_PROBEBLOCK();
if(ptr != NULL && getTraceState() == 0)
*/
#include <app.h>
+#include <Ecore.h>
#include "daprobe.h"
#include "dahelper.h"
#include "probeinfo.h"
-
#include "binproto.h"
+Ecore_Event_Handler* register_orientation_event_listener();
+void unregister_orientation_event_listener(Ecore_Event_Handler* handler);
+
app_event_callback_s gAppCallback;
#define PACK_ORIGINAL_APPFWCYCLE(API_ID, RVAL, INPUTFORMAT, ...) \
int app_efl_main(int *argc, char ***argv, app_event_callback_s *callback, void *user_data)
{
static int (*app_efl_mainp)(int* argc, char*** argv, app_event_callback_s* callback, void* user_data);
+ Ecore_Event_Handler* handler;
int ret;
GET_REAL_FUNC(app_efl_main, LIBCAPI_APPFW_APPLICATION);
+ probeBlockStart();
+ handler = register_orientation_event_listener();
gAppCallback.create = callback->create;
gAppCallback.terminate = callback->terminate;
gAppCallback.pause = callback->pause;
if(callback->service)
callback->service = _dalc_app_service;
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->pause = gAppCallback.pause;
callback->resume = gAppCallback.resume;
callback->service = gAppCallback.service;
callback->device_orientation = gAppCallback.device_orientation;
+ probeBlockEnd();
return ret;
}