return true;
}
+frsh_resource_id_t frsh_get_local_cpu_id(void)
+{
+ frsh_resource_id_t id;
+ long int ret = FRSH_CPU_ID_DEFAULT;
+ if (getenv("FRSH_CPU_ID")) {
+ errno = 0; /* See strtol(1) */
+ ret = strtol(getenv("FRSH_CPU_ID"), NULL, 10);
+ if (errno != 0)
+ ret = FRSH_CPU_ID_DEFAULT;
+ }
+ return ret;
+}
{
int rv;
+ aqcpu_allocator.res_id = frsh_get_local_cpu_id();
+
if ((rv = fra_register(&aqcpu_allocator))) {
return rv;
}
return 0;
}
-static const struct fres_res_manager frm = {
+static struct fres_res_manager frm = {
.res_type = FRSH_RT_PROCESSOR,
.res_id = FRSH_CPU_ID_DEFAULT,
.admission_test = aqcpu_admtest,
orb = forb_init(&argc, &argv, &attr);
if (!orb) error(1, errno, "forb_init");
-
+
+ frm.res_id = frsh_get_local_cpu_id();
ret = frm_register_and_run(orb, &frm);
if (ret != 0) {
{
int rv;
+ cpucg_allocator.res_id = frsh_get_local_cpu_id();
+
if ((rv = fra_register(&cpucg_allocator))) {
return rv;
}
#include <ul_log.h>
#include <ul_logreg.h>
#include <stdio.h>
+#include <frsh_core.h>
UL_LOG_CUST(ulogd_frm_cpucg);
ul_log_domain_t ulogd_frm_cpucg = {UL_LOGL_DEB, "frm_cpucg"};
return 0;
}
-static const struct fres_res_manager frm = {
+static struct fres_res_manager frm = {
.res_type = FRSH_RT_PROCESSOR,
.res_id = 0,
.name = "cgroup",
}
fclose(fd);
+ frm.res_id = frsh_get_local_cpu_id();
ret = frm_register_and_run(orb, &frm);
if (ret != 0) {
error(1, errno, "frm_generic_run");