函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__trace_puts - write a constant string into the trace buffer.*@ip: The address of the caller*@str: The constant string to write*@size: The size of the string.

函数原型:int __trace_puts(unsigned long ip, const char *str, int size)

返回类型:int

参数:

类型参数名称
unsigned longip
const char *str
intsize
857  如果非trace_flags按位与TRACE_ITER_PRINTK的值则返回:0
860  pc等于抢占计数值
862  如果此条件成立可能性小(为编译器优化)(We need to change this state when a selftest is running.* A selftest will lurk into the ring-buffer to count the* entries inserted during the selftest although some concurrent* insertions into the ring-buffer such as trace_printk could occurred || Kill all tracing for good (never come back).* It is initialized to 1 but will turn to zero if the initialization* of the tracer is successful. But that is the only place that sets* this back to zero.)则返回:0
865  alloc等于entry的长度加size加2
867  local_save_flags(irq_flags)
868  buffer等于buffer
869  event等于__trace_buffer_lock_reserve(buffer, TRACE_PRINT, alloc, irq_flags, pc)
871  如果非event则返回:0
874  entry等于g_buffer_event_data - return the data of the event*@event: the event to get the data from
875  ip等于ip
877  内存复制( & buf, str, size)
880  如果buf[size - 1]不等于'\n'则
881  buf[size]等于'\n'
882  buf[size + 1]等于'\0'
883  否则buf[size]等于'\0'
886  __buffer_unlock_commit(buffer, event)
887  ftrace_trace_stack( & The global_trace is the descriptor that holds the top-level tracing* buffers for the live tracing., buffer, irq_flags, 4, pc, NULL)
889  返回:size