Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\kcov.c Create Date:2022-07-28 11:34:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:kcov_move_area

Proto:static void kcov_move_area(enum kcov_mode mode, void *dst_area, unsigned int dst_area_size, void *src_area)

Type:void

Parameter:

TypeParameterName
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  Case 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  Break
839  Case 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  Break
846  Default
847  WARN_ON(1)
848  Return
852  If dst_len > dst_area_size * word_size - count_size >> entry_size_log Then Return
855  dst_occupied = count_size + (dst_len << entry_size_log)
856  dst_free = dst_area_size * word_size - dst_occupied
857  bytes_to_move = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(dst_free, src_len << entry_size_log)
858  dst_entries = dst_area + dst_occupied
859  src_entries = src_area + count_size
860  No 3D Now!(dst_entries, src_entries, bytes_to_move)
861  entries_moved = bytes_to_move >> entry_size_log
864  Case mode == KCOV_MODE_TRACE_PC
865  WRITE_ONCE( * (unsignedlong * )dst_area, dst_len + entries_moved)
866  Break
867  Case mode == KCOV_MODE_TRACE_CMP
868  WRITE_ONCE( * (u64 * )dst_area, dst_len + entries_moved)
869  Break
870  Default
871  Break
Caller
NameDescribe
kcov_remote_stopSee the comment before kcov_remote_start() for usage details.