Merge branch 'add-noinline_for_tracing-and-apply-it-to-tcp_drop_reason'

Yafang Shao says:

====================
Add noinline_for_tracing and apply it to tcp_drop_reason

This patchset introduces a new compiler annotation, noinline_for_tracing,
designed to prevent specific functions from being inlined to facilitate
tracing. In Patch #2, this annotation is applied to the tcp_drop_reason().
====================

Link: https://patch.msgid.link/20241024093742.87681-1-laoar.shao@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski 2024-11-03 09:02:34 -08:00
commit 574583c30c
2 changed files with 8 additions and 2 deletions

View File

@ -265,6 +265,12 @@ struct ftrace_likely_data {
*/
#define noinline_for_stack noinline
/*
* Use noinline_for_tracing for functions that should not be inlined.
* For tracing reasons.
*/
#define noinline_for_tracing noinline
/*
* Sanitizer helper attributes: Because using __always_inline and
* __no_sanitize_* conflict, provide helper attributes that will either expand

View File

@ -4921,8 +4921,8 @@ static bool tcp_ooo_try_coalesce(struct sock *sk,
return res;
}
static void tcp_drop_reason(struct sock *sk, struct sk_buff *skb,
enum skb_drop_reason reason)
noinline_for_tracing static void
tcp_drop_reason(struct sock *sk, struct sk_buff *skb, enum skb_drop_reason reason)
{
sk_drops_add(sk, skb);
sk_skb_reason_drop(sk, skb, reason);