函数逻辑报告 | 
Source Code:kernel\power\process.c | 
Create Date:2022-07-27 10:57:50 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| 首页 | 函数Tree | 
| 注解内核,赢得工具 | 下载SCCT | English | 
函数名称:try_to_freeze_tasks
函数原型:static int try_to_freeze_tasks(bool user_only)
返回类型:int
参数:
| 类型 | 参数 | 名称 | 
|---|---|---|
| bool | user_only | 
| 36 | bool wq_busy = false | 
| 39 | bool wakeup = false | 
| 46 | 如果非user_only则freeze_workqueues_begin() | 
| 49 | 当(true)循环 | 
| 50 | todo等于0 | 
| 51 | read_lock( & tasklist_lock) | 
| 56 | 如果非freezer_should_skip(p)则todo自加 | 
| 59 | read_unlock( & tasklist_lock) | 
| 61 | 如果非user_only则 | 
| 69 | 如果pm_wakeup_pending()则 | 
| 79 | usleep_range(sleep_usecs / 2, sleep_usecs) | 
| 80 | 如果sleep_usecs小于8乘USEC_PER_MSEC则sleep_usecs乘等于2 | 
| 88 | 如果todo则 | 
| 89 | 打印标准信息("\n") | 
| 90 | 打印错误信息("Freezing of tasks %s after %d.%03d seconds (%d tasks refusing to freeze, wq_busy=%d):\n", wakeup ? "aborted" : "failed", elapsed_msecs / 1000, elapsed_msecs % 1000, todo - wq_busy, wq_busy) | 
| 96 | 如果wq_busy则show_workqueue_state - dump workqueue state* Called from a sysrq handler or try_to_freeze_tasks() and prints out* all busy workqueues and pools. | 
| 99 | 如果非wakeup或pm_debug_messages_on则 | 
| 100 | read_lock( & tasklist_lock) | 
| 102 | 如果p不等于当前进程且非freezer_should_skip(p)且freezing(p)且非frozen(p)则sched_show_task(p) | 
| 106 | read_unlock( & tasklist_lock) | 
| 108 | 否则 | 
| 109 | 打印标准信息("(elapsed %d.%03d seconds) ", elapsed_msecs / 1000, elapsed_msecs % 1000) | 
| 名称 | 描述 | 
|---|---|
| freeze_processes | ze_processes - Signal user space processes to enter the refrigerator.* The current thread will not be frozen. The same process that calls* freeze_processes must later call thaw_processes.* On success, returns 0 | 
| freeze_kernel_threads | ze_kernel_threads - Make freezable kernel threads go to the refrigerator.* On success, returns 0. On failure, -errno and only the kernel threads are* thawed, so as to give a chance to the caller to do additional cleanups | 
| 源代码转换工具 开放的插件接口  | X | 
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码  |