#define IS_OPT_SET_IN(OPT, reg) (reg & (OPT))
#define IS_OPT_SET(OPT) IS_OPT_SET_IN((OPT), prof_session.conf.use_features0)
-#define IS_SYSTEM_INFO_NEEDED() ( \
- IS_OPT_SET(FL_CPU) || \
- IS_OPT_SET(FL_PROCESSES) || \
- IS_OPT_SET(FL_MEMORY) || \
- IS_OPT_SET(FL_DISK) || \
- IS_OPT_SET(FL_NETWORK) || \
- IS_OPT_SET(FL_DEVICE) || \
- IS_OPT_SET(FL_ENERGY))
enum app_type {
AT_TIZEN =0x01,
struct system_info_t sys_info;
struct msg_data_t *msg;
- if (IS_SYSTEM_INFO_NEEDED()) {
- for (i = 0; i < MAX_TARGET_COUNT; i++) {
- if (manager.target[i].socket != -1 &&
- manager.target[i].pid != -1)
- pidarr[pidcount++] = manager.target[i].pid;
- }
+ for (i = 0; i < MAX_TARGET_COUNT; i++) {
+ if (manager.target[i].socket != -1 &&
+ manager.target[i].pid != -1)
+ pidarr[pidcount++] = manager.target[i].pid;
+ }
- if (get_system_info(&sys_info, pidarr, pidcount) == -1) {
- LOGE("Cannot get system info\n");
- //do not send sys_info because
- //it is corrupted
- continue;
- }
+ if (get_system_info(&sys_info, pidarr, pidcount) == -1) {
+ LOGE("Cannot get system info\n");
+ //do not send sys_info because
+ //it is corrupted
+ continue;
+ }
- msg = pack_system_info(&sys_info);
- if (!msg) {
- LOGE("Cannot pack system info\n");
- reset_system_info(&sys_info);
- continue;
- }
+ msg = pack_system_info(&sys_info);
+ if (!msg) {
+ LOGE("Cannot pack system info\n");
+ reset_system_info(&sys_info);
+ continue;
+ }
- write_to_buf(msg);
+ write_to_buf(msg);
- printBuf((char *)msg, MSG_DATA_HDR_LEN + msg->len);
+ printBuf((char *)msg, MSG_DATA_HDR_LEN + msg->len);
- free_msg_data(msg);
- reset_system_info(&sys_info);
- }
+ free_msg_data(msg);
+ reset_system_info(&sys_info);
flush_buf();
}
else if(signo == SIGUSR1)