resource: Add a new property "visibility" to attributes
authorSung-hun Kim <sfoon.kim@samsung.com>
Tue, 23 Aug 2022 11:13:57 +0000 (20:13 +0900)
committerSung-hun Kim <sfoon.kim@samsung.com>
Tue, 23 Aug 2022 11:13:57 +0000 (20:13 +0900)
To distinguish visibility of resource attributes, a new property
is added to each attribute.

Change-Id: Ie48f00f89ec6095e05e9f8fcf395e1ea0da026bb
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
12 files changed:
include/util/resource.h
src/resource/resource-battery.c
src/resource/resource-bus.c
src/resource/resource-cpu.c
src/resource/resource-disk.c
src/resource/resource-display.c
src/resource/resource-gpu.c
src/resource/resource-memory.c
src/resource/resource-network.c
src/resource/resource-process-group.c
src/resource/resource-process.c
src/resource/resource-system.c

index 19a08ab56e575f43910c68ac85ab2ee08211611f..43c178ac626eb2b5a99d9e7dee925485c1ff812e 100644 (file)
 struct resource;
 struct resource_attribute;
 
+enum {
+       VISIBILITY_PUBLIC,
+       VISIBILITY_PRIVATE,
+};
+
 struct array_value {
        int type;
        int length;
@@ -71,6 +76,7 @@ struct resource_attribute {
        const char name[BUFF_MAX];
        const u_int64_t id;
        const int type;
+       const int visibility;
        const struct resource_attribute_ops ops;
 };
 
index ed51d395f49b19e98aff369f1f8f17de348b9a90..dc5fc19aab806dbc0bc3c32a1fc41ef3688fbab7 100644 (file)
@@ -93,6 +93,7 @@ static const struct resource_attribute battery_attrs[] = {
                .name   = "BATTERY_ATTR_CAPACITY",
                .id     = BATTERY_ATTR_CAPACITY,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = battery_get_info,
                }
@@ -100,6 +101,7 @@ static const struct resource_attribute battery_attrs[] = {
                .name   = "BATTERY_ATTR_STATUS",
                .id     = BATTERY_ATTR_STATUS,
                .type   = DATA_TYPE_STRING,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = battery_get_status,
                }
@@ -107,6 +109,7 @@ static const struct resource_attribute battery_attrs[] = {
                .name   = "BATTERY_ATTR_TEMPERATURE",
                .id     = BATTERY_ATTR_TEMPERATURE,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = battery_get_info,
                }
@@ -114,6 +117,7 @@ static const struct resource_attribute battery_attrs[] = {
                .name   = "BATTERY_ATTR_VOLTAGE_NOW",
                .id     = BATTERY_ATTR_VOLTAGE_NOW,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = battery_get_info,
                }
@@ -121,6 +125,7 @@ static const struct resource_attribute battery_attrs[] = {
                .name   = "BATTERY_ATTR_CURRENT_NOW",
                .id     = BATTERY_ATTR_CURRENT_NOW,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = battery_get_info,
                }
@@ -128,6 +133,7 @@ static const struct resource_attribute battery_attrs[] = {
                .name   = "BATTERY_ATTR_PRESENT",
                .id     = BATTERY_ATTR_PRESENT,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = battery_get_info,
                }
@@ -135,6 +141,7 @@ static const struct resource_attribute battery_attrs[] = {
                .name   = "BATTERY_ATTR_ONLINE",
                .id     = BATTERY_ATTR_ONLINE,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = battery_get_info,
                }
index 007d1f440dfb90af7958113dada9c86b7534b119..b3b1316737269c5173cd561709fd9518314c22bd 100644 (file)
@@ -130,6 +130,7 @@ static const struct resource_attribute bus_attrs[] = {
                .name   = "BUS_ATTR_CUR_FREQ",
                .id     = BUS_ATTR_CUR_FREQ,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = bus_get_value_from_hal_power,
                },
@@ -137,6 +138,7 @@ static const struct resource_attribute bus_attrs[] = {
                .name   = "BUS_ATTR_MIN_FREQ",
                .id     = BUS_ATTR_MIN_FREQ,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = bus_get_value_from_hal_power,
                },
@@ -144,6 +146,7 @@ static const struct resource_attribute bus_attrs[] = {
                .name   = "BUS_ATTR_MAX_FREQ",
                .id     = BUS_ATTR_MAX_FREQ,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = bus_get_value_from_hal_power,
                }
@@ -151,6 +154,7 @@ static const struct resource_attribute bus_attrs[] = {
                .name   = "BUS_ATTR_AVAILABLE_MIN_FREQ",
                .id     = BUS_ATTR_AVAILABLE_MIN_FREQ,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = bus_get_value_from_hal_power,
                }
@@ -158,6 +162,7 @@ static const struct resource_attribute bus_attrs[] = {
                .name   = "BUS_ATTR_AVAILABLE_MAX_FREQ",
                .id     = BUS_ATTR_AVAILABLE_MAX_FREQ,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = bus_get_value_from_hal_power,
                }
@@ -165,6 +170,7 @@ static const struct resource_attribute bus_attrs[] = {
                .name   = "BUS_ATTR_CUR_GOVERNOR",
                .id     = BUS_ATTR_CUR_GOVERNOR,
                .type   = DATA_TYPE_STRING,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = bus_get_string_value,
                }
@@ -172,6 +178,7 @@ static const struct resource_attribute bus_attrs[] = {
                .name   = "BUS_ATTR_NAME",
                .id     = BUS_ATTR_NAME,
                .type   = DATA_TYPE_STRING,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = bus_get_string_value,
                }
index 82ac454bf7fd510b9e60ed5c64a511356f9ee651..cdc9eb842284fab52c333ff2ada3546b875f9469 100644 (file)
@@ -129,6 +129,7 @@ static const struct resource_attribute cpu_attrs[] = {
                .name   = "CPU_ATTR_CUR_FREQ",
                .id     = CPU_ATTR_CUR_FREQ,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = cpu_get_value_from_hal_power,
                },
@@ -136,6 +137,7 @@ static const struct resource_attribute cpu_attrs[] = {
                .name   = "CPU_ATTR_MIN_FREQ",
                .id     = CPU_ATTR_MIN_FREQ,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = cpu_get_value_from_hal_power,
                },
@@ -143,6 +145,7 @@ static const struct resource_attribute cpu_attrs[] = {
                .name   = "CPU_ATTR_MAX_FREQ",
                .id     = CPU_ATTR_MAX_FREQ,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = cpu_get_value_from_hal_power,
                }
@@ -150,6 +153,7 @@ static const struct resource_attribute cpu_attrs[] = {
                .name   = "CPU_ATTR_AVAILABLE_MIN_FREQ",
                .id     = CPU_ATTR_AVAILABLE_MIN_FREQ,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = cpu_get_value_from_hal_power,
                }
@@ -157,6 +161,7 @@ static const struct resource_attribute cpu_attrs[] = {
                .name   = "CPU_ATTR_AVAILABLE_MAX_FREQ",
                .id     = CPU_ATTR_AVAILABLE_MAX_FREQ,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = cpu_get_value_from_hal_power,
                }
@@ -164,6 +169,7 @@ static const struct resource_attribute cpu_attrs[] = {
                .name   = "CPU_ATTR_CUR_GOVERNOR",
                .id     = CPU_ATTR_CUR_GOVERNOR,
                .type   = DATA_TYPE_STRING,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = cpu_get_string_value,
                }
@@ -171,6 +177,7 @@ static const struct resource_attribute cpu_attrs[] = {
                .name   = "CPU_ATTR_NAME",
                .id     = CPU_ATTR_NAME,
                .type   = DATA_TYPE_STRING,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = cpu_get_string_value,
                }
index cc6a983a7a7b63c9010dc5af7a7644081fc79de4..29c73e589a2e35bc227aae60ad4b49762c108a54 100644 (file)
@@ -121,6 +121,7 @@ static const struct resource_attribute disk_attrs[] = {
                .name   = "DISK_ATTR_NAME",
                .id     = DISK_ATTR_NAME,
                .type   = DATA_TYPE_STRING,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = disk_get_value,
                },
@@ -128,6 +129,7 @@ static const struct resource_attribute disk_attrs[] = {
                .name   = "DISK_ATTR_READ_PER_SEC",
                .id     = DISK_ATTR_READ_PER_SEC,
                .type   = DATA_TYPE_DOUBLE,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = disk_get_value,
                },
@@ -135,6 +137,7 @@ static const struct resource_attribute disk_attrs[] = {
                .name   = "DISK_ATTR_WRITE_PER_SEC",
                .id     = DISK_ATTR_WRITE_PER_SEC,
                .type   = DATA_TYPE_DOUBLE,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = disk_get_value,
                },
@@ -142,6 +145,7 @@ static const struct resource_attribute disk_attrs[] = {
                .name   = "DISK_ATTR_READ_TOTAL",
                .id     = DISK_ATTR_READ_TOTAL,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = disk_get_value,
                },
@@ -149,6 +153,7 @@ static const struct resource_attribute disk_attrs[] = {
                .name   = "DISK_ATTR_WRITE_TOTAL",
                .id     = DISK_ATTR_WRITE_TOTAL,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = disk_get_value,
                },
index bd3b2034f676238a54a278baf56cb3c4dd2c500b..0f80219d703d2ec8f24089902863d6e73dc6f323 100644 (file)
@@ -186,6 +186,7 @@ static const struct resource_attribute display_attrs[] = {
                .name   = "DISPLAY_ATTR_FPS",
                .id     = DISPLAY_ATTR_FPS,
                .type   = DATA_TYPE_DOUBLE,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = display_get_fps,
                },
@@ -193,6 +194,7 @@ static const struct resource_attribute display_attrs[] = {
                .name   = "DISPLAY_ATTR_NAME",
                .id     = DISPLAY_ATTR_NAME,
                .type   = DATA_TYPE_STRING,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = display_get_name,
                },
index 5deae1456389423dbbcc53342bac6ff4117d86da..586822c296202bbcc1f6ba6f67d5b01286166c9a 100644 (file)
@@ -130,6 +130,7 @@ static const struct resource_attribute gpu_attrs[] = {
                .name   = "GPU_ATTR_CUR_FREQ",
                .id     = GPU_ATTR_CUR_FREQ,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = gpu_get_value_from_hal_power,
                },
@@ -137,6 +138,7 @@ static const struct resource_attribute gpu_attrs[] = {
                .name   = "GPU_ATTR_MIN_FREQ",
                .id     = GPU_ATTR_MIN_FREQ,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = gpu_get_value_from_hal_power,
                },
@@ -144,6 +146,7 @@ static const struct resource_attribute gpu_attrs[] = {
                .name   = "GPU_ATTR_MAX_FREQ",
                .id     = GPU_ATTR_MAX_FREQ,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = gpu_get_value_from_hal_power,
                }
@@ -151,6 +154,7 @@ static const struct resource_attribute gpu_attrs[] = {
                .name   = "GPU_ATTR_AVAILABLE_MIN_FREQ",
                .id     = GPU_ATTR_AVAILABLE_MIN_FREQ,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = gpu_get_value_from_hal_power,
                }
@@ -158,6 +162,7 @@ static const struct resource_attribute gpu_attrs[] = {
                .name   = "GPU_ATTR_AVAILABLE_MAX_FREQ",
                .id     = GPU_ATTR_AVAILABLE_MAX_FREQ,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = gpu_get_value_from_hal_power,
                }
@@ -165,6 +170,7 @@ static const struct resource_attribute gpu_attrs[] = {
                .name   = "GPU_ATTR_CUR_GOVERNOR",
                .id     = GPU_ATTR_CUR_GOVERNOR,
                .type   = DATA_TYPE_STRING,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = gpu_get_string_value,
                }
@@ -172,6 +178,7 @@ static const struct resource_attribute gpu_attrs[] = {
                .name   = "GPU_ATTR_NAME",
                .id     = GPU_ATTR_NAME,
                .type   = DATA_TYPE_STRING,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = gpu_get_string_value,
                }
index c3e89d79ed116b98262203d0da33fc1ea901cfbd..1c08fb6b304bd4d7578adcad108d4ac7cb9f8185 100644 (file)
@@ -129,6 +129,7 @@ static const struct resource_attribute memory_attrs[] = {
                .name   = "MEMORY_ATTR_TOTAL",
                .id     = MEMORY_ATTR_TOTAL,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = memory_get_memory_info,
                },
@@ -136,6 +137,7 @@ static const struct resource_attribute memory_attrs[] = {
                .name   = "MEMORY_ATTR_AVAILABLE",
                .id     = MEMORY_ATTR_AVAILABLE,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = memory_get_memory_info,
                },
@@ -143,6 +145,7 @@ static const struct resource_attribute memory_attrs[] = {
                .name   = "MEMORY_ATTR_FREE",
                .id     = MEMORY_ATTR_FREE,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = memory_get_memory_info,
                }
@@ -150,6 +153,7 @@ static const struct resource_attribute memory_attrs[] = {
                .name   = "MEMORY_ATTR_BUFFER",
                .id     = MEMORY_ATTR_BUFFER,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = memory_get_memory_info,
                }
@@ -157,6 +161,7 @@ static const struct resource_attribute memory_attrs[] = {
                .name   = "MEMORY_ATTR_CACHED",
                .id     = MEMORY_ATTR_CACHED,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = memory_get_memory_info,
                }
@@ -164,6 +169,7 @@ static const struct resource_attribute memory_attrs[] = {
                .name   = "MEMORY_ATTR_CMA_TOTAL",
                .id     = MEMORY_ATTR_CMA_TOTAL,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = memory_get_memory_info,
                }
@@ -171,6 +177,7 @@ static const struct resource_attribute memory_attrs[] = {
                .name   = "MEMORY_ATTR_CMA_FREE",
                .id     = MEMORY_ATTR_CMA_FREE,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = memory_get_memory_info,
                }
@@ -178,6 +185,7 @@ static const struct resource_attribute memory_attrs[] = {
                .name   = "MEMORY_ATTR_SWAP_TOTAL",
                .id     = MEMORY_ATTR_SWAP_TOTAL,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = memory_get_memory_info,
                }
@@ -185,6 +193,7 @@ static const struct resource_attribute memory_attrs[] = {
                .name   = "MEMORY_ATTR_SWAP_FREE",
                .id     = MEMORY_ATTR_SWAP_FREE,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = memory_get_memory_info,
                }
index b05f9ce65fe8803a390182b087346e2a4894eea3..315bda923021a38e4dc6f8ea5a3705f2bbf77b99 100644 (file)
@@ -67,6 +67,7 @@ static const struct resource_attribute network_attrs[] = {
                .name   = "NETWORK_ATTR_NAME",
                .id     = NETWORK_ATTR_NAME,
                .type   = DATA_TYPE_STRING,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = network_get_name,
                },
index 5bdbf52bd07151ac66a544335c875a9ec1a97433..40ebd3da6e8f44378a580586e01cffc048546431 100644 (file)
@@ -257,6 +257,7 @@ static const struct resource_attribute process_group_attrs[] = {
                .name   = "PROCESS_GROUP_ATTR_PID_LIST",
                .id     = PROCESS_GROUP_ATTR_PID_LIST,
                .type   = DATA_TYPE_ARRAY,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_group_get_pid_list,
                        .is_supported = process_group_check_taskstat_support,
@@ -265,6 +266,7 @@ static const struct resource_attribute process_group_attrs[] = {
                .name   = "PROCESS_GROUP_ATTR_NAME_LIST",
                .id     = PROCESS_GROUP_ATTR_NAME_LIST,
                .type   = DATA_TYPE_ARRAY,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_group_get_name_list,
                        .is_supported = process_group_check_taskstat_support,
@@ -273,6 +275,7 @@ static const struct resource_attribute process_group_attrs[] = {
                .name   = "PROCESS_GROUP_ATTR_CPU_UTIL",
                .id     = PROCESS_GROUP_ATTR_CPU_UTIL,
                .type   = DATA_TYPE_DOUBLE,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_group_get_cpu_util,
                        .is_supported = process_group_check_taskstat_support,
@@ -281,6 +284,7 @@ static const struct resource_attribute process_group_attrs[] = {
                .name   = "PROCESS_GROUP_ATTR_DISK_READ_PER_SEC",
                .id     = PROCESS_GROUP_ATTR_DISK_READ_PER_SEC,
                .type   = DATA_TYPE_DOUBLE,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_group_get_disk_attrs,
                        .is_supported = process_group_check_taskstat_support,
@@ -289,6 +293,7 @@ static const struct resource_attribute process_group_attrs[] = {
                .name   = "PROCESS_GROUP_ATTR_DISK_WRITE_PER_SEC",
                .id     = PROCESS_GROUP_ATTR_DISK_WRITE_PER_SEC,
                .type   = DATA_TYPE_DOUBLE,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_group_get_disk_attrs,
                        .is_supported = process_group_check_taskstat_support,
@@ -297,6 +302,7 @@ static const struct resource_attribute process_group_attrs[] = {
                .name   = "PROCESS_GROUP_ATTR_MEM_VIRT",
                .id     = PROCESS_GROUP_ATTR_MEM_VIRT,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_group_get_mem,
                        .is_supported = process_group_check_taskstat_support,
@@ -305,6 +311,7 @@ static const struct resource_attribute process_group_attrs[] = {
                .name   = "PROCESS_GROUP_ATTR_MEM_RSS",
                .id     = PROCESS_GROUP_ATTR_MEM_RSS,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_group_get_mem,
                        .is_supported = process_group_check_taskstat_support,
@@ -313,6 +320,7 @@ static const struct resource_attribute process_group_attrs[] = {
                .name   = "PROCESS_GROUP_ATTR_MEM_PSS",
                .id     = PROCESS_GROUP_ATTR_MEM_PSS,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_group_get_mem,
                        .is_supported = process_group_check_taskstat_support,
@@ -321,6 +329,7 @@ static const struct resource_attribute process_group_attrs[] = {
                .name   = "PROCESS_GROUP_ATTR_MEM_SWAP",
                .id     = PROCESS_GROUP_ATTR_MEM_SWAP,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_group_get_mem,
                        .is_supported = process_group_check_taskstat_support,
@@ -329,6 +338,7 @@ static const struct resource_attribute process_group_attrs[] = {
                .name   = "PROCESS_GROUP_ATTR_MEM_SWAP_PSS",
                .id     = PROCESS_GROUP_ATTR_MEM_SWAP_PSS,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_group_get_mem,
                        .is_supported = process_group_check_taskstat_support,
@@ -337,6 +347,7 @@ static const struct resource_attribute process_group_attrs[] = {
                .name   = "PROCESS_GROUP_ATTR_MEM_GPU",
                .id     = PROCESS_GROUP_ATTR_MEM_GPU,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_group_get_mem,
                        .is_supported = process_group_check_gpu_support,
index dfbe086b9755078107220d37836787ccb56d0f79..b58a0ebcca4ea4258c0c0b6015decfeead0afa56 100644 (file)
@@ -266,6 +266,7 @@ static const struct resource_attribute process_attrs[] = {
                .name   = "PROCESS_ATTR_CPU_UTIL",
                .id     = PROCESS_ATTR_CPU_UTIL,
                .type   = DATA_TYPE_DOUBLE,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_get_cpu_util,
                        .is_supported = process_check_taskstat_support,
@@ -274,6 +275,7 @@ static const struct resource_attribute process_attrs[] = {
                .name   = "PROCESS_ATTR_MEM_VIRT",
                .id     = PROCESS_ATTR_MEM_VIRT,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_get_mem_attrs,
                        .is_supported = process_check_taskstat_support,
@@ -282,6 +284,7 @@ static const struct resource_attribute process_attrs[] = {
                .name   = "PROCESS_ATTR_MEM_RSS",
                .id     = PROCESS_ATTR_MEM_RSS,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_get_mem_attrs,
                        .is_supported = process_check_taskstat_support,
@@ -290,6 +293,7 @@ static const struct resource_attribute process_attrs[] = {
                .name   = "PROCESS_ATTR_MEM_RSS_PERCENT",
                .id     = PROCESS_ATTR_MEM_RSS_PERCENT,
                .type   = DATA_TYPE_DOUBLE,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_get_mem_attrs,
                        .is_supported = process_check_taskstat_support,
@@ -298,6 +302,7 @@ static const struct resource_attribute process_attrs[] = {
                .name   = "PROCESS_ATTR_DISK_READ_PER_SEC",
                .id     = PROCESS_ATTR_DISK_READ_PER_SEC,
                .type   = DATA_TYPE_DOUBLE,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_get_disk_attrs,
                        .is_supported = process_check_taskstat_support,
@@ -306,6 +311,7 @@ static const struct resource_attribute process_attrs[] = {
                .name   = "PROCESS_ATTR_DISK_WRITE_PER_SEC",
                .id     = PROCESS_ATTR_DISK_WRITE_PER_SEC,
                .type   = DATA_TYPE_DOUBLE,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_get_disk_attrs,
                        .is_supported = process_check_taskstat_support,
@@ -314,6 +320,7 @@ static const struct resource_attribute process_attrs[] = {
                .name   = "PROCESS_ATTR_NAME",
                .id     = PROCESS_ATTR_NAME,
                .type   = DATA_TYPE_STRING,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_get_context_data,
                        .is_supported = resource_attr_supported_always,
@@ -322,6 +329,7 @@ static const struct resource_attribute process_attrs[] = {
                .name   = "PROCESS_ATTR_PGID",
                .id     = PROCESS_ATTR_PGID,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_get_context_data,
                        .is_supported = resource_attr_supported_always,
@@ -330,6 +338,7 @@ static const struct resource_attribute process_attrs[] = {
                .name   = "PROCESS_ATTR_PPID",
                .id     = PROCESS_ATTR_PPID,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_get_context_data,
                        .is_supported = resource_attr_supported_always,
@@ -338,6 +347,7 @@ static const struct resource_attribute process_attrs[] = {
                .name   = "PROCESS_ATTR_MEM_PSS",
                .id     = PROCESS_ATTR_MEM_PSS,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_get_mem_attrs,
                        .is_supported = resource_attr_supported_always,
@@ -346,6 +356,7 @@ static const struct resource_attribute process_attrs[] = {
                .name   = "PROCESS_ATTR_MEM_SWAP",
                .id     = PROCESS_ATTR_MEM_SWAP,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_get_mem_attrs,
                        .is_supported = resource_attr_supported_always,
@@ -354,6 +365,7 @@ static const struct resource_attribute process_attrs[] = {
                .name   = "PROCESS_ATTR_MEM_SWAP_PSS",
                .id     = PROCESS_ATTR_MEM_SWAP_PSS,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_get_mem_attrs,
                        .is_supported = resource_attr_supported_always,
@@ -362,6 +374,7 @@ static const struct resource_attribute process_attrs[] = {
                .name   = "PROCESS_ATTR_MEM_GPU",
                .id     = PROCESS_ATTR_MEM_GPU,
                .type   = DATA_TYPE_UINT64,
+               .visibility = VISIBILITY_PRIVATE,
                .ops    = {
                        .get = process_get_mem_attrs,
                        .is_supported = process_check_gpu_support,
index 6343b117027874aacd09a15d8ff37947dc969af7..92ab38517e9666441f0165d3a4e96f79b67cafd1 100644 (file)
@@ -171,6 +171,7 @@ static const struct resource_attribute system_attrs[] = {
                .name   = "SYSTEM_ATTR_CPU_UTIL",
                .id     = SYSTEM_ATTR_CPU_UTIL,
                .type   = DATA_TYPE_DOUBLE,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = system_get_avg_cpu_util,
                }
@@ -178,6 +179,7 @@ static const struct resource_attribute system_attrs[] = {
                .name   = "SYSTEM_ATTR_CPU_USER_UTIL",
                .id     = SYSTEM_ATTR_CPU_USER_UTIL,
                .type   = DATA_TYPE_DOUBLE,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = system_get_avg_cpu_util,
                }
@@ -185,6 +187,7 @@ static const struct resource_attribute system_attrs[] = {
                .name   = "SYSTEM_ATTR_CPU_SYS_UTIL",
                .id     = SYSTEM_ATTR_CPU_SYS_UTIL,
                .type   = DATA_TYPE_DOUBLE,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = system_get_avg_cpu_util,
                }
@@ -192,6 +195,7 @@ static const struct resource_attribute system_attrs[] = {
                .name   = "SYSTEM_ATTR_PER_CPU_UTIL",
                .id     = SYSTEM_ATTR_PER_CPU_UTIL,
                .type   = DATA_TYPE_ARRAY,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = system_get_per_cpu_util,
                }
@@ -199,6 +203,7 @@ static const struct resource_attribute system_attrs[] = {
                .name   = "SYSTEM_ATTR_PER_CPU_USER_UTIL",
                .id     = SYSTEM_ATTR_PER_CPU_USER_UTIL,
                .type   = DATA_TYPE_ARRAY,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = system_get_per_cpu_util,
                }
@@ -206,6 +211,7 @@ static const struct resource_attribute system_attrs[] = {
                .name   = "SYSTEM_ATTR_PER_CPU_SYS_UTIL",
                .id     = SYSTEM_ATTR_PER_CPU_SYS_UTIL,
                .type   = DATA_TYPE_ARRAY,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = system_get_per_cpu_util,
                }
@@ -213,6 +219,7 @@ static const struct resource_attribute system_attrs[] = {
                .name   = "SYSTEM_ATTR_POSSIBLE_CPU",
                .id     = SYSTEM_ATTR_POSSIBLE_CPU,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = system_get_cpu_num,
                }
@@ -220,6 +227,7 @@ static const struct resource_attribute system_attrs[] = {
                .name   = "SYSTEM_ATTR_ONLINE_CPU",
                .id     = SYSTEM_ATTR_ONLINE_CPU,
                .type   = DATA_TYPE_INT,
+               .visibility = VISIBILITY_PUBLIC,
                .ops    = {
                        .get = system_get_cpu_num,
                }