函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:kcov_move_area

函数原型:static void kcov_move_area(enum kcov_mode mode, void *dst_area, unsigned int dst_area_size, void *src_area)

返回类型:void

参数:

类型参数名称
enum kcov_modemode
void *dst_area
unsigned intdst_area_size
void *src_area
823  word_size等于sizeof(unsignedlong)
829  kcov_debug("%px %u <= %px %lu\n", dst_area, dst_area_size, src_area, * (unsignedlong * )src_area)
833  :mode恒等于KCOV_MODE_TRACE_PC
834  dst_len等于READ_ONCE( * (unsignedlong * )dst_area)
835  src_len等于src_area
836  count_size等于sizeof(unsignedlong)
837  entry_size_log等于__ilog2_u64(sizeof(unsignedlong))
838  退出
839  :mode恒等于KCOV_MODE_TRACE_CMP
840  dst_len等于READ_ONCE( * (u64 * )dst_area)
841  src_len等于src_area
842  count_size等于sizeof(u64)
843  BUILD_BUG_ON - break compile if a condition is true(!s_power_of_2() - check if a value is a power of two*@n: the value to check* Determine whether some value is a power of two, where zero is* *not* considered a power of two.* Return: true if @n is a power of 2, otherwise false.)
844  entry_size_log等于__ilog2_u64(sizeof(u64) * Number of 64-bit words written per one comparison: )
845  退出
846  默认
847  WARN_ON(1)
848  返回
852  如果dst_len大于dst_area_sizeword_sizecount_size右移entry_size_log位则返回
855  dst_occupied等于count_sizedst_len左移entry_size_log位的值
856  dst_free等于dst_area_sizeword_sizedst_occupied
857  bytes_to_move等于两数取小(dst_free, src_len << entry_size_log)
858  dst_entries等于dst_areadst_occupied
859  src_entries等于src_areacount_size
860  内存复制(dst_entries, src_entries, bytes_to_move)
861  entries_moved等于bytes_to_move右移entry_size_log
864  :mode恒等于KCOV_MODE_TRACE_PC
865  WRITE_ONCE( * (unsignedlong * )dst_area, dst_len + entries_moved)
866  退出
867  :mode恒等于KCOV_MODE_TRACE_CMP
868  WRITE_ONCE( * (u64 * )dst_area, dst_len + entries_moved)
869  退出
870  默认
871  退出
调用者
名称描述
kcov_remote_stopSee the comment before kcov_remote_start() for usage details.