Commit 574583c3 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

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: default avatarJakub Kicinski <kuba@kernel.org>
parents f07a6e6c dbd5e2e7
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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);