函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:hex_dump_to_buffer - convert a blob of data to "hex ASCII" in memory*@buf: data blob to dump*@len: number of bytes in the @buf*@rowsize: number of bytes to print per line; must be 16 or 32*@groupsize: number of bytes to print at a time (1, 2, 4, 8;

函数原型:int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize, char *linebuf, size_t linebuflen, bool ascii)

返回类型:int

参数:

类型参数名称
const void *buf
size_tlen
introwsize
intgroupsize
char *linebuf
size_tlinebuflen
boolascii
108  ptr等于buf
111  lx等于0
115  如果rowsize不等于16且rowsize不等于32则rowsize等于16
118  如果len大于rowsizelen等于rowsize
120  如果非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.groupsize大于8则groupsize等于1
122  如果len取模groupsize不等于0则groupsize等于1
125  ngroups等于lengroupsize
126  ascii_column等于rowsize乘2加rowsizegroupsize加1
128  如果非linebuflen则转到:overflow1
131  如果非len则转到:nil
134  如果groupsize恒等于8则
135  ptr8等于buf
137 j小于ngroups循环
141  如果ret大于等于linebuflenlx则转到:overflow1
143  lx加等于ret
145  否则如果groupsize恒等于4则
146  ptr4等于buf
148 j小于ngroups循环
152  如果ret大于等于linebuflenlx则转到:overflow1
154  lx加等于ret
156  否则如果groupsize恒等于2则
157  ptr2等于buf
159 j小于ngroups循环
163  如果ret大于等于linebuflenlx则转到:overflow1
165  lx加等于ret
167  否则
168 j小于len循环
169  如果linebuflen小于lx加2则转到:overflow2
171  ch等于ptr[j]
172  linebuf[lx++]等于hex_asc_hi(ch)
173  如果linebuflen小于lx加2则转到:overflow2
175  linebuf[lx++]等于hex_asc_lo(ch)
176  如果linebuflen小于lx加2则转到:overflow2
178  linebuf[lx++]等于' '
180  如果jlx自减
183  如果非ascii则转到:nil
186 lx小于ascii_column循环
187  如果linebuflen小于lx加2则转到:overflow2
189  linebuf[lx++]等于' '
191 j小于len循环
192  如果linebuflen小于lx加2则转到:overflow2
194  ch等于ptr[j]
195  linebuf[lx++]等于如果isascii(ch)且isprint(ch)则ch否则'.'
197  nil :
198  linebuf[lx]等于'\0'
199  返回:lx
200  overflow2 :
201  linebuf[lx++]等于'\0'
202  overflow1 :
203  返回:如果asciiascii_columnlen否则groupsize乘2加1的和乘ngroups减1
调用者
名称描述
print_hex_dumpprint_hex_dump - print a text hex dump to syslog for a binary blob of data*@level: kernel log level (e
test_hexdump
test_hexdump_overflow
seq_buf_hex_dumpseq_buf_hex_dump - print formatted hex dump into the sequence buffer*@s: seq_buf descriptor*@prefix_str: string to prefix each line with;* caller supplies trailing spaces for alignment if desired*@prefix_type: controls whether prefix of an offset,
seq_hex_dumpA complete analogue of print_hex_dump()