lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250211120500.0b1e571c@gandalf.local.home>
Date: Tue, 11 Feb 2025 12:05:00 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Eric Dumazet <edumazet@...gle.com>
Cc: Breno Leitao <leitao@...ian.org>, Masami Hiramatsu
 <mhiramat@...nel.org>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
 "David S. Miller" <davem@...emloft.net>, David Ahern <dsahern@...nel.org>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Simon
 Horman <horms@...nel.org>, Neal Cardwell <ncardwell@...gle.com>,
 netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-trace-kernel@...r.kernel.org, kernel-team@...a.com
Subject: Re: [PATCH net-next] trace: tcp: Add tracepoint for
 tcp_cwnd_reduction()

On Tue, 11 Feb 2025 16:19:54 +0100
Eric Dumazet <edumazet@...gle.com> wrote:

> I can give my +2 on this patch, although I have no way of testing it.

If you want to test this, apply the below patch, enable
CONFIG_SAMPLE_TRACE_CUSTOM_EVENTS, and after you boot up, do the following:

 # modprobe trace_custom_sched
 # cd /sys/kernel/tracing
 # echo 1 > events/custom/tcp_cwnd_reduction_tp/enable

[ do something to trigger it ]

 # cat trace

-- Steve

diff --git a/samples/trace_events/trace_custom_sched.c b/samples/trace_events/trace_custom_sched.c
index dd409b704b35..35b3cfa6e91d 100644
--- a/samples/trace_events/trace_custom_sched.c
+++ b/samples/trace_events/trace_custom_sched.c
@@ -16,6 +16,7 @@
  * from the C file, and not in the custom header file.
  */
 #include <trace/events/sched.h>
+#include <trace/events/tcp.h>
 
 /* Declare CREATE_CUSTOM_TRACE_EVENTS before including custom header */
 #define CREATE_CUSTOM_TRACE_EVENTS
@@ -37,6 +38,7 @@
  */
 static void fct(struct tracepoint *tp, void *priv)
 {
+	trace_custom_event_tcp_cwnd_reduction_tp_update(tp);
 	trace_custom_event_sched_switch_update(tp);
 	trace_custom_event_sched_waking_update(tp);
 }
diff --git a/samples/trace_events/trace_custom_sched.h b/samples/trace_events/trace_custom_sched.h
index 951388334a3f..339957d692c0 100644
--- a/samples/trace_events/trace_custom_sched.h
+++ b/samples/trace_events/trace_custom_sched.h
@@ -74,6 +74,33 @@ TRACE_CUSTOM_EVENT(sched_waking,
 
 	TP_printk("pid=%d prio=%d", __entry->pid, __entry->prio)
 )
+
+struct sock;
+
+TRACE_CUSTOM_EVENT(tcp_cwnd_reduction_tp,
+
+	TP_PROTO(const struct sock *sk, int newly_acked_sacked,
+                int newly_lost, int flag),
+
+	TP_ARGS(sk, newly_acked_sacked, newly_lost, flag),
+
+	TP_STRUCT__entry(
+		__field(	unsigned long,		sk	)
+		__field(	int,			ack	)
+		__field(	int,			lost	)
+		__field(	int,			flag	)
+	),
+
+	TP_fast_assign(
+		__entry->sk	= (unsigned long)sk;
+		__entry->ack	= newly_acked_sacked;
+		__entry->lost	= newly_lost;
+		__entry->flag	= flag;
+	),
+
+	TP_printk("sk=%lx ack=%d lost=%d flag=%d", __entry->sk,
+		__entry->ack, __entry->lost, __entry->flag)
+)
 #endif
 /*
  * Just like the headers that create TRACE_EVENTs, the below must

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ