Function report |
Source Code:kernel\sched\psi.c |
Create Date:2022-07-28 09:46:53 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:psi_trigger_create
Proto:struct *psi_trigger_create(struct psi_group *group, char *buf, size_t nbytes, enum psi_res res)
Type:struct
Parameter:
Type | Parameter | Name |
---|---|---|
struct psi_group * | group | |
char * | buf | |
size_t | nbytes | |
enum psi_res | res |
1015 | If static_branch_likely( & psi_disabled) Then Return ERR_PTR( - EOPNOTSUPP) |
1018 | If sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments == 2 Then state = PSI_IO_SOME + res * 2 |
1020 | Else if sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments == 2 Then state = PSI_IO_FULL + res * 2 |
1025 | If state >= PSI_NONIDLE Then Return ERR_PTR( - EINVAL) |
1028 | If window_us < Min window size is 500ms || window_us > Max window size is 10s Then Return ERR_PTR( - EINVAL) |
1033 | If threshold_us == 0 || threshold_us > window_us Then Return ERR_PTR( - EINVAL) |
1036 | t = Allocation memory |
1042 | threshold = threshold_us * NSEC_PER_USEC |
1043 | size = window_us * NSEC_PER_USEC |
1046 | event = 0 |
1047 | last_event_time = 0 |
1048 | init_waitqueue_head( & event_wait) |
1051 | mutex_lock( & trigger_lock) |
1054 | struct sched_param param = {sched_priority = 1, } |
1059 | kworker = kthread_create_worker - create a kthread worker*@flags: flags modifying the default behavior of the worker*@namefmt: printf-style name for the kthread worker (task) |
1062 | mutex_unlock( & trigger_lock) |
1066 | kthread_init_delayed_work( & poll_work, psi_poll_work) |
1074 | nr_triggers[state]++ |
1075 | poll_states |= 1 << state |
1077 | mutex_unlock( & trigger_lock) |
1079 | Return t |
Name | Describe |
---|---|
psi_write |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |