函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:kcov_ioctl_locked

函数原型:static int kcov_ioctl_locked(struct kcov *kcov, unsigned int cmd, unsigned long arg)

返回类型:int

参数:

类型参数名称
struct kcov *kcov
unsigned intcmd
unsigned longarg
555  :cmd恒等于KCOV_INIT_TRACE
556  kcov_debug("KCOV_INIT_TRACE\n")
561  如果mode不等于KCOV_MODE_DISABLED则返回:负EBUSY
568  size等于arg
569  如果size小于2或size大于INT_MAXsizeof(unsignedlong)则返回:负EINVAL
571  Size of arena (in long's). 等于size
572  mode等于KCOV_MODE_INIT
573  返回:0
574  :cmd恒等于KCOV_ENABLE
575  kcov_debug("KCOV_ENABLE\n")
583  如果mode不等于KCOV_MODE_INIT或非Coverage buffer shared with user space. 则返回:负EINVAL
585  t等于当前进程
586  如果(Task for which we collect coverage, or NULL. != NULL || kcov != NULL)则返回:负EBUSY
588  mode等于kcov_get_mode(arg)
589  如果mode小于0则返回:mode
591  Fault in a lazily-faulted vmalloc area before it can be used by* __santizer_cov_trace_pc(), to avoid recursion issues if any code on the* vmalloc fault handling path is instrumented.
592  mode等于mode
593  kcov_start(t, Size of arena (in long's). , Coverage buffer shared with user space. , mode, Sequence is incremented each time kcov is reenabled, used by* kcov_remote_stop(), see the comment there.)
595  kcov等于kcov
596  Task for which we collect coverage, or NULL. 等于t
598  kcov_get(kcov)
599  返回:0
600  :cmd恒等于KCOV_DISABLE
601  kcov_debug("KCOV_DISABLE\n")
603  unused等于arg
604  如果unused不等于0或kcov不等于kcov则返回:负EINVAL
606  t等于当前进程
607  如果WARN_ON(Task for which we collect coverage, or NULL. != t)则返回:负EINVAL
609  kcov_disable(t, kcov)
610  kcov_put(kcov)
611  返回:0
612  :cmd恒等于KCOV_REMOTE_ENABLE
613  kcov_debug("KCOV_REMOTE_ENABLE\n")
614  如果mode不等于KCOV_MODE_INIT或非Coverage buffer shared with user space. 则返回:负EINVAL
616  t等于当前进程
617  如果(Task for which we collect coverage, or NULL. != NULL || kcov != NULL)则返回:负EBUSY
619  remote_arg等于arg
620  mode等于kcov_get_mode(KCOV_TRACE_PC or KCOV_TRACE_CMP )
621  如果mode小于0则返回:mode
623  如果Length of coverage buffer in words 大于LONG_MAXsizeof(unsignedlong)则返回:负EINVAL
625  mode等于mode
626  kcov等于kcov
627  Task for which we collect coverage, or NULL. 等于t
628  Collecting coverage from remote (background) threads. = true
629  Size of remote area (in long's). 等于Length of coverage buffer in words
630  加自旋锁
632  kcov_debug("handle %llx\n", handles[i])
636  kcov_disable(t, kcov)
637  返回:负EINVAL
640  如果是错误
642  kcov_disable(t, kcov)
643  返回:错误
646  如果common_handle
647  kcov_debug("common handle %llx\n", common_handle)
652  kcov_disable(t, kcov)
653  返回:负EINVAL
657  如果是错误
659  kcov_disable(t, kcov)
660  返回:错误
664  自旋锁解锁
666  kcov_get(kcov)
667  返回:0
668  默认
669  返回:负ENOTTY
调用者
名称描述
kcov_ioctl