]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
trace: Add congestion control BDP update tracepoints
authorDavid Goulet <dgoulet@torproject.org>
Tue, 28 Sep 2021 22:37:25 +0000 (22:37 +0000)
committerDavid Goulet <dgoulet@torproject.org>
Mon, 4 Oct 2021 14:45:46 +0000 (10:45 -0400)
Signed-off-by: David Goulet <dgoulet@torproject.org>
src/core/or/congestion_control_common.c

index fa603e8df8cf92b55ef6d7a124246f1fd40f83d5..51691c106da9c74d8350c471a551d63ffe8899e3 100644 (file)
@@ -22,6 +22,7 @@
 #include "core/or/congestion_control_nola.h"
 #include "core/or/congestion_control_westwood.h"
 #include "core/or/congestion_control_st.h"
+#include "core/or/trace_probes_cc.h"
 #include "lib/time/compat_time.h"
 #include "feature/nodelist/networkstatus.h"
 
@@ -915,7 +916,12 @@ congestion_control_update_circuit_bdp(congestion_control_t *cc,
 
   /* We updated BDP this round if either we had a blocked channel, or
    * the curr_rtt_usec was not 0. */
-  return (blocked_on_chan || curr_rtt_usec != 0);
+  bool ret = (blocked_on_chan || curr_rtt_usec != 0);
+  if (ret) {
+    tor_trace(TR_SUBSYS(cc), TR_EV(bdp_update), circ, cc, curr_rtt_usec,
+              sendme_rate_bdp);
+  }
+  return ret;
 }
 
 /**