Debugging Linux Kernel using ftrace Part8 - Trace all functions related to a specific module
In our previous post, we discussed how to trace only specific kernel functions by echoing them into "set_ftrace_filter" file.
To list what all functions the ftrace can trace, you can read "available_filter_functions" file.
$ wc -l available_filter_functions
38750 available_filter_functions
You can see from the above output there are more than 38000 functions which the ftrace is tracing if we don't add filters.
The tracing files support wild cards, the following expressions are valid:
To list what all functions the ftrace can trace, you can read "available_filter_functions" file.
$ wc -l available_filter_functions
38750 available_filter_functions
You can see from the above output there are more than 38000 functions which the ftrace is tracing if we don't add filters.
The tracing files support wild cards, the following expressions are valid:
- value* - Will select all functions that start with string "value"
- *value - Will select all functions that end with string "value"
- *value* - Will select all functions that start and end with string "value"
As the star (*) is used by bash, you have to wrap the string in quotes when using wild cards.
To trace all functions of a specific module, for example e1000 (Ethernet driver) you can pass the following to set_ftrace_filter.
echo ':mod:e1000' > set_ftrace_filter
$ cat set_ftrace_filter | head -n 10
e1000_alloc_dummy_rx_buffers [e1000]
e1000_fix_features [e1000]
e1000_setup_rctl [e1000]
e1000_configure_rx [e1000]
e1000_update_itr [e1000]
e1000_maybe_stop_tx [e1000]
e1000_alloc_frag [e1000]
e1000_intr [e1000]
e1000_request_irq [e1000]
e1000_down_and_stop [e1000]
Comments
Post a Comment