Reduce inefficient logs 38/318938/2
authorChanggyu Choi <changyu.choi@samsung.com>
Fri, 11 Oct 2024 04:09:01 +0000 (13:09 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Fri, 11 Oct 2024 04:25:14 +0000 (13:25 +0900)
Some logs can be reduced. This patch reduces ineffieient logs.

Change-Id: I7b22237f698f6f685e5b684c03ba5911aa2a07fa
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/lib/amd_anr_monitor.cc
src/lib/amd_app_control.cc
src/lib/amd_app_status.cc
src/lib/amd_comp_status.c
src/lib/amd_proc.cc
src/lib/amd_signal.cc
src/modules/complication/src/amd_complication.c
src/modules/rpc-port/amd_rpc_port.cc

index a3a399477513a016cc8e447777f472cb73fef891..05c746d3318770f5a4a4bac82f221c21d0d3804b 100644 (file)
@@ -308,7 +308,7 @@ int AnrMonitor::DispatchAnrNotify(request_h request) {
     AppRequest::SendSigkill(pid, req->GetUID());
   }
 
-  _I("[ANR_NOTIFY] pid: %d, cmd: %d", pid, cmd);
+  _I("pid: %d, cmd: %d", pid, cmd);
   return 0;
 }
 
index 0962d3485d2e6cc1946219c6256345b9e26528e0..a45ee3bf510e286837b62c5f6c429f6bdb7d79b9 100644 (file)
@@ -158,7 +158,7 @@ static int __dispatch_app_get_appid_list(request_h request) {
 
   aul_sock_send_bundle_with_fd(req->DetachFD(), ret,
       kb->GetHandle(), AUL_SOCK_NOREPLY);
-  _I("[APP_GET_APPID_LIST] result: %d", ret);
+  _I("result: %d", ret);
   return 0;
 }
 
@@ -179,7 +179,7 @@ static int __dispatch_app_get_app_control_default_apps(request_h request) {
 
   aul_sock_send_bundle_with_fd(req->DetachFD(), _request_get_cmd(req),
       b.GetHandle(), AUL_SOCK_NOREPLY);
-  _I("[APP_GET_APP_CONTROL_DEFAULT_APPS]");
+  _I("Done");
   return 0;
 }
 
@@ -218,7 +218,7 @@ static int __dispatch_app_set_app_control_default_app(request_h request) {
 
   amd::AppSvcManager::GetInst().AddAppSvc(req->GetTargetUID(), *kb);
   req->SendResult(ret);
-  _I("[APP_SET_APP_CONTROL_DEFAULT_APP] result(%d)", ret);
+  _I("result: %d", ret);
   return 0;
 }
 
@@ -237,7 +237,7 @@ static int __dispatch_app_unset_app_control_default_app(request_h request) {
 
   amd::AppSvcManager::GetInst().RemoveAppSvc(req->GetTargetUID(), buf);
   req->SendResult(ret);
-  _I("[APP_UNSET_APP_CONTROL_DEFAULT_APP] result(%d)", ret);
+  _I("result: %d", ret);
   return 0;
 }
 
@@ -270,8 +270,7 @@ static int __dispatch_app_get_app_control_default_app(request_h request) {
 
   aul_sock_send_bundle_with_fd(req->DetachFD(), APP_GET_INFO_OK,
       b.GetHandle(), AUL_SOCK_NOREPLY);
-  _I("[APP_GET_APP_CONTROL_DEFAULT_APP] app_control(%s), app_id(%s)",
-      app_control.c_str(), app_id.c_str());
+  _I("app_control(%s), app_id(%s)", app_control.c_str(), app_id.c_str());
   return 0;
 }
 
index 6d4944dab1a1066a159881b39ce8b78f1348baf2..71f9296b6a0aa193e23f9ed569d20537208d5581 100644 (file)
@@ -685,7 +685,7 @@ static int DispatchAppGetAppIDByPID(request_h request) {
 
   pid_t pid = std::stoi(pid_str);
   int ret = _app_status_get_appid_bypid(req->DetachFD(), pid);
-  _D("app_status_get_appid_bypid : %d : %d", pid, ret);
+  _D("pid(%d), ret(%d)", pid, ret);
   return 0;
 }
 
@@ -1028,7 +1028,7 @@ static int DispatchAppGetRunningContext(request_h request) {
   b->Add(AUL_K_PID, std::to_string(pid));
   int ret = aul_sock_send_bundle_with_fd(req->DetachFD(),
       APP_GET_INFO_OK, b->GetHandle(), AUL_SOCK_NOREPLY);
-  _I("[APP_GET_RUNNING_CONTEXT] result: %d", ret);
+  _I("result: %d", ret);
   return 0;
 }
 
@@ -1076,7 +1076,7 @@ static int DispatchAppContextGet(request_h request) {
   if (ret < 0)
     return ret;
 
-  _I("[APP_CONTEXT_GET] result: %d", ret);
+  _I("result: %d", ret);
   return 0;
 }
 
@@ -1130,7 +1130,7 @@ static int DispatchAppGetByInstanceID(request_h request) {
   if (ret < 0)
     return ret;
 
-  _I("[APP_CONTEXT_GET_BY_INSTANCE_ID] result: %d", ret);
+  _I("result: %d", ret);
   return 0;
 }
 
@@ -1175,7 +1175,7 @@ static int DispatchAppGetByPID(request_h request) {
   if (ret < 0)
     return ret;
 
-  _I("[APP_CONTEXT_GET_BY_PID] result: %d", ret);
+  _I("result: %d", ret);
   return 0;
 }
 
@@ -1223,7 +1223,7 @@ static int DispatchAppStatusUpdateV2(request_h request) {
   }
 
   req->SendResult(ret);
-  _W("[APP_STATUS_UPDATE_V2] pid(%d), status(%d), result(%d)", pid, status,
+  _W("pid(%d), status(%d), result(%d)", pid, status,
      ret);
 
   return 0;
index f13c1c23be8edd39319af5b6debfe162d7773449..912ae2155ef7a563d04ea2740d19f2f6b49edd46 100644 (file)
@@ -685,8 +685,7 @@ static int __dispatch_comp_context_is_running(request_h req)
        comp_status = _comp_status_find_by_instance_id(instance_id);
        is_running = (int)_comp_status_is_running(comp_status);
        _request_send_result(req, is_running);
-       _I("[COMP_CONTEXT_IS_RUNNING] is_running(%s)",
-                       is_running ? "true" : "false");
+       _I("is_running(%s)", is_running ? "true" : "false");
 
        return 0;
 }
index 954289ced5eefed439f44a0017609ee7f98a31d6..b94e76811729991fdda2d52fc9ea188137dc9145 100644 (file)
@@ -274,7 +274,7 @@ static int DispatchProcGetName(request_h request) {
   b.Add(AUL_K_PROC_NAME, proc_info->GetName());
   aul_sock_send_bundle_with_fd(req->DetachFD(), APP_GET_INFO_OK,
       b.GetHandle(), AUL_SOCK_NOREPLY);
-  _I("[PROC_GET_NAME] pid(%d), name(%s)", pid, proc_info->GetName().c_str());
+  _I("pid(%d), name(%s)", pid, proc_info->GetName().c_str());
   return 0;
 }
 
@@ -295,7 +295,7 @@ static int DispatchProcGetExtra(request_h request) {
   b.Add(AUL_K_PROC_EXTRA, reinterpret_cast<const char*>(extra_raw.first.get()));
   aul_sock_send_bundle_with_fd(req->DetachFD(), APP_GET_INFO_OK,
       b.GetHandle(), AUL_SOCK_NOREPLY);
-  _I("[PROC_GET_EXTRA] pid(%d), extra(%s)",
+  _I("pid(%d), extra(%s)",
       pid, reinterpret_cast<const char*>(extra_raw.first.get()));
   return 0;
 }
index 35da8116398ef5fba350e7fef1682015c52e110d..94d0ff7e9f4eeec90b9d2a396dba32906f3298bf 100644 (file)
@@ -236,7 +236,7 @@ int _signal_send_app_group_signal(int owner_pid, int child_pid,
     return -1;
   }
 
-  std::string log_message = "[SIGNAL_SEND_APP_GROUP_SIGNAL] " +
+  std::string log_message = "[APP_GROUP_SIGNAL] " +
       std::to_string(owner_pid) + "|" + std::to_string(child_pid);
   if (child_pkgid != nullptr)
     log_message += "|" + std::string(child_pkgid);
@@ -260,7 +260,7 @@ int _signal_send_app_status_change_signal(int pid, const char* appid,
     return -1;
   }
 
-  std::string log_message = "[SIGNAL_SEND_APP_STATUS_CHANGE_SIGNAL] " +
+  std::string log_message = "[APP_STATUS_CHANGE_SIGNAL] " +
       std::to_string(pid);
   if (appid != nullptr)
     log_message += "|" + std::string(appid);
@@ -286,7 +286,7 @@ int _signal_send_app_terminated_signal(int pid) {
     return -1;
   }
 
-  std::string log_message = "[SIGNAL_SEND_APP_TERMINATED_SIGNAL] " +
+  std::string log_message = "[APP_TERMINATED_SIGNAL] " +
       std::to_string(pid);
 
   amd::DBusBroker::GetInst().SendSignal(std::make_shared<amd::DBusRequest>(
@@ -307,7 +307,7 @@ int _signal_send_app_launch_request_signal(int pid, const char* appid,
     return -1;
   }
 
-  std::string log_message = "[SIGNAL_SEND_APP_LAUNCH_REQUEST_SIGNAL] " +
+  std::string log_message = "[APP_LAUNCH_REQUEST_SIGNAL] " +
       std::to_string(pid) + "|" + std::string(appid) + "|" +
       std::string(pkgid) + "|" + std::string(type);
 
@@ -330,7 +330,7 @@ int _signal_send_app_terminate_request_signal(int pid, const char* appid,
     return -1;
   }
 
-  std::string log_message = "[SIGNAL_SEND_APP_TERMINATE_REQUEST_SIGNAL] " +
+  std::string log_message = "[APP_TERMINATE_REQUEST_SIGNAL] " +
       std::to_string(pid);
   if (appid != nullptr)
     log_message += "|" + std::string(appid);
@@ -358,7 +358,7 @@ int _signal_send_app_resume_request_signal(int pid, const char* appid,
     return -1;
   }
 
-  std::string log_message = "[SIGNAL_SEND_APP_RESUME_REQUEST_SIGNAL] " +
+  std::string log_message = "[APP_RESUME_REQUEST_SIGNAL] " +
       std::to_string(pid);
   if (appid != nullptr)
     log_message += "|" + std::string(appid);
@@ -382,7 +382,7 @@ int _signal_send_app_dead(int pid) {
     return -1;
   }
 
-  std::string log_message = "[SIGNAL_SEND_APP_DEAD] " +
+  std::string log_message = "[APP_DEAD] " +
       std::to_string(pid);
   amd::DBusBroker::GetInst().SendSignal(std::make_shared<amd::DBusRequest>(
         AUL_DBUS_PATH, AUL_DBUS_SIGNAL_INTERFACE, AUL_DBUS_APPDEAD_SIGNAL,
@@ -453,7 +453,7 @@ int _signal_send_system_service(int pid) {
     return -1;
   }
 
-  std::string log_message = "[SIGNAL_SEND_SYSTEM_SERVICE] " +
+  std::string log_message = "[SYSTEM_SERVICE] " +
       std::to_string(pid);
   amd::DBusBroker::GetInst().SendSignal(std::make_shared<amd::DBusRequest>(
         RESOURCED_PROC_OBJECT, RESOURCED_PROC_INTERFACE,
@@ -468,7 +468,7 @@ int _signal_send_display_unlock_state(void) {
     return -1;
   }
 
-  std::string log_message = "[SIGNAL_SEND_DISPLAY_UNLOCK_STATE]";
+  std::string log_message = "[DISPLAY_UNLOCK_STATE]";
   amd::DBusBroker::GetInst().MethodCall(std::make_shared<amd::DBusRequest>(
         SYSTEM_BUS_NAME, SYSTEM_PATH_DISPLAY, SYSTEM_INTERFACE_DISPLAY,
         SYSTEM_UNLOCK_STATE, std::move(log_message), parameters));
@@ -483,7 +483,7 @@ int _signal_send_display_lock_state(void) {
     return -1;
   }
 
-  std::string log_message = "[SIGNAL_SEND_DISPLAY_LOCK_STATE]";
+  std::string log_message = "[DISPLAY_LOCK_STATE]";
   amd::DBusBroker::GetInst().MethodCall(std::make_shared<amd::DBusRequest>(
         SYSTEM_BUS_NAME, SYSTEM_PATH_DISPLAY, SYSTEM_INTERFACE_DISPLAY,
         SYSTEM_LOCK_STATE, std::move(log_message), parameters));
@@ -560,8 +560,7 @@ int _signal_send_tep_unmount(const char* mount_path) {
     return -1;
   }
 
-  std::string log_message = "[SIGNAL_SEND_TEP_UNMOUNT] " +
-      std::string(mount_path);
+  std::string log_message = "[TEP_UNMOUNT] " + std::string(mount_path);
   amd::DBusBroker::GetInst().MethodCall(std::make_shared<amd::DBusRequest>(
         TEP_BUS_NAME, TEP_OBJECT_PATH, TEP_INTERFACE_NAME, TEP_UNMOUNT_METHOD,
         std::move(log_message), parameters));
@@ -589,7 +588,7 @@ int _signal_send_tep_mount(char* mount_path[], const char* pkgid) {
     return -1;
   }
 
-  std::string log_message = "[SIGNAL_SEND_TEP_MOUNT] " +
+  std::string log_message = "[TEP_MOUNT] " +
       std::string(mount_path[0]) + "|" + std::string(mount_path[1]);
   amd::DBusBroker::GetInst().MethodCall(std::make_shared<amd::DBusRequest>(
         TEP_BUS_NAME, TEP_OBJECT_PATH, TEP_INTERFACE_NAME, TEP_MOUNT_METHOD,
@@ -604,7 +603,7 @@ int _signal_send_proc_suspend(int pid) {
     return -1;
   }
 
-  std::string log_message = "[SIGNAL_SEND_PROC_SUSPEND] " +
+  std::string log_message = "[PROC_SUSPEND] " +
       std::to_string(pid);
   amd::DBusBroker::GetInst().SendSignal(std::make_shared<amd::DBusRequest>(
         APPFW_SUSPEND_HINT_PATH, APPFW_SUSPEND_HINT_INTERFACE,
@@ -623,7 +622,7 @@ int _signal_send_proc_prelaunch(const char* appid, const char* pkgid,
     return -1;
   }
 
-  std::string log_message = "[SIGNAL_SEND_PROC_PRELAUNCH] " +
+  std::string log_message = "[PROC_PRELAUNCH] " +
       std::string(appid) + "|" + std::string(pkgid) + "|" +
       std::to_string(attribute) + "|" + std::to_string(category);
   amd::DBusBroker::GetInst().SendSignal(std::make_shared<amd::DBusRequest>(
@@ -645,7 +644,7 @@ int _signal_send_watchdog(int pid, int signal_num) {
     return -1;
   }
 
-  std::string log_message = "[SIGNAL_SEND_WATCHDOG] " + std::to_string(pid) +
+  std::string log_message = "[WATCHDOG] " + std::to_string(pid) +
       "|" + std::to_string(signal_num);
   amd::DBusBroker::GetInst().SendSignal(std::make_shared<amd::DBusRequest>(
         RESOURCED_PROC_OBJECT, RESOURCED_PROC_INTERFACE,
index cb019c53b891d6208fb25d9df70b057a50bf2912..3b494996ad08b504cfb0613e2762862be41cbef0 100644 (file)
@@ -87,7 +87,7 @@ static int __dispatch_complication_start(amd_request_h req)
                return -1;
        }
 
-       _I("[__COMPLICATION__] appid(%s), pid(%d), caller_pid(%d)",
+       _I("appid(%s), pid(%d), caller_pid(%d)",
                        appid, pid, caller_pid);
 
        return 0;
index 0ba6fdbe4d024a9537562d9706b44fa6db04c395..c99f2047adda7ce70c489702e36c71989a8bea4b 100644 (file)
@@ -281,7 +281,7 @@ static int DispatchRpcPortPrepareStub(amd_request_h req) {
 
   RpcRef(pid);
   int caller_pid = amd_request_get_pid(req);
-  _I("[__RPC_PORT__] app_id(%s), pid(%d), port_name(%s), caller_pid(%d)",
+  _I("app_id(%s), pid(%d), port_name(%s), caller_pid(%d)",
       app_id.c_str(), pid, port_name.c_str(), caller_pid);
   return 0;
 }
@@ -301,7 +301,7 @@ static int DispatchRpcPortCreateSocketPair(amd_request_h req) {
     return -1;
   }
 
-  _I("[__RPC_PORT__] A Pair of sockets: %d:%d", fds[0], fds[1]);
+  _I("A Pair of sockets: %d:%d", fds[0], fds[1]);
   ret = PassFds(amd_request_get_fd(req), &fds, 2);
   if (ret < 0) {
     _E("Failed to pass file descriptors");
@@ -316,7 +316,7 @@ static int DispatchRpcPortCreateSocketPair(amd_request_h req) {
 static int DispatchRpcPortNotifyRpcFinished(amd_request_h req) {
   pid_t pid = amd_request_get_pid(req);
   RpcUnref(pid);
-  _I("[__RPC_PORT__] pid(%d)", pid);
+  _I("pid(%d)", pid);
   return 0;
 }
 
@@ -376,7 +376,7 @@ static int DispatchRpcPortCreate(amd_request_h req) {
   }
 
   int fds[2] = { ret, };
-  _I("[__RPC_PORT__] port_name(%s), pid(%d), fd(%d)", port_name, pid, fds[0]);
+  _I("port_name(%s), pid(%d), fd(%d)", port_name, pid, fds[0]);
   ret = PassFds(amd_request_get_fd(req), &fds, 1);
   close(fds[0]);
   if (ret < 0) {
@@ -404,7 +404,7 @@ static int DispatchRpcPortDestroy(amd_request_h req) {
 
   pid_t pid = amd_request_get_pid(req);
   PortManager::GetInst().RemovePort(port_name, pid);
-  _I("[__RPC_PORT__] port_name(%s), pid(%d)", port_name, pid);
+  _I("port_name(%s), pid(%d)", port_name, pid);
   return 0;
 }
 
@@ -433,7 +433,7 @@ static int DispatchRpcPortExist(amd_request_h req) {
   uid_t target_uid = amd_request_get_target_uid(req);
   bool exist = PortManager::GetInst().ExistPort(app_id, port_name, target_uid);
   amd_request_send_result(req, exist ? 1 : 0);
-  _I("[__RPC_PORT__] app_id(%s), port_name(%s), exist(%s)",
+  _I("app_id(%s), port_name(%s), exist(%s)",
       app_id, port_name, exist ? "true" : "false");
   return 0;
 }
@@ -650,7 +650,7 @@ static int OnLaunchAppStartEnd(const char* msg, int arg1, int arg2, void* arg3,
   bundle* b = amd_request_get_bundle(request);
   const char* appid = bundle_get_val(b, AUL_K_APPID);
   const char* port_name = bundle_get_val(b, AUL_K_RPC_PORT);
-  _I("[__RPC_PORT__] app_id(%s), pid(%d), port_name(%s), caller_pid(%d)",
+  _I("app_id(%s), pid(%d), port_name(%s), caller_pid(%d)",
       appid, pid, port_name, caller_pid);
   return AMD_NOTI_CONTINUE;
 }