[COMMON] sched: ems: Create sysfs directory of ontime/lbt
authorDaeyeong Lee <daeyeong.lee@samsung.com>
Tue, 20 Mar 2018 09:51:21 +0000 (18:51 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:33:26 +0000 (17:33 +0900)
Change-Id: I68162de1f59ddc5d29efce3350a90357023b9804
Signed-off-by: Daeyeong Lee <daeyeong.lee@samsung.com>
kernel/sched/ems/ehmp.c

index d0eb259fc1c70963e7ef40229c7a5af00c50cf67..8ffb61693f9395b6a8d469c14abf35b0612382c8 100644 (file)
@@ -437,6 +437,27 @@ static ssize_t store_overutil_ratio(struct kobject *kobj,
 static struct kobj_attribute overutil_ratio_attr =
 __ATTR(overutil_ratio, 0644, show_overutil_ratio, store_overutil_ratio);
 
+static struct attribute *lbt_attrs[] = {
+       &overutil_ratio_attr.attr,
+       NULL,
+};
+
+static const struct attribute_group lbt_group = {
+       .attrs = lbt_attrs,
+};
+
+static struct kobject *lbt_kobj;
+
+static int __init lbt_sysfs_init(struct kobject *parent)
+{
+       int ret;
+
+       lbt_kobj = kobject_create_and_add("lbt", parent);
+       ret = sysfs_create_group(lbt_kobj, &lbt_group);
+
+       return ret;
+}
+
 /****************************************************************/
 /*                     Initialization                          */
 /****************************************************************/
@@ -1890,6 +1911,29 @@ static ssize_t store_min_residency(struct kobject *kobj,
 static struct kobj_attribute min_residency_attr =
 __ATTR(min_residency, 0644, show_min_residency, store_min_residency);
 
+static struct attribute *ontime_attrs[] = {
+       &min_residency_attr.attr,
+       &up_threshold_attr.attr,
+       &down_threshold_attr.attr,
+       NULL,
+};
+
+static const struct attribute_group ontime_group = {
+       .attrs = ontime_attrs,
+};
+
+static struct kobject *ontime_kobj;
+
+static int __init ontime_sysfs_init(struct kobject *parent)
+{
+       int ret;
+
+       ontime_kobj = kobject_create_and_add("ontime", parent);
+       ret = sysfs_create_group(ontime_kobj, &ontime_group);
+
+       return ret;
+}
+
 /****************************************************************/
 /*                     initialization                          */
 /****************************************************************/
@@ -2035,10 +2079,6 @@ exit:
  **********************************************************************/
 static struct attribute *ehmp_attrs[] = {
        &global_boost_attr.attr,
-       &min_residency_attr.attr,
-       &up_threshold_attr.attr,
-       &down_threshold_attr.attr,
-       &overutil_ratio_attr.attr,
        &prefer_perf_attr.attr,
        &initial_util_type.attr,
        &initial_util_ratio.attr,
@@ -2057,6 +2097,16 @@ static int __init init_sysfs(void)
 
        ehmp_kobj = kobject_create_and_add("ehmp", kernel_kobj);
        ret = sysfs_create_group(ehmp_kobj, &ehmp_group);
+       if (ret)
+               return ret;
+
+       ret = ontime_sysfs_init(ehmp_kobj);
+       if (ret)
+               return ret;
+
+       ret = lbt_sysfs_init(ehmp_kobj);
+       if (ret)
+               return ret;
 
        return 0;
 }