int nRet = 0;
int resource_id, count;
int32_t value;
- int resource_type = RESOURCE_MONITOR_TYPE_CPU;
+ int resource_type = RESOURCE_MONITOR_TYPE_SYSTEM;
struct resource_attr_info attrs[] = {
{
- .attr_id = RESOURCE_MONITOR_CPU_ATTR_CUR_FREQ,
+ .attr_id = RESOURCE_MONITOR_SYSTEM_ATTR_ONLINE_CPU,
.attr_type = DATA_TYPE_INT,
},
};
FPRINTF("[Line : %d][%s] resource_monitor_create_resource api failed.\\n", __LINE__, API_NAMESPACE);
return 1;
}
-
- nRet = resource_monitor_set_resource_ctrl(g_nMonitorId, resource_id, RESOURCE_MONITOR_CPU_CTRL_CLUSTER_ID, i);
- PRINT_RESULT_CLEANUP(RESOURCE_MONITOR_ERROR_NONE, nRet, "resource_monitor_set_resource_ctrl", ResourceMonitorGetError(nRet), resource_monitor_delete_resource(g_nMonitorId, resources[i].resource_id));
-
nRet = Resource_monitor_set_resource_attr(resource_id, 1, attrs);
PRINT_RESULT_CLEANUP(RESOURCE_MONITOR_ERROR_NONE, nRet, "Resource_monitor_set_resource_attr", ResourceMonitorGetError(nRet), resource_monitor_delete_resource(g_nMonitorId, resources[i].resource_id));
{
int monitor_id, resource_id, ret, count;
int32_t value;
- int resource_type = RESOURCE_MONITOR_TYPE_CPU;
+ int resource_type = RESOURCE_MONITOR_TYPE_SYSTEM;
struct resource_attr_info attrs[] = {
{
- .attr_id = RESOURCE_MONITOR_CPU_ATTR_CUR_FREQ,
+ .attr_id = RESOURCE_MONITOR_SYSTEM_ATTR_ONLINE_CPU,
.attr_type = DATA_TYPE_INT,
},
};
resource_id = resource_monitor_create_resource(monitor_id, resource_type);
assert_geq(resource_id, 0);
- ret = resource_monitor_set_resource_ctrl(monitor_id, resource_id,
- RESOURCE_MONITOR_CPU_CTRL_CLUSTER_ID, i);
- assert_eq(ret, 0);
-
- ret = __resource_monitor_set_resource_attr(monitor_id, resource_id, 1, attrs);
+ __resource_monitor_set_resource_attr(monitor_id, resource_id, 1, attrs);
ret = resource_monitor_update(monitor_id);
assert_eq(ret, 0);