[Title] change runtime system api by request from scm
authorgreatim <jaewon81.lim@samsung.com>
Wed, 3 Jul 2013 06:55:19 +0000 (15:55 +0900)
committergreatim <jaewon81.lim@samsung.com>
Wed, 3 Jul 2013 06:55:19 +0000 (15:55 +0900)
[Desc.]
[Issue]

Change-Id: Ica649006410ce58fee5d4a8259003a6b30cf5dac

daemon/sys_stat.c
daemon/threads.c
packaging/dynamic-analysis-manager.changes [new file with mode: 0644]

index d1b5249..a89cba7 100644 (file)
@@ -79,6 +79,8 @@
 #define CPUMHZ         "cpu MHz"
 #define DA_PROBE_TIZEN_SONAME          "da_probe_tizen.so"
 #define DA_PROBE_OSP_SONAME                    "da_probe_osp.so"
+#define CAMCORDER_FILE         "/usr/etc/mmfw_camcorder.ini"
+#define CAMERA_COUNT_STR       "DeviceCount"
 
 enum PROCESS_DATA
 {
@@ -986,7 +988,7 @@ static int update_system_cpu_frequency(int cur_index)
                }
                else
                {
-                       LOGW("Cannot open cpu0 frequency file\n");
+//                     LOGW("Cannot open cpu0 frequency file\n");
                        return -11;
                }
 
@@ -1264,7 +1266,6 @@ static int get_fsinfo(const char* path, int type)
        total = (int)((long long)(buf.f_bsize / 1024LL * buf.f_blocks) / 1024LL);
        free = (int)((long long)(buf.f_bsize / 1024LL * buf.f_bavail) / 1024LL);
 
-       LOGI("File storage total(%d), free(%d)\n", total, free);
        if (type == FSINFO_TYPE_TOTAL)
        {
                return total;
@@ -1543,6 +1544,43 @@ static void get_app_info(const char* binary_path, char* width,
 }
 */
 
+static int get_camera_count()
+{
+       FILE* fp;
+       int count = 0;
+       int size;
+       char* tmp;
+       char buf[BUFFER_MAX];
+
+       fp = fopen(CAMCORDER_FILE, "r");
+       if(fp != NULL)
+       {
+               size = strlen(CAMERA_COUNT_STR);
+
+               while(fgets(buf, BUFFER_MAX, fp) != NULL)
+               {
+                       if(strncmp(buf, CAMERA_COUNT_STR, size) == 0)
+                       {
+                               tmp = strchr(buf, '=');
+                               if(tmp != NULL)
+                               {
+                                       tmp++;
+                                       while(isspace(*tmp))
+                                               tmp++;
+
+                                       count = atoi(tmp);
+                               }
+
+                               break;
+                       }
+               }
+
+               fclose(fp);
+       }
+
+       return count;
+}
+
 static int get_device_availability_info(char* buf, int buflen)
 {
        int camera_count = 0;
@@ -1553,11 +1591,11 @@ static int get_device_availability_info(char* buf, int buflen)
        int loglen = 0;
 
 #ifndef LOCALTEST
-       system_info_get_value_bool(SYSTEM_INFO_KEY_BLUETOOTH_SUPPORTED, &blue_support);
-       system_info_get_value_int(SYSTEM_INFO_KEY_CAMERA_COUNT, &camera_count);
-       system_info_get_value_bool(SYSTEM_INFO_KEY_GPS_SUPPORTED, &gps_support);
+       system_info_get_platform_bool("tizen.org/feature/network.bluetooth", &blue_support);
+       camera_count = get_camera_count();
+       system_info_get_platform_bool("tizen.org/feature/location.gps", &gps_support);
        system_info_get_value_string(SYSTEM_INFO_KEY_NETWORK_TYPE, &networktype);
-       system_info_get_value_bool(SYSTEM_INFO_KEY_WIFI_SUPPORTED, &wifi_support);
+       system_info_get_platform_bool("tizen.org/feature/network.wifi", &wifi_support);
 #endif
 
        loglen += sprintf(buf, "%d`,%d`,%d`,%d`,",
@@ -1648,7 +1686,7 @@ int get_resource_info(char* buffer, int buffer_len, int* pidarray, int pidcount)
        int cpuloadpos = 0;
 //     unsigned int failed_cpu = 0;
 
-       LOGI("PID count : %d\n", pidcount);
+//     LOGI("PID count : %d\n", pidcount);
 
        if(update_process_data(pidarray, pidcount, PROCDATA_STAT) < 0)
        {
@@ -1773,7 +1811,6 @@ int get_resource_info(char* buffer, int buffer_len, int* pidarray, int pidcount)
 //                                     idle_tick_sum += cpuptr->idle_ticks;
 //                                     total_tick_sum += cpuptr->total_ticks;
 //                             }
-                               LOGI("System cpu usage log : %d, %Ld, %Ld\n", i, cpuptr->idle_ticks, cpuptr->total_ticks);
                                if(unlikely(cpuptr->cpu_usage < 0))
                                {
                                        cpuptr->cpu_usage = 0.0f;
@@ -1949,7 +1986,7 @@ int get_resource_info(char* buffer, int buffer_len, int* pidarray, int pidcount)
                        thread_loadbuf
                        );
        
-       LOGI("get_resource_info result : %s", buffer);
+//     LOGI("get_resource_info result : %s", buffer);
 
        event_num++;
        return res;
index f83f6c5..d7ea108 100644 (file)
@@ -130,10 +130,10 @@ static void* recvThread(void* data)
                else if(log.type == MSG_MSG)
                {
                        // don't send to host
-                       LOGI("EXTRA MSG %d|%d|%s\n", log.type, log.length, log.data);
+                       LOGI("PROBE MSG %d|%d|%s", log.type, log.length, log.data);
                        continue;
                }
-//             else if(log.type == MSG_LOG)// && log.data[0] == '1' && log.data[1] == '3')
+//             else if(log.type == MSG_LOG && log.data[0] == '7' && log.data[1] == '`')
 //             {
 //                     LOGI("%dclass|%s\n", log.data[0] - '0', log.data);
 //             }
diff --git a/packaging/dynamic-analysis-manager.changes b/packaging/dynamic-analysis-manager.changes
new file mode 100644 (file)
index 0000000..dd4d41f
--- /dev/null
@@ -0,0 +1,4 @@
+* 2.2.0
+- change some runtime system api by request from scm
+== Jaewon Lim <jaewon81.lim@samsung.com> 2013-07-03 16:00
+