From: Daeyeong Lee Date: Tue, 20 Mar 2018 09:51:21 +0000 (+0900) Subject: [COMMON] sched: ems: Create sysfs directory of ontime/lbt X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=96f23da01c53d1112f56db188942354a5a44f98f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] sched: ems: Create sysfs directory of ontime/lbt Change-Id: I68162de1f59ddc5d29efce3350a90357023b9804 Signed-off-by: Daeyeong Lee --- diff --git a/kernel/sched/ems/ehmp.c b/kernel/sched/ems/ehmp.c index d0eb259fc1c7..8ffb61693f93 100644 --- a/kernel/sched/ems/ehmp.c +++ b/kernel/sched/ems/ehmp.c @@ -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; }