函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\vsprintf.c Create Date:2022-07-27 07:09:44
Last Modify:2022-05-21 09:47:42 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:vsnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@args: Arguments for the format string* This function generally

函数原型:int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)

返回类型:int

参数:

类型参数名称
char *buf
size_tsize
const char *fmt
va_listargs
2508  struct printf_spec spec = {0}
2512  如果WARN_ON_ONCE(size > INT_MAX)则返回:0
2515  str等于buf
2516  end等于bufsize
2519  如果end小于buf
2520  end = ((void * ) - 1)
2521  size等于endbuf
2524 fmt循环
2525  old_fmt等于fmt
2526  read等于Helper function to decode printf style format
2528  fmt加等于read
2532  copy等于read
2533  如果str小于end
2534  如果copy大于endstrcopy等于endstr
2538  str加等于read
2539  退出
2542  : format_type enum 恒等于FORMAT_TYPE_WIDTH
2543  set_field_width( & spec, va_arg(args, int))
2544  退出
2546  : format_type enum 恒等于FORMAT_TYPE_PRECISION
2547  set_precision( & spec, va_arg(args, int))
2548  退出
2550  : format_type enum 恒等于FORMAT_TYPE_CHAR
2553  如果非 flags to number() 按位与left justified 的值则
2554  width of output field 先自减大于0循环
2555  如果str小于endstr等于' '
2557  str先自加
2561  c等于va_arg(args, int)
2562  如果str小于endstr等于c
2564  str先自加
2565  width of output field 先自减大于0循环
2566  如果str小于endstr等于' '
2568  str先自加
2570  退出
2573  : format_type enum 恒等于FORMAT_TYPE_STR
2574  str等于string(str, end, va_arg(args, char * ), spec)
2575  退出
2577  : format_type enum 恒等于FORMAT_TYPE_PTR
2578  str等于Show a '%p' thing. A kernel extension is that the '%p' is followed* by an extra set of alphanumeric characters that are extended format* specifiers.* Please update scripts/checkpatch.pl when adding/removing conversion* characters
2580 isalnum( * fmt)循环
2581  fmt自加
2582  退出
2584  : format_type enum 恒等于FORMAT_TYPE_PERCENT_CHAR
2585  如果str小于endstr等于'%'
2587  str先自加
2588  退出
2590  : format_type enum 恒等于FORMAT_TYPE_INVALID
2599  转到:out
2601  默认
2604  num等于va_arg(args, longlong)
2605  退出
2607  num等于va_arg(args, unsignedlong)
2608  退出
2610  num等于va_arg(args, long)
2611  退出
2615  否则num等于va_arg(args, size_t)
2617  退出
2619  num等于va_arg(args, ptrdiff_t)
2620  退出
2622  num等于va_arg(args, int)
2623  退出
2625  num等于va_arg(args, int)
2626  退出
2628  num等于va_arg(args, int)
2629  退出
2631  num等于va_arg(args, int)
2632  退出
2634  num等于va_arg(args, int)
2635  退出
2636  默认
2637  num等于va_arg(args, unsignedint)
2640  str等于number(str, end, num, spec)
2644  out :
2645  如果size大于0则
2646  如果str小于endstr等于'\0'
2648  否则end[ - 1]等于'\0'
2653  返回:strbuf
调用者
名称描述
va_format
vscnprintf格式化输出字符串
snprintfsnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
vsprintfvsprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@fmt: The format string to use*@args: Arguments for the format string* The function returns the number of characters written* into @buf
sprintf输出格式化串
add_uevent_var 向环境缓冲区添加键值字符串
seq_buf_vprintfseq_buf_vprintf - sequence printing of information.*@s: seq_buf descriptor*@fmt: printf format string*@args: va_list of arguments from a printf() type function* Writes a vnprintf() format into the sequencce buffer.* Returns zero on success, -1 on overflow.
dump_stack_set_arch_descdump_stack_set_arch_desc - set arch-specific str to show with task dumps*@fmt: printf-style format string*@...: arguments for the format string* The configured string will be printed right after utsname during task* dumps
kvasprintfSimplified asprintf.
do_test
string_stream_vadd
set_worker_descset_worker_desc - set description for the current work item*@fmt: printf-style format string*@...: arguments for the format string* This function can be called by a running work function to describe what* the work item is about
__kthread_create_on_node
__request_module__request_module - try to load a kernel module*@wait: wait (or not) for the operation to complete*@fmt: printf style format string for the name of the module*@...: arguments as specified in the format string
audit_log_vformatFormat an audit message into the audit buffer. If there isn't enough* room in the audit buffer, more room will be allocated and vsnprint* will be called a second time. Currently, we assume that a printk
vkdb_printf
tomoyo_write_logmoyo_write_log - Write an audit log.*@r: Pointer to "struct tomoyo_request_info".*@fmt: The printf()'s format string, followed by parameters.* Returns nothing.
tomoyo_addprintfmoyo_addprintf - strncat()-like-snprintf().*@buffer: Buffer to write to. Must be '\0'-terminated.*@len: Size of @buffer.*@fmt: The printf()'s format string, followed by parameters.* Returns nothing.
tomoyo_io_printfmoyo_io_printf - printf() to "struct tomoyo_io_buffer" structure.*@head: Pointer to "struct tomoyo_io_buffer".*@fmt: The printf()'s format string, followed by parameters.
tomoyo_supervisormoyo_supervisor - Ask for the supervisor's decision
dynamic_dnameHelper function for dentry_operations.d_dname() members
cn_vprintf
alloc_workqueue
tomoyo_init_logmoyo_init_log - Allocate buffer for audit logs
seq_vprintf