函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:kunit_try_catch_run

函数原型:void kunit_try_catch_run(struct kunit_try_catch *try_catch, void *context)

返回类型:void

参数:

类型参数名称
struct kunit_try_catch *try_catch
void *context
58  Lockdep needs to run a non-constant initializer for on-stack* completions - so we use the _ONSTACK() variant for those that* are on the kernel stack:(try_completion)
59  test等于private: internal use only.
63  context等于context
64  try_completion等于try_completion
65  try_result等于0
66  task_struct等于kthread_run - create and wake a thread.*@threadfn: the function to run until signal_pending(current).*@data: data ptr for @threadfn.*@namefmt: printf-style name for the thread.* Description: Convenient wrapper for kthread_create() followed by(kunit_generic_run_threadfn_adapter, try_catch, "kunit_try_catch_thread")
69  如果是错误
70  catch(context)
71  返回
74  time_remaining等于wait_for_completion_timeout( & try_completion, kunit_test_timeout())
76  如果time_remaining恒等于0则
77  kunit_err() - Prints an ERROR level message associated with @test.*@test: The test context object.*@fmt: A printk() style format string.* Prints an error level message.(test, "try timed out\n")
78  try_result等于负ETIMEDOUT
81  exit_code等于try_result
83  如果非exit_code则返回
86  如果exit_code恒等于负EFAULTtry_result等于0
88  否则如果exit_code恒等于负EINTRkunit_err() - Prints an ERROR level message associated with @test.*@test: The test context object.*@fmt: A printk() style format string.* Prints an error level message.(test, "wake_up_process() was never called\n")
90  否则如果exit_codekunit_err() - Prints an ERROR level message associated with @test.*@test: The test context object.*@fmt: A printk() style format string.* Prints an error level message.(test, "Unknown error: %d\n", exit_code)
93  catch(context)
调用者
名称描述
kunit_test_try_catch_successful_try_no_catch
kunit_test_try_catch_unsuccessful_try_does_catch
kunit_run_case_catch_errorsPerforms all logic to run a test case. It also catches most errors that* occur in a test case and reports them as failures.