ftrace study

0.0.1. test case

We found ixgbe rx softirq poll function ixgbe_poll was called even without pkt coming.
how to prove it and who call it?

0.0.2. analysis

By browse source ixgbe_poll is called, it should be done by napi schedule.
If this is true, __napi_schedule should be called.

0.0.3. use ftrace to locate:

0.0.3.0.1. prepare debugfs
1
2
mount -t debugfs none /sys/kernel/debug/
cd /sys/kernel/debug/tracing

0.0.3.1. step1: who call __napi_schedule

1
2
3
4
5
echo function > current_tracer
echo 1 > options/func_stack_trace
echo __napi_schedule > set_ftrace_filter
cat set_ftrace_filter
cat trace > ~/a

0.0.3.2. step2: who call ixgbe_msix_clean_rings

1
2
3
4
5
echo function > current_tracer
echo 1 > options/func_stack_trace
echo ixgbe_msix_clean_rings > set_ftrace_filter
cat set_ftrace_filter
cat trace > ~/a

0.0.3.3. ftrace document

Debugging the kernel using Ftrace
part 1
http://lwn.net/Articles/365835/

part 2
http://lwn.net/Articles/366796/

Secrets of the Ftrace function tracer
http://lwn.net/Articles/370423/

Debugging Linux Kernel by Ftrace by AceLan Kao
http://people.canonical.com/~acelan/coscup-2010/Debugging%20Linux%20Kernel%20by%20Ftrace.pdf


ftrace study
https://martinbj2008.github.io/2014/10/21/2014-10-21-ftrace-study/
Author
Martinbj2008
Posted on
October 21, 2014
Licensed under