Remove process info
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 12 Jan 2021 02:24:30 +0000 (11:24 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 12 Jan 2021 04:18:21 +0000 (13:18 +0900)
Currently, AMD has a problem about handling ANR monitor.
Even though the process is terminated, the process information is not removed.
It causes wrong ANR issues.

Change-Id: Ief194a1245b465664a54a51603a14b7d5dd24ec4
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/lib/amd_anr_monitor.c

index 0eb38e99717898103d636b8a79607d3fa78a90ef..fa6a1d17e73af31fcee7f5dbdca17c09d1437e3c 100644 (file)
@@ -335,7 +335,20 @@ static int __on_signal_send_watchdog_start(const char *msg, int arg1, int arg2,
        _W("Watchdog pid(%d)", pid);
        _anr_monitor_remove_timer(pid);
 
-       return 0;
+       return NOTI_CONTINUE;
+}
+
+static int __on_main_app_dead(const char *msg, int arg1, int arg2,
+               void *arg3, bundle *data)
+{
+       int pid = arg1;
+
+       if (__find_proc_info(pid)) {
+               _W("Remove proc info. pid(%d)", pid);
+               __remove_proc_info(pid);
+       }
+
+       return NOTI_CONTINUE;
 }
 
 int _anr_monitor_init(void)
@@ -363,6 +376,8 @@ int _anr_monitor_init(void)
 
        _noti_listen(AMD_NOTI_MSG_SIGNAL_SEND_WATCHDOG_START,
                        __on_signal_send_watchdog_start);
+       _noti_listen(AMD_NOTI_MSG_MAIN_APP_DEAD,
+                       __on_main_app_dead);
 
        return 0;
 }