* where's the definition of trace_kfree_skb?
@ 2017-03-28 8:15 Shiyao Ma
2017-03-28 8:46 ` valdis.kletnieks at vt.edu
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Shiyao Ma @ 2017-03-28 8:15 UTC (permalink / raw)
To: kernelnewbies
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170328/f268c085/attachment.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* where's the definition of trace_kfree_skb?
2017-03-28 8:15 where's the definition of trace_kfree_skb? Shiyao Ma
@ 2017-03-28 8:46 ` valdis.kletnieks at vt.edu
2017-03-28 13:31 ` Rawcoder
2017-03-28 13:57 ` Nicholas Mc Guire
2 siblings, 0 replies; 5+ messages in thread
From: valdis.kletnieks at vt.edu @ 2017-03-28 8:46 UTC (permalink / raw)
To: kernelnewbies
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 484 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170328/4d5b1c24/attachment.bin
^ permalink raw reply [flat|nested] 5+ messages in thread
* where's the definition of trace_kfree_skb?
2017-03-28 8:15 where's the definition of trace_kfree_skb? Shiyao Ma
2017-03-28 8:46 ` valdis.kletnieks at vt.edu
@ 2017-03-28 13:31 ` Rawcoder
2017-03-28 13:57 ` Nicholas Mc Guire
2 siblings, 0 replies; 5+ messages in thread
From: Rawcoder @ 2017-03-28 13:31 UTC (permalink / raw)
To: kernelnewbies
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* where's the definition of trace_kfree_skb?
2017-03-28 8:15 where's the definition of trace_kfree_skb? Shiyao Ma
2017-03-28 8:46 ` valdis.kletnieks at vt.edu
2017-03-28 13:31 ` Rawcoder
@ 2017-03-28 13:57 ` Nicholas Mc Guire
2017-03-28 14:30 ` Shiyao Ma
2 siblings, 1 reply; 5+ messages in thread
From: Nicholas Mc Guire @ 2017-03-28 13:57 UTC (permalink / raw)
To: kernelnewbies
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* where's the definition of trace_kfree_skb?
2017-03-28 13:57 ` Nicholas Mc Guire
@ 2017-03-28 14:30 ` Shiyao Ma
0 siblings, 0 replies; 5+ messages in thread
From: Shiyao Ma @ 2017-03-28 14:30 UTC (permalink / raw)
To: kernelnewbies
Thanks you guys!
Best,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170328/dcd34ec8/attachment-0001.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-03-28 14:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-28 8:15 where's the definition of trace_kfree_skb? Shiyao Ma
2017-03-28 8:46 ` valdis.kletnieks at vt.edu
2017-03-28 13:31 ` Rawcoder
2017-03-28 13:57 ` Nicholas Mc Guire
2017-03-28 14:30 ` Shiyao Ma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).