Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__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.

Proto:int __trace_puts(unsigned long ip, const char *str, int size)

Type:int

Parameter:

TypeParameterName
unsigned longip
const char *str
intsize
857  If Not (trace_flags & TRACE_ITER_PRINTK) Then Return 0
860  pc = We mask the PREEMPT_NEED_RESCHED bit so as not to confuse all current users* that think a non-zero value indicates we cannot preempt.
862  If Value for the false possibility is greater at compile time(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.) Then Return 0
865  alloc = size of 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  If Not event Then Return 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  No 3D Now!( & buf, str, size)
880  If buf[size - 1] != '\n' Then
881  buf[size] = '\n'
882  buf[size + 1] = '\0'
883  Else 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  Return size