resource: process-group: Add checking support for PROCESS_GROUP_ATTR_GPU_MEM 59/277259/3
authorDongwoo Lee <dwoo08.lee@samsung.com>
Mon, 4 Jul 2022 02:41:38 +0000 (11:41 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 7 Jul 2022 01:54:20 +0000 (01:54 +0000)
Change-Id: Iefbaa9526f62fe1af5fb054f8cbacbe81863bb9b
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
src/resource/resource-process-group.c

index f126d60..b0b2ade 100644 (file)
@@ -230,6 +230,12 @@ static int process_group_get_disk_bps(const struct resource *res,
        return 0;
 }
 
+static bool process_group_check_gpu_support(const struct resource *resource,
+                                           const struct resource_attribute *attr)
+{
+       return kernel_check_gpu_support();
+}
+
 static const struct resource_attribute process_group_attrs[] = {
        {
                .name   = "PROCESS_GROUP_ATTR_PID_LIST",
@@ -317,7 +323,7 @@ static const struct resource_attribute process_group_attrs[] = {
                .type   = DATA_TYPE_UINT64,
                .ops    = {
                        .get = process_group_get_mem,
-                       .is_supported = resource_attr_supported_always,
+                       .is_supported = process_group_check_gpu_support,
                },
        },
 };