Hi, I saw this function invocation, trace_kfree_skb(skb, __builtin_return_address(0)); so I grepped the source for "trace_kfree_skb", but I found no where it's defined. Where's the definition for it? Best, Shiyao.
On Tue, 28 Mar 2017 16:15:57 +0800, Shiyao Ma said:
I saw this function invocation, trace_kfree_skb(skb, __builtin_return_address(0));
so I grepped the source for "trace_kfree_skb", but I found no where it's defined.
For some uses, the Linux kernel forms a definition via the preprocessor, by gluing together several strings. Try doing 'git grep trace_##' (or 'grep -r trace_## .' if you don't have a git tree.
Hello, On Tuesday 28 March 2017 01:45 PM, Shiyao Ma wrote:
Hi, I saw this function invocation, trace_kfree_skb(skb, __builtin_return_address(0));
so I grepped the source for "trace_kfree_skb", but I found no where it's defined.
Where's the definition for it?
It is a tracepoint call. Tracepoints are defined using DECLARE_TRACE or TRACE_EVENT macros [1]. 'git grep "TRACE.*kfree_skb"' gives the desired definition. [1]: https://www.kernel.org/doc/Documentation/trace/tracepoints.txt Regards, rawcoder
On Tue, Mar 28, 2017 at 04:15:57PM +0800, Shiyao Ma wrote:
Hi, I saw this function invocation, trace_kfree_skb(skb, __builtin_return_address(0));
so I grepped the source for "trace_kfree_skb", but I found no where it's defined.
Where's the definition for it?
that is a generated functions so you do not find them in the kernel sources directly - but you can find the generation points in the case of trace_kfree_skb thats in include/trace/events/skb.h:TRACE_EVENT(kfree_skb,... -> DECLARE_TRACE(...) and then exported in net/core/net-traces.c:EXPORT_TRACEPOINT_SYMBOL_GPL(kfree_skb); the detailed description of TRACE_EVENT can be found in include/linux/tracepoint.h thx! hofrat
participants (4)
-
Nicholas Mc Guire -
Rawcoder -
Shiyao Ma -
valdis.kletnieks@vt.edu