[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] trace: Add two circuit tracepoints for new circuits



commit c8f632784bfd9db91fb644fbf6729177b3518d63
Author: David Goulet <dgoulet@xxxxxxxxxxxxxx>
Date:   Wed Jan 15 12:50:20 2020 -0500

    trace: Add two circuit tracepoints for new circuits
    
    Signed-off-by: David Goulet <dgoulet@xxxxxxxxxxxxxx>
---
 src/core/or/circuitlist.c          |  2 ++
 src/core/or/trace_probes_circuit.c |  1 +
 src/core/or/trace_probes_circuit.h | 20 ++++++++++++++++++++
 3 files changed, 23 insertions(+)

diff --git a/src/core/or/circuitlist.c b/src/core/or/circuitlist.c
index 10fba498a..b3cc67e9d 100644
--- a/src/core/or/circuitlist.c
+++ b/src/core/or/circuitlist.c
@@ -1083,6 +1083,7 @@ origin_circuit_new(void)
               prediction_time_remaining);
   }
 
+  tor_trace(circuit, new_origin, circ);
   return circ;
 }
 
@@ -1105,6 +1106,7 @@ or_circuit_new(circid_t p_circ_id, channel_t *p_chan)
 
   init_circuit_base(TO_CIRCUIT(circ));
 
+  tor_trace(circuit, new_or, circ);
   return circ;
 }
 
diff --git a/src/core/or/trace_probes_circuit.c b/src/core/or/trace_probes_circuit.c
index 36af6fe79..b186ffda7 100644
--- a/src/core/or/trace_probes_circuit.c
+++ b/src/core/or/trace_probes_circuit.c
@@ -19,6 +19,7 @@
 #include "core/or/crypt_path_st.h"
 #include "core/or/extend_info_st.h"
 #include "core/or/or.h"
+#include "core/or/or_circuit_st.h"
 #include "core/or/origin_circuit_st.h"
 
 #define TRACEPOINT_DEFINE
diff --git a/src/core/or/trace_probes_circuit.h b/src/core/or/trace_probes_circuit.h
index 36bfb1563..d2d70686f 100644
--- a/src/core/or/trace_probes_circuit.h
+++ b/src/core/or/trace_probes_circuit.h
@@ -139,10 +139,22 @@ TRACEPOINT_EVENT_CLASS(tor_circuit, origin_circuit_t_class,
   )
 )
 
+TRACEPOINT_EVENT_CLASS(tor_circuit, or_circuit_t_class,
+  TP_ARGS(const or_circuit_t *, circ),
+  TP_FIELDS(
+    ctf_enum(tor_circuit, purpose, int, purpose, TO_CIRCUIT(circ)->purpose)
+    ctf_enum(tor_circuit, state, int, state, TO_CIRCUIT(circ)->state)
+  )
+)
+
 /*
  * Origin circuit events.
  */
 
+TRACEPOINT_EVENT_INSTANCE(tor_circuit, origin_circuit_t_class, new_origin,
+  TP_ARGS(const origin_circuit_t *, circ)
+)
+
 TRACEPOINT_EVENT_INSTANCE(tor_circuit, origin_circuit_t_class, opened,
   TP_ARGS(const origin_circuit_t *, circ)
 )
@@ -185,6 +197,14 @@ TRACEPOINT_EVENT(tor_circuit, intermediate_onion_skin,
   )
 )
 
+/*
+ * OR circuit events.
+ */
+
+TRACEPOINT_EVENT_INSTANCE(tor_circuit, or_circuit_t_class, new_or,
+  TP_ARGS(const or_circuit_t *, circ)
+)
+
 /*
  * General circuit events.
  */



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits