resource: process-group: Fix unnecessary assignment and meaningless code 55/273655/2
authorDongwoo Lee <dwoo08.lee@samsung.com>
Mon, 11 Apr 2022 11:28:37 +0000 (20:28 +0900)
committerDongwoo Lee <dwoo08.lee@samsung.com>
Wed, 13 Apr 2022 02:13:54 +0000 (11:13 +0900)
Change-Id: I600fc27afa7ecb95853bc492bd997ee8d99d1e9a
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
src/resource/resource-process-group.c

index 959ef43..caab3a0 100644 (file)
@@ -387,7 +387,7 @@ static int update_aggr_taskstats(struct process_group_context *ctx)
                if (!curr)
                        return -ENOMEM;
 
-               ret = kernel_get_thread_group_taskstats(curr, pid, true);
+               ret = kernel_get_thread_group_taskstats(curr, pid, false);
                if (ret < 0) {
                        free(curr);
                        g_hash_table_iter_remove(&iter);
@@ -395,7 +395,7 @@ static int update_aggr_taskstats(struct process_group_context *ctx)
                }
 
                if (!prev) {
-                       node->stats = node->prev = curr;
+                       node->prev = curr;
                        continue;
                }
 
@@ -418,7 +418,6 @@ static int update_aggr_taskstats(struct process_group_context *ctx)
                                        / (curr->ac_etime - prev->ac_etime);
                free(prev);
                node->prev = curr;
-               node->stats = curr;
        }
 
        return 0;
@@ -506,14 +505,9 @@ static int process_group_prepare_update(struct resource *res)
        }
 
        g_hash_table_iter_init(&iter, ctx->pi_map);
-       while (g_hash_table_iter_next(&iter, &key, &value)) {
-               pnode = (struct process_info_node *)value;
-               if (!g_hash_table_contains(process_hash, key)) {
-                       pnode = (struct process_info_node *)value;
-
+       while (g_hash_table_iter_next(&iter, &key, &value))
+               if (!g_hash_table_contains(process_hash, key))
                        g_hash_table_iter_remove(&iter);
-               }
-       }
 
        if (ctx->pid < 0) {
                /* just add all processes into array if parent pid is negative */