Ftrace: Only Print Output of Trace_Printk()

How to print full trace file of trace_printk in ftrace?

on Ubuntu 18.04 basis

  1. The buffer_size_kb file exists in the /sys/kernel/debug/tracing directory.

    You can make changes through echo.

    $ eche echo 4096 > buffer_size_kb

    The buffer_size_kb * cpu core count = buffer_total_size_kb is automatically calculated and stored.

    This will increase the amount in the ftrace file.

  2. Overwrite file exists in /sys/kernel/debug/tracing/options directory.

    Overwrite files can also be changed to echo.

    $ eche echo 4096 > buffer_size_kb

    The default value is 1, which throws away the oldest event (first part).
    Conversely, if zero, discard the most recent event (the back).

    In this case, the amount of ftrace files does not increase, and you can see the first or last.

(Linux Kernel) Adding new functions in available_filter_functions

Sorry, I was making some mistakes in configureing bcm2711_defconfig file. Thanks for everyone for trying to help me:)

Unable to understand ftrace output

the kernel program is similar to normal c: a main() program that call functions() and in functions call other sub-functions. For example:

void f1() {
f2();
f3();
}

void main() {
f1()
f4()
}

The calling relations of a program will be a tree structure. In this example, the calling relation is

main() -> f1() -> f2()
-> f3()
-> f4()

the ftrace tools shows the kerne's calling functions and every function's spending time. In your ftrace result, it show kernel call get_page_from_freelist() first and spending 13us. Then kernel return from function __alloc_pages_nodemask. This function spends 16us, and so on.



Related Topics



Leave a reply



Submit