[FIX] cherry-pick 03455c00538208e39ab328dbbc69480b6a18e983 + merge
authorwoojin <woojin2.jung@samsung.com>
Fri, 12 Jul 2013 23:21:34 +0000 (08:21 +0900)
committerAnastasia Lyupa <a.lyupa@samsung.com>
Tue, 23 Jul 2013 13:45:06 +0000 (17:45 +0400)
bug fix for some probe, add filesize value for Tizen::Io::File APIs

Change-Id: Ia85c4c0eeb2d51694195d1756b0bce7461cd1bc9

Conflicts:
packaging/swap-probe.spec
probe_badaapi/bada_file.cpp

Makefile
helper/libdaprobe.c
packaging/dynamic-analysis-probe.changes
probe_badaapi/bada_file.cpp
probe_badaapi/bada_sync.cpp
probe_badaapi/bada_thread.cpp
probe_badaapi/osp_constructor.cpp

index be2c3991d952250314a67fd8e5271b1ab8d80ea3..b5913e4e3438d3e52ec4e416d936d6e01cd84f50 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -67,7 +67,9 @@ TIZEN_TARGET = da_probe_tizen.so
 OSP_TARGET = da_probe_osp.so
 DUMMY_TARGET = libdaprobe.so
 
-FLAGS = -D_GNU_SOURCE -fPIC -shared -Wall -funwind-tables -fomit-frame-pointer -Xlinker --no-undefined
+COMMON_FLAGS = -D_GNU_SOURCE -fPIC -shared -Wall -funwind-tables -fomit-frame-pointer -Xlinker --no-undefined
+TIZEN_FLAGS = $(COMMON_FLAGS)
+OSP_FLAGS = $(COMMON_FLAGS) -DOSPAPP
 
 LIBDIR_COMMON = 
 LIBDIR_TIZEN = $(LIBDIR_COMMON) 
@@ -84,13 +86,13 @@ osp:        $(OSP_TARGET)
 dummy: $(DUMMY_TARGET)
 
 $(TIZEN_TARGET): $(TIZEN_SRCS)
-       $(CC) $(INC_TIZEN) $(FLAGS) $(LIBDIR_TIZEN) -o $@ $(TIZEN_SRCS) $(TIZEN_LDFLAGS)
+       $(CC) $(INC_TIZEN) $(TIZEN_FLAGS) $(LIBDIR_TIZEN) -o $@ $(TIZEN_SRCS) $(TIZEN_LDFLAGS)
 
 $(OSP_TARGET): $(OSP_SRCS)
-       $(CC) $(INC_OSP) $(FLAGS) $(LIBDIR_OSP) -o $@ $(OSP_SRCS) $(OSP_LDFLAGS)
+       $(CC) $(INC_OSP) $(OSP_FLAGS) $(LIBDIR_OSP) -o $@ $(OSP_SRCS) $(OSP_LDFLAGS)
 
 $(DUMMY_TARGET): $(DUMMY_SRCS)
-       $(CC) $(INC_OSP) $(FLAGS) -o $@ $(DUMMY_SRCS) $(DUMMY_LDFLAGS)
+       $(CC) $(INC_OSP) $(COMMON_FLAGS) -o $@ $(DUMMY_SRCS) $(DUMMY_LDFLAGS)
 
 
 install:
index 41546f0894abf77d209f33249644306612f378ae..518a18f7e9e3b2d6e64fc60a37f2584cccadfa51 100755 (executable)
@@ -56,6 +56,7 @@
 #include "binproto.h"
 
 #define APP_INSTALL_PATH               "/opt/apps"
+#define OSP_APP_POSTFIX                        ".exe"
 #define UDS_NAME                               "/tmp/da.socket"
 #define TIMERFD_INTERVAL               100000000               // 0.1 sec
 
@@ -172,9 +173,18 @@ static int determineCaller(char* tracestring)
        substr = strstr(tracestring, APP_INSTALL_PATH);
 
        if(substr == NULL)      // not user binary
+       {
                return 1;
+       }
        else                            // user binary
+       {
+#ifdef OSPAPP
+               substr = strstr(tracestring, OSP_APP_POSTFIX);
+               if(substr == NULL)
+                       return 1;
+#endif
                return 0;
+       }
 }
 
 // return current thread id
index 5e3aa16724e7770513fd525570a6d6125fcb5197..3cd68c44b91005c214ae25385b7125db47867acc 100644 (file)
@@ -1,4 +1,9 @@
-* 2.2.0
+* Fri Jul 12 2013 Woojin Jung <woojin2.jung@samsung.com>
+- bug fix for ThreadProc, File::Seek probe
+- add filesize value for probe log of Tizen::Io::File APIs
+- function call inside app loader is excluded from user call
+- use original header files for Tizen APIs
+
+* Wed Jul 3 2013 Jaewon Lim <jaewon81.lim@samsung.com>
 - change screenshot file name for multiprocess application
-== Jaewon Lim <jaewon81.lim@samsung.com> 2013-07-03 15:00
 
index 4d67eeaf1fd5f61af2ae3e77d00c7f3081a44576..b0ad06ae51a0bd77d68495cf468b6c39751a64f1 100755 (executable)
  * 
  */
 
-#include <FBase.h>
-//#include <FIo.h>
+#include <FIo.h>
 #include "daprobe.h"
 #include "probeinfo.h"
 #include "dahelper.h"
 
 #include "binproto.h"
 
-using namespace Tizen::Base;
-
-enum FileSeekPosition {
-       FILESEEKPOSITION_BEGIN, /**<The beginning of the file */
-       FILESEEKPOSITION_CURRENT, /**<The current position of the file */
-       FILESEEKPOSITION_END
-/**<The end of the file */
-};
-
 static enum DaOptions _sopt = OPT_FILE;
 
 namespace Tizen {
 namespace Io {
 
-class FileAttributes {
-public:
-       virtual bool Equals(const Object& object) const;
-       FileAttributes(const FileAttributes &fileAttributes);
-       FileAttributes(void);
-       DateTime GetDateTime(void) const;
-       long long GetFileSize(void) const;
-       virtual int GetHashCode(void) const;
-       DateTime GetLastModifiedTime(void) const;
-       bool IsDirectory(void) const;
-       bool IsHidden(void) const;
-       bool IsReadOnly(void) const;
-       FileAttributes & operator=(const FileAttributes &fileAttributes);
-       virtual ~FileAttributes(void);
-};
-
-class File {
-public:
-
-/* deprecated apis
- *   
-       result Construct(const Tizen::Base::String& filePath,
-                       const Tizen::Base::String& openMode, bool secureMode,
-                       bool createParentDirectories);
-       result Construct(const Tizen::Base::String& filePath,
-                       const Tizen::Base::String& openMode, bool secureMode,
-                       const Tizen::Base::ByteBuffer& key, bool createParentDirectories);
-       
-       result Construct(const Tizen::Base::String& filePath,
-                       const Tizen::Base::String& openMode,
-                       const Tizen::Base::ByteBuffer& secretKey);
-*/     
-       result Construct(const Tizen::Base::String& filePath,
-                       const Tizen::Base::String& openMode, bool createParentDirectories);
-       result Construct(const Tizen::Base::String& filePath,
-                       const Tizen::Base::String& openMode);
-       
-       result Construct(const Tizen::Base::String& filePath,
-                       const char *pOpenMode);
-       result Construct(const Tizen::Base::String& filePath,
-                       const char *pOpenMode, const Tizen::Base::ByteBuffer &seretKey);
-
-       
-       /*
-        File(void);
-        */
-       result Flush(void);
-
-       Tizen::Base::String GetName(void) const;
-       result Read(Tizen::Base::String& buffer);
-       result Read(Tizen::Base::ByteBuffer& buffer);
-       int Read(void *buffer, int length);
-       result Seek(FileSeekPosition position, long offset);
-
-       int Tell(void) const;
-
-       result Truncate(int length);
-
-       result Write(const void *buffer, int length);
-
-       result Write(const Tizen::Base::ByteBuffer& buffer);
-       result Write(const Tizen::Base::String& buffer);
-       virtual ~File(void);
-       /*
-        // static methods
-        static result ConvertToSecureFile(const Tizen::Base::String &plainFilePath,
-        const Tizen::Base::String &secureFilePath);
-        static result ConvertToSecureFile(const Tizen::Base::String &plainFilePath,
-        const Tizen::Base::String &secureFilePath,
-        const Tizen::Base::ByteBuffer& key);
-        static result Copy(const Tizen::Base::String& srcFilePath,
-        const Tizen::Base::String& destFilePath, bool failIfExist);
-        static result GetAttributes(const Tizen::Base::String& filePath,
-        FileAttributes& attribute);
-        static const Tizen::Base::String GetFileExtension(
-        const Tizen::Base::String& filePath);
-
-        static const Tizen::Base::String GetFileName(const Tizen::Base::String& filePath);
-
-        const Tizen::Base::String& filePath);
-        static bool IsEncrypted(const Tizen::Base::String &filePath);
-        static bool IsFileExist(const Tizen::Base::String& filePath);
-        static result Move(const Tizen::Base::String& oldFilePath,
-        const Tizen::Base::String& newFilePath);
-        static result Remove(const Tizen::Base::String& filePath);
-        //     static Tizen::Base::Collection::IList *GetPathsToAppsN(void);
-        */
-};
-
-//File::File(void) {
-//static (File::*Filep)();
-//}
-
 result File::Construct(const Tizen::Base::String& filePath,
                const Tizen::Base::String& openMode, bool createParentDirectories) {
        typedef result (File::*methodType)(const Tizen::Base::String& filePath,
@@ -156,7 +53,8 @@ result File::Construct(const Tizen::Base::String& filePath,
        bool bfiltering = true;
        char temp_path[50];
        char temp_mode[50];
-       //FileAttributes attr;
+       FileAttributes attr;
+       long long size;
 
        if (!Constructp) {
                probeBlockStart();
@@ -180,15 +78,16 @@ result File::Construct(const Tizen::Base::String& filePath,
        ret = (this->*Constructp)(filePath, openMode, createParentDirectories);
 
        if(postBlockBegin(blockresult)) {
-
-                WcharToChar(temp_path,filePath.GetPointer());
-                WcharToChar(temp_mode,openMode.GetPointer()); 
+               File::GetAttributes(this->GetName(),attr);
+               size = attr.GetFileSize();
+               WcharToChar(temp_path,filePath.GetPointer());
+               WcharToChar(temp_mode,openMode.GetPointer()); 
                 
                PREPARE_LOCAL_BUF();
                PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE, API_ID_result_File__Construct_const_Tizen__Base__String__filePath__const_Tizen__Base__String__openMode__bool_createParentDirectories_,
                                  "ssd", temp_path, temp_mode, createParentDirectories);
                PACK_COMMON_END(ret, ret, blockresult);
-               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OPEN, 0, temp_path);
+               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OPEN, size, temp_path);
                FLUSH_LOCAL_BUF();
                 
                 postBlockEnd();
@@ -357,7 +256,8 @@ result File::Construct(const Tizen::Base::String& filePath,
        bool bfiltering = true;
        char temp_path[50];
        char temp_mode[50];
-       //FileAttributes attr;
+       FileAttributes attr;
+       long long size;
 
        if(!Constructp) {
                probeBlockStart();
@@ -381,15 +281,17 @@ result File::Construct(const Tizen::Base::String& filePath,
        ret = (this->*Constructp)(filePath, openMode);
 
        if(postBlockBegin(blockresult)) {
-                WcharToChar(temp_path,filePath.GetPointer());
-                WcharToChar(temp_mode,openMode.GetPointer());
+               WcharToChar(temp_path,filePath.GetPointer());
+               WcharToChar(temp_mode,openMode.GetPointer());
+               File::GetAttributes(this->GetName(),attr);
+               size = attr.GetFileSize();
 
                PREPARE_LOCAL_BUF();
                PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
                                  API_ID_result_File__Construct_const_Tizen__Base__String__filePath__const_Tizen__Base__String__openMode_,
                                  "ss", temp_path, temp_mode);
                PACK_COMMON_END(ret, ret, blockresult);
-               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OPEN, 0, temp_path);
+               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OPEN, size, temp_path);
                FLUSH_LOCAL_BUF();
 
                 postBlockEnd();
@@ -482,7 +384,8 @@ result File::Construct(const Tizen::Base::String& filePath,
        int blockresult;
        bool bfiltering = true;
        char temp[50];
-       //FileAttributes attr;
+       FileAttributes attr;
+       long long size;
 
        if(!Constructp) {
                probeBlockStart();
@@ -507,14 +410,16 @@ result File::Construct(const Tizen::Base::String& filePath,
 
        if(postBlockBegin(blockresult)) {
 
-                WcharToChar(temp,filePath.GetPointer());
+               WcharToChar(temp,filePath.GetPointer());
+               File::GetAttributes(this->GetName(),attr);
+               size = attr.GetFileSize();
 
                PREPARE_LOCAL_BUF();
                PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
                                  API_ID_result_File__Construct_const_Tizen__Base__String__filePath__const_char__pOpenMode_,
                                  "sp", temp, pOpenMode);
                PACK_COMMON_END(ret, ret, blockresult);
-               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OPEN, 0, temp);
+               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OPEN, size, temp);
                FLUSH_LOCAL_BUF();
 
                 postBlockEnd();
@@ -535,7 +440,8 @@ result File::Construct(const Tizen::Base::String& filePath,
        int blockresult;
        bool bfiltering = true;
        char temp[50];
-       //FileAttributes attr;
+       FileAttributes attr;
+       long long size;
 
        if(!Constructp) {
                probeBlockStart();
@@ -560,14 +466,16 @@ result File::Construct(const Tizen::Base::String& filePath,
        ret = (this->*Constructp)(filePath, pOpenMode, secretKey);
 
        if(postBlockBegin(blockresult)) {
-                WcharToChar(temp,filePath.GetPointer());
+               WcharToChar(temp,filePath.GetPointer());
+               File::GetAttributes(this->GetName(),attr);
+               size = attr.GetFileSize();
 
                PREPARE_LOCAL_BUF();
                PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
                                  API_ID_result_File__Construct_const_Tizen__Base__String__filePath__const_char__pOpenMode__const_Tizen__Base__ByteBuffer__secretKey_,
                                  "sp", temp, pOpenMode);
                PACK_COMMON_END(ret, ret, blockresult);
-               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OPEN, 0, temp);
+               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OPEN, size, temp);
                FLUSH_LOCAL_BUF();
 
                 postBlockEnd();
@@ -584,7 +492,8 @@ result File::Flush(void) {
        int blockresult;
        bool bfiltering = true;
        char temp[50];
-       //FileAttributes attr;
+       FileAttributes attr;
+       long long size;
 
        if (!Flushp) {
                probeBlockStart();
@@ -608,14 +517,16 @@ result File::Flush(void) {
        ret = (this->*Flushp)();
 
        if(postBlockBegin(blockresult)) {
-                WcharToChar(temp,this->GetName().GetPointer());
+               WcharToChar(temp,this->GetName().GetPointer());
+               File::GetAttributes(this->GetName(),attr);
+               size = attr.GetFileSize();
 
                PREPARE_LOCAL_BUF();
                PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
                                  API_ID_result_File__Flush_void_,
                                  "", 0);
                PACK_COMMON_END(ret, ret, blockresult);
-               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OTHER, 0, temp);
+               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OTHER, size, temp);
                FLUSH_LOCAL_BUF();
 
                 postBlockEnd();
@@ -632,7 +543,8 @@ Tizen::Base::String File::GetName(void) const{
        int blockresult;
        bool bfiltering = true;
        char temp[50];
-       //FileAttributes attr;
+       FileAttributes attr;
+       long long size;
 
        if (!GetNamep) {
                probeBlockStart();
@@ -657,14 +569,16 @@ Tizen::Base::String File::GetName(void) const{
        result res = GetLastResult();
 
        if(postBlockBegin(blockresult)) {
-                WcharToChar(temp,ret.GetPointer());
+               WcharToChar(temp,ret.GetPointer());
+               File::GetAttributes(this->GetName(),attr);
+               size = attr.GetFileSize();
 
                PREPARE_LOCAL_BUF();
                PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
                                  API_ID_Tizen__Base__String_File__GetName_void__const,
                                  "", 0);
                PACK_COMMON_END(ret.GetPointer(), res, blockresult);
-               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OTHER, 0, temp);
+               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OTHER, size, temp);
                FLUSH_LOCAL_BUF();
 
                 postBlockEnd();
@@ -682,7 +596,8 @@ result File::Read(Tizen::Base::String& buffer) {
        bool bfiltering = true;
        char temp[50];
        int nRead = 0;
-       //FileAttributes attr;
+       FileAttributes attr;
+       long long size;
 
        if (!Readp) {
                probeBlockStart();
@@ -707,15 +622,17 @@ result File::Read(Tizen::Base::String& buffer) {
        ret = (this->*Readp)(buffer);
 
        if(postBlockBegin(blockresult)) {
-                WcharToChar(temp,this->GetName().GetPointer());
-                nRead = buffer.GetLength();
+               File::GetAttributes(this->GetName(),attr);
+               WcharToChar(temp,this->GetName().GetPointer());
+               size = attr.GetFileSize();
+               nRead = buffer.GetLength();
 
                PREPARE_LOCAL_BUF();
                PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
                                  API_ID_result_File__Read_Tizen__Base__String__buffer_,
                                  "x", (unsigned long)&buffer);
                PACK_COMMON_END(ret, ret, blockresult);
-               PACK_RESOURCE(nRead, (unsigned long)this, FD_FILE, FD_API_READ, 0, temp);
+               PACK_RESOURCE(nRead, (unsigned long)this, FD_FILE, FD_API_READ, size, temp);
                FLUSH_LOCAL_BUF();
 
                 postBlockEnd();
@@ -733,7 +650,8 @@ result File::Read(Tizen::Base::ByteBuffer& buffer) {
        bool bfiltering = true;
        char temp[50];
        int nRead = 0;
-       //FileAttributes attr;
+       FileAttributes attr;
+       long long size;
 
        if (!Readp) {
                probeBlockStart();
@@ -758,15 +676,17 @@ result File::Read(Tizen::Base::ByteBuffer& buffer) {
        ret = (this->*Readp)(buffer);
 
        if(postBlockBegin(blockresult)) {
-                WcharToChar(temp,this->GetName().GetPointer());
-                buffer.GetInt(nRead);
+               File::GetAttributes(this->GetName(),attr);
+               WcharToChar(temp,this->GetName().GetPointer());
+               size = attr.GetFileSize();
+               buffer.GetInt(nRead);
 
                PREPARE_LOCAL_BUF();
                PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
                                  API_ID_result_File__Read_Tizen__Base__ByteBuffer__buffer_,
                                  "x", (unsigned long)&buffer);
                PACK_COMMON_END(ret, ret, blockresult);
-               PACK_RESOURCE(nRead, (unsigned long)this, FD_FILE, FD_API_READ, 0, temp);
+               PACK_RESOURCE(nRead, (unsigned long)this, FD_FILE, FD_API_READ, size, temp);
                FLUSH_LOCAL_BUF();
                
                 postBlockEnd();
@@ -784,7 +704,8 @@ int File::Read(void *buffer, int length) {
        bool bfiltering = true;
        char temp[50];
        int nRead = 0;
-       //FileAttributes attr;
+       FileAttributes attr;
+       long long size;
 
        if (!Readp) {
                probeBlockStart();
@@ -810,15 +731,17 @@ int File::Read(void *buffer, int length) {
        result res = GetLastResult();
 
        if(postBlockBegin(blockresult)) {
-                WcharToChar(temp,this->GetName().GetPointer());
-                nRead = Tell() - nRead;
+               File::GetAttributes(this->GetName(),attr);
+               WcharToChar(temp,this->GetName().GetPointer());
+               size = attr.GetFileSize();
+               nRead = Tell() - nRead;
 
                PREPARE_LOCAL_BUF();
                PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
                                  API_ID_int_File__Read_void__buffer__int_length_,
                                  "xd", (unsigned long)buffer, length);
                PACK_COMMON_END(ret, res, blockresult);
-               PACK_RESOURCE(nRead, (unsigned long)this, FD_FILE, FD_API_READ, 0, temp);
+               PACK_RESOURCE(nRead, (unsigned long)this, FD_FILE, FD_API_READ, size, temp);
                FLUSH_LOCAL_BUF();
 
                 postBlockEnd();
@@ -836,13 +759,14 @@ result File::Seek(FileSeekPosition position, long offset) {
        bool bfiltering = true;
        char temp[50];
        char temp_pos[50];
-       //FileAttributes attr;
+       FileAttributes attr;
+       long long size;
 
        if (!Seekp) {
                probeBlockStart();
 
                void *tmpPtr = dlsym(RTLD_NEXT,
-                               "_ZN5Tizen2Io4File4SeekE16FileSeekPositionl");
+                               "_ZN5Tizen2Io4File4SeekENS0_16FileSeekPositionEl");
 
                if (tmpPtr == NULL || dlerror() != NULL) {
                        perror("dlsym failed : Tizen::Io::File::Seek");
@@ -870,16 +794,19 @@ result File::Seek(FileSeekPosition position, long offset) {
                 else if(FILESEEKPOSITION_END == position)
                         strcpy(temp_pos, "FILESEEKPOSITION_END");
                 else
-                        sprintf(temp_pos, "%d", position);
 
-                WcharToChar(temp,this->GetName().GetPointer());
+               sprintf(temp_pos, "%d", position);
+
+               WcharToChar(temp,this->GetName().GetPointer());
+               File::GetAttributes(this->GetName(),attr);
+               size = attr.GetFileSize();
 
                PREPARE_LOCAL_BUF();
                PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
                                  API_ID_result_File__Seek_FileSeekPosition_position__long_offset_,
                                  "sx", temp_pos, offset);
                PACK_COMMON_END(ret, ret, blockresult);
-               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OTHER, 0, temp);
+               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OTHER, size, temp);
                FLUSH_LOCAL_BUF();
 
                 postBlockEnd();
@@ -896,7 +823,8 @@ int File::Tell(void) const {
        int blockresult;
        bool bfiltering = true;
        char temp[50];
-       //FileAttributes attr;
+       FileAttributes attr;
+       long long size;
 
        if (!Tellp) {
                probeBlockStart();
@@ -922,14 +850,16 @@ int File::Tell(void) const {
        result res = GetLastResult();
 
        if(postBlockBegin(blockresult)) {
-                WcharToChar(temp,this->GetName().GetPointer());
+               WcharToChar(temp,this->GetName().GetPointer());
+               File::GetAttributes(this->GetName(),attr);
+               size = attr.GetFileSize();
 
                PREPARE_LOCAL_BUF();
                PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
                                  API_ID_int_File__Tell_void__const,
                                  "", 0);
                PACK_COMMON_END(ret, res, blockresult);
-               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OTHER, 0, temp);
+               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OTHER, size, temp);
                FLUSH_LOCAL_BUF();
 
                 postBlockEnd();
@@ -946,7 +876,8 @@ result File::Truncate(int length) {
        int blockresult;
        bool bfiltering = true;
        char temp[50];
-       //FileAttributes attr;
+       FileAttributes attr;
+       long long size;
 
        if (!Truncatep) {
                probeBlockStart();
@@ -970,14 +901,16 @@ result File::Truncate(int length) {
        ret = (this->*Truncatep)(length);
 
        if(postBlockBegin(blockresult)) {
-                WcharToChar(temp,this->GetName().GetPointer());
+               WcharToChar(temp,this->GetName().GetPointer());
+               File::GetAttributes(this->GetName(),attr);
+               size = attr.GetFileSize();
 
                PREPARE_LOCAL_BUF();
                PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
                                  API_ID_result_File__Truncate_int_length_,
                                  "d", length);
                PACK_COMMON_END(ret, ret, blockresult);
-               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OTHER, 0, temp);
+               PACK_RESOURCE(0, (unsigned long)this, FD_FILE, FD_API_OTHER, size, temp);
                FLUSH_LOCAL_BUF();
 
                 postBlockEnd();
@@ -995,7 +928,8 @@ result File::Write(const void *buffer, int length) {
        bool bfiltering = true;
        char temp[50];
        int nWritten = 0;
-       //FileAttributes attr;
+       FileAttributes attr;
+       long long size;
 
        if (!Writep) {
                probeBlockStart();
@@ -1020,15 +954,17 @@ result File::Write(const void *buffer, int length) {
        ret = (this->*Writep)(buffer, length);
 
        if(postBlockBegin(blockresult)) {
-                WcharToChar(temp,this->GetName().GetPointer());
-                nWritten = Tell() - nWritten;
+               File::GetAttributes(this->GetName(),attr);
+               WcharToChar(temp,this->GetName().GetPointer());
+               size = attr.GetFileSize();
+               nWritten = Tell() - nWritten;
 
                PREPARE_LOCAL_BUF();
                PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
                                  API_ID_result_File__Write_const_void__buffer__int_length_,
                                  "xd", (unsigned long)buffer, length);
                PACK_COMMON_END(ret, ret, blockresult);
-               PACK_RESOURCE(nWritten, (unsigned long)this, FD_FILE, FD_API_WRITE, 0, temp);
+               PACK_RESOURCE(nWritten, (unsigned long)this, FD_FILE, FD_API_WRITE, size, temp);
                FLUSH_LOCAL_BUF();
 
                 postBlockEnd();
@@ -1046,7 +982,8 @@ result File::Write(const Tizen::Base::ByteBuffer& buffer) {
        bool bfiltering = true;
        char temp[50];
        int nWritten = 0;
-       //FileAttributes attr;
+       FileAttributes attr;
+       long long size;
 
        if (!Writep) {
                probeBlockStart();
@@ -1071,15 +1008,17 @@ result File::Write(const Tizen::Base::ByteBuffer& buffer) {
        ret = (this->*Writep)(buffer);
 
        if(postBlockBegin(blockresult)) {
-                WcharToChar(temp,this->GetName().GetPointer());
-                nWritten = Tell() - nWritten;
+               File::GetAttributes(this->GetName(),attr);
+               WcharToChar(temp,this->GetName().GetPointer());
+               size = attr.GetFileSize();
+               nWritten = Tell() - nWritten;
 
                PREPARE_LOCAL_BUF();
                PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
                                  API_ID_result_File__Write_const_Tizen__Base__ByteBuffer__buffer_,
                                  "x", (unsigned long)&buffer);
                PACK_COMMON_END(ret, ret, blockresult);
-               PACK_RESOURCE(nWritten, (unsigned long)this, FD_FILE, FD_API_WRITE, 0, temp);
+               PACK_RESOURCE(nWritten, (unsigned long)this, FD_FILE, FD_API_WRITE, size, temp);
                FLUSH_LOCAL_BUF();
 
                 postBlockEnd();
@@ -1098,7 +1037,8 @@ result File::Write(const Tizen::Base::String& buffer) {
        char temp_buf[50];
        char temp_path[50];
        int nWritten = 0;
-       //FileAttributes attr;
+       FileAttributes attr;
+       long long size;
 
        if (!Writep) {
                probeBlockStart();
@@ -1123,16 +1063,19 @@ result File::Write(const Tizen::Base::String& buffer) {
        ret = (this->*Writep)(buffer);
 
        if(postBlockBegin(blockresult)) {
-                WcharToChar(temp_buf,buffer.GetPointer());
-                WcharToChar(temp_path,this->GetName().GetPointer());
-                nWritten = Tell() - nWritten;
+               WcharToChar(temp_buf,buffer.GetPointer());
+               WcharToChar(temp_path,this->GetName().GetPointer());
+               nWritten = Tell() - nWritten;
+               File::GetAttributes(this->GetName(),attr);
+               size = attr.GetFileSize();
+               nWritten = Tell() - nWritten;
 
                PREPARE_LOCAL_BUF();
                PACK_COMMON_BEGIN(MSG_PROBE_RESOURCE,
                                  API_ID_result_File__Write_const_Tizen__Base__String__buffer_,
                                  "s", temp_buf);
                PACK_COMMON_END(ret, ret, blockresult);
-               PACK_RESOURCE(nWritten, (unsigned long)this, FD_FILE, FD_API_WRITE, 0, temp_path);
+               PACK_RESOURCE(nWritten, (unsigned long)this, FD_FILE, FD_API_WRITE, size, temp_path);
                FLUSH_LOCAL_BUF();
 
                 postBlockEnd();
@@ -1147,6 +1090,8 @@ File::~File(void) {
        int blockresult;
        bool bfiltering = true;
        void *tmpPtr;
+       FileAttributes attr;
+       long long size;
 
        if (!FileDp) {
                probeBlockStart();
@@ -1164,6 +1109,8 @@ File::~File(void) {
 
        if((blockresult = preBlockBegin(CALLER_ADDRESS, bfiltering, _sopt)) != 0) {
                setProbePoint(&probeInfo);
+               File::GetAttributes(this->GetName(),attr);
+               size = attr.GetFileSize();
                preBlockEnd();
        }
 //
index 7546ffdce0d4b7279f65837638e8550b787d813f..b0931efa8411a8517e9637fc8ae241eb612bac9d 100755 (executable)
  *
  */
 
-#include <FBaseResult.h>
-#include <FBaseString.h>
-#include <FBaseRtTypes.h>
-
+#include <FBase.h>
 #include <string.h>
 #include "daprobe.h"
 #include "probeinfo.h"
@@ -47,68 +44,6 @@ namespace Tizen {
 namespace Base {
 namespace Runtime {
 
-class Mutex {
-public:
-       result Create(void);
-       result Create(const Tizen::Base::String& name);
-       result Release(void);
-       result Acquire(void);
-       result TryToAcquire(void);
-
-//     Mutex(void);
-//     virtual ~Mutex(void);
-
-//private:
-//     Mutex(const Mutex& value);
-//     Mutex& opereator =(const Mutex& value);
-
-//private:
-//     friend class _MutexImpl;
-//     class _MutexImpl * __pMutexImpl;
-};
-
-class Semaphore {
-public:
-       result Create(int count = 1);
-       result Create(const Tizen::Base::String& name, int count = 1);
-       result Acquire(long timeout = INFINITE);
-       result TryToAcquire(void);
-       result Release(void);
-
-//     Semaphore(void);
-//     virtual ~Semaphore(void);
-
-//private:
-//     Semaphore(const Semaphore& rhs);
-//     Semaphore& operator =(const Semaphore& rhs);
-
-//private:
-//     friend class _SemaphoreImpl;
-//     class _SemaphoreImpl * __pSemaphoreImpl;
-};
-
-class Monitor {
-public:
-       result Construct(void);
-       result Enter(void);
-       result Exit(void);
-       result Wait(void);
-       result Notify(void);
-       result NotifyAll(void);
-
-//     Monitor(void);
-//     virtual ~Monitor(void);
-
-//private:
-//     Monitor(const Monitor& rhs);
-//     Monitor& operator =(const Monitor& rhs);
-
-//private:
-//     friend class _MonitorImpl;
-//     class _MonitorImpl * __pMonitorImpl;
-};
-
-
 result Mutex::Create(void) {
        typedef result
                (Mutex::*methodType)(void);
index 1ed2ffeb3ae4212565d9f10c64ec448db40f98ea..d2378382ab36ab57625036534a4aef03e3e4540f 100755 (executable)
  *
  */
 
-//#include <FBase.h>
-#include <FBaseDataType.h>
-#include <FBaseRtIRunnable.h>
-#include <FBaseCol.h>
-//#include <FIo.h>
+#include <FBase.h>
 #include "daprobe.h"
 #include "probeinfo.h"
 #include "dahelper.h"
@@ -47,68 +43,6 @@ static enum DaOptions _sopt = OPT_THREAD;
 namespace Tizen {
 namespace Base {
 namespace Runtime {
-enum ThreadType {
-       THREAD_TYPE_WORKER = 0, /**< The worker thread mode */
-       THREAD_TYPE_EVENT_DRIVEN, /**< The event-driven thread mode */
-       THREAD_TYPE_MAIN
-// This enum value is for internal use only. Using this enum value can cause behavioral,
-// security-related, and consistency-related issues in the application.
-// The main thread mode
-};
-
-enum ThreadPriority {
-       THREAD_PRIORITY_HIGH, /**< The high priority*/
-       THREAD_PRIORITY_MID, /**< The mid priority*/
-       THREAD_PRIORITY_LOW,
-/**< The low priority*/
-};
-
-class Thread {
-public:
-       const static unsigned long DEFAULT_STACK_SIZE = 64 * 1024;
-
-       static result Sleep(long milliSeconds);
-       static Thread* GetCurrentThread(void);
-       static result Yield(void);
-       static result Exit(int exitCode=0x00);
-
-       result Construct(ThreadType threadType, long stackSize, // deprecated
-                       ThreadPriority priority = THREAD_PRIORITY_MID);
-       result Construct(long stackSize = DEFAULT_STACK_SIZE,
-                       ThreadPriority priority = THREAD_PRIORITY_MID);
-       result Construct(const Tizen::Base::String &name, long stackSize =
-                       DEFAULT_STACK_SIZE, ThreadPriority priority = THREAD_PRIORITY_MID);
-       result Construct(const Tizen::Base::String &name, ThreadType threadType, // deprecated
-                       long stackSize = DEFAULT_STACK_SIZE, ThreadPriority priority =
-                                       THREAD_PRIORITY_MID);
-       result Construct(IRunnable &target, long stackSize = DEFAULT_STACK_SIZE,
-                       ThreadPriority priority = THREAD_PRIORITY_MID);
-       result Construct(const Tizen::Base::String &name, IRunnable &target,
-                       long stackSize = DEFAULT_STACK_SIZE, ThreadPriority priority =
-                                       THREAD_PRIORITY_MID);
-       result GetExitCode(int &exitCode) const;
-       const Tizen::Base::String & GetName(void) const;
-       result Join(void);
-//     virtual bool OnStart(void); // deprecated
-//     virtual void OnStop(void); // deprecated
-//     virtual void OnUserEventReceivedN(RequestId requestId, // deprecated
-//                     Tizen::Base::Collection::IList *pArgs);
-//     virtual Tizen::Base::Object * Run(void);
-//     virtual result SendUserEvent(RequestId requestId, // deprecated
-//                     const Tizen::Base::Collection::IList *pArgs);
-       result Start(void);
-       result Stop(void); // deprecated
-
-//     Thread(void);
-//     virtual ~Thread(void);
-
-//private:
-//     Thread(const Thread& rhs);
-//     Thread& operator =(const Thread& rhs);
-//private:
-//     friend class _ThreadImpl;
-//     class _ThreadImpl* __pThreadImpl;
-};
 
 class _ThreadImpl {
 //public:
@@ -185,34 +119,6 @@ private:
 //     return ret;
 //}
 
-class EventDrivenThread : public Thread {
-public:
-       result Construct(long stackSize = DEFAULT_STACK_SIZE,
-                       ThreadPriority priority = THREAD_PRIORITY_MID);
-       result Construct(const Tizen::Base::String &name, long stackSize =
-                       DEFAULT_STACK_SIZE, ThreadPriority priority = THREAD_PRIORITY_MID);
-
-       virtual result Quit();
-//     virtual bool OnStart(void);
-//     virtual void OnStop(void);
-//     virtual void OnUserEventReceivedN(RequestId requestId,
-//                     Tizen::Base::Collection::IList *pArgs);
-//     virtual Tizen::Base::Object * Run(void);
-//     virtual result SendUserEvent(RequestId requestId,
-//                     const Tizen::Base::Collection::IList *pArgs);
-
-//     EventDrivenThread(void);
-//     virtual ~EventDrivenThread(void);
-
-//private:
-//     EventDrivenThread(const EventDrivenThread& rhs);
-//     EventDrivenThread& operator = (const EventDrivenThread& rhs);
-//private:
-//     class _EventDrivenThreadImpl* __pEventDrivenThreadImpl;
-//     friend class _EventDrivenThreadImpl;
-};
-
-
 void*
 _ThreadImpl::ThreadProc(void* params) {
        typedef void*
@@ -265,9 +171,7 @@ _ThreadImpl::ThreadProc(void* params) {
        }
        // all probe should be reachable inside thread start_routine (user implemented Thread::Run)
        probingEnd();
-       probeBlockEnd();
        (ThreadProcp)(params);
-       probeBlockStart();
        probingStart();
        //
        if (postBlockBegin(blockresult)) {
index e0083abaab96a2ee31284f9f0e87a013501cdc31..371bfca5cf72f9d326e8ac7864f45e1880f26302 100755 (executable)
@@ -378,11 +378,6 @@ class MessageBox
        MessageBox(void);
 };
 
-class NotificationFrame
-{
-       NotificationFrame(void);
-};
-
 class OptionMenu
 {
        OptionMenu(void);
@@ -1098,20 +1093,6 @@ MessageBox::MessageBox(void)
        (this->*messagebox_messageboxp)();
 }
 
-NotificationFrame::NotificationFrame(void)
-{
-       typedef void (NotificationFrame::*methodType)(void);
-       static methodType notificationframe_notificationframep;
-
-       GET_REAL_FUNC_OSP(_ZN5Tizen2Ui8Controls17NotificationFrameC2Ev, LIBOSP_UIFW, notificationframe_notificationframep);
-
-       probeBlockStart();
-       add_object_hash_type((void*)this, "NotificationFrame");
-       probeBlockEnd();
-
-       (this->*notificationframe_notificationframep)();
-}
-
 OptionMenu::OptionMenu(void)
 {
        typedef void (OptionMenu::*methodType)(void);