函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\cpufreq_schedutil.c Create Date:2022-07-27 10:45:40
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:sugov_init

函数原型:static int sugov_init(struct cpufreq_policy *policy)

返回类型:int

参数:

类型参数名称
struct cpufreq_policy *policy
741  ret等于0
744  如果governor_data则返回:负EBUSY
747  cpufreq_enable_fast_switch(policy)
749  sg_policy等于sugov_policy_alloc(policy)
750  如果非sg_policy
751  ret等于负ENOMEM
752  转到:disable_fast_switch
755  ret等于sugov_kthread_create(sg_policy)
756  如果ret则转到:free_sg_policy
759  mutex_lock( & global_tunables_lock)
761  如果sysfs interface ***********************
762  如果WARN_ON(have_governor_per_policy())则
763  ret等于负EINVAL
764  转到:stop_kthread
766  governor_data等于sg_policy
767  tunables等于sysfs interface ***********************
769  gov_attr_set_get( & attr_set, & tunables_hook)
770  转到:out
773  tunables等于sugov_tunables_alloc(sg_policy)
774  如果非tunables
775  ret等于负ENOMEM
776  转到:stop_kthread
779  rate_limit_us等于cpufreq_policy_transition_delay_us(policy)
781  governor_data等于sg_policy
782  tunables等于tunables
784  ret等于kobject_init_and_add() - Initialize a kobject structure and add it to* the kobject hierarchy.*@kobj: pointer to the kobject to initialize*@ktype: pointer to the ktype for this kobject.*@parent: pointer to the parent of this kobject.
787  如果ret则转到:fail
790  out :
791  mutex_unlock( & global_tunables_lock)
792  返回:0
794  fail :
795  递减引用计数对象
796  governor_data = NULL
797  sugov_tunables_free(tunables)
799  stop_kthread :
800  sugov_kthread_stop(sg_policy)
801  mutex_unlock( & global_tunables_lock)
803  free_sg_policy :
804  sugov_policy_free(sg_policy)
806  disable_fast_switch :
807  cpufreq_disable_fast_switch(policy)
809  打印错误信息("initialization failed (error %d)\n", ret)
810  返回:ret