trace_printk man page on OpenSuSE

Man page or keyword search:  
man Server   25941 pages
apropos Keyword Search (all sections)
Output format
OpenSuSE logo
[printable version]

TRACE_PRINTK(9)			 Driver Basics		       TRACE_PRINTK(9)

NAME
       trace_printk - printf formatting in the ftrace buffer

SYNOPSIS
       trace_printk(fmt, ...);

ARGUMENTS
       fmt
	   the printf format for printing

       ...
	   variable arguments

NOTE
       __trace_printk is an internal function for trace_printk and the ip is
       passed in via the trace_printk macro.

       This function allows a kernel developer to debug fast path sections
       that printk is not appropriate for. By scattering in various printk
       like tracing in the code, a developer can quickly see where problems
       are occurring.

       This is intended as a debugging tool for the developer only. Please
       refrain from leaving trace_printks scattered around in your code.
       (Extra memory is used for special buffers that are allocated when
       trace_printk is used)

       A little optization trick is done here. If there's only one argument,
       there's no need to scan the string for printf formats. The trace_puts
       will suffice. But how can we take advantage of using trace_puts when
       trace_printk has only one argument? By stringifying the args and
       checking the size we can tell whether or not there are args.
       __stringify((__VA_ARGS__)) will turn into “()\0” with a size of 3 when
       there are no args, anything else will be bigger. All we need to do is
       define a string to this, and then take its size and compare to 3. If
       it's bigger, use do_trace_printk otherwise, optimize it to trace_puts.
       Then just let gcc optimize the rest.

COPYRIGHT
Kernel Hackers Manual 3.11	 November 2013		       TRACE_PRINTK(9)
[top]

List of man pages available for OpenSuSE

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net