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

[tor-commits] [tor/master] trace: Add two origin circuit specific tracepoints



commit 4cb6887471caa7687b5fd26a357e60e6cafbd326
Author: David Goulet <dgoulet@xxxxxxxxxxxxxx>
Date:   Wed Jan 15 12:42:58 2020 -0500

    trace: Add two origin circuit specific tracepoints
    
    Signed-off-by: David Goulet <dgoulet@xxxxxxxxxxxxxx>
---
 src/core/or/circuitbuild.c         |  2 ++
 src/core/or/trace_probes_circuit.c |  2 ++
 src/core/or/trace_probes_circuit.h | 22 ++++++++++++++++++++++
 3 files changed, 26 insertions(+)

diff --git a/src/core/or/circuitbuild.c b/src/core/or/circuitbuild.c
index edbce8a2d..034a0dc77 100644
--- a/src/core/or/circuitbuild.c
+++ b/src/core/or/circuitbuild.c
@@ -983,6 +983,7 @@ circuit_send_first_onion_skin(origin_circuit_t *circ)
 
   if (circuit_deliver_create_cell(TO_CIRCUIT(circ), &cc, 0) < 0)
     return - END_CIRC_REASON_RESOURCELIMIT;
+  tor_trace(circuit, first_onion_skin, circ, circ->cpath);
 
   circ->cpath->state = CPATH_STATE_AWAITING_KEYS;
   circuit_set_state(TO_CIRCUIT(circ), CIRCUIT_STATE_BUILDING);
@@ -1146,6 +1147,7 @@ circuit_send_intermediate_onion_skin(origin_circuit_t *circ,
       return 0; /* circuit is closed */
   }
   hop->state = CPATH_STATE_AWAITING_KEYS;
+  tor_trace(circuit, intermediate_onion_skin, circ, hop);
   return 0;
 }
 
diff --git a/src/core/or/trace_probes_circuit.c b/src/core/or/trace_probes_circuit.c
index f2594f522..36af6fe79 100644
--- a/src/core/or/trace_probes_circuit.c
+++ b/src/core/or/trace_probes_circuit.c
@@ -16,6 +16,8 @@
 
 /* Header files that the probes need. */
 #include "core/or/circuitlist.h"
+#include "core/or/crypt_path_st.h"
+#include "core/or/extend_info_st.h"
 #include "core/or/or.h"
 #include "core/or/origin_circuit_st.h"
 
diff --git a/src/core/or/trace_probes_circuit.h b/src/core/or/trace_probes_circuit.h
index e306a7886..36bfb1563 100644
--- a/src/core/or/trace_probes_circuit.h
+++ b/src/core/or/trace_probes_circuit.h
@@ -163,6 +163,28 @@ TRACEPOINT_EVENT_INSTANCE(tor_circuit, origin_circuit_t_class, idle_timeout,
   TP_ARGS(const origin_circuit_t *, circ)
 )
 
+TRACEPOINT_EVENT(tor_circuit, first_onion_skin,
+  TP_ARGS(const origin_circuit_t *, circ, const crypt_path_t *, hop),
+  TP_FIELDS(
+    ctf_integer(uint32_t, circ_id, circ->global_identifier)
+    ctf_enum(tor_circuit, purpose, int, purpose, TO_CIRCUIT(circ)->purpose)
+    ctf_enum(tor_circuit, state, int, state, TO_CIRCUIT(circ)->state)
+    ctf_array_hex(char, fingerprint, hop->extend_info->identity_digest,
+                  DIGEST_LEN)
+  )
+)
+
+TRACEPOINT_EVENT(tor_circuit, intermediate_onion_skin,
+  TP_ARGS(const origin_circuit_t *, circ, const crypt_path_t *, hop),
+  TP_FIELDS(
+    ctf_integer(uint32_t, circ_id, circ->global_identifier)
+    ctf_enum(tor_circuit, purpose, int, purpose, TO_CIRCUIT(circ)->purpose)
+    ctf_enum(tor_circuit, state, int, state, TO_CIRCUIT(circ)->state)
+    ctf_array_hex(char, fingerprint, hop->extend_info->identity_digest,
+                  DIGEST_LEN)
+  )
+)
+
 /*
  * General circuit events.
  */



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