trace: Add two circuit tracepoints for new circuits

Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
David Goulet 2020-01-15 12:50:20 -05:00
parent 4cb6887471
commit c8f632784b
3 changed files with 23 additions and 0 deletions

View File

@ -1083,6 +1083,7 @@ origin_circuit_new(void)
prediction_time_remaining); prediction_time_remaining);
} }
tor_trace(circuit, new_origin, circ);
return 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)); init_circuit_base(TO_CIRCUIT(circ));
tor_trace(circuit, new_or, circ);
return circ; return circ;
} }

View File

@ -19,6 +19,7 @@
#include "core/or/crypt_path_st.h" #include "core/or/crypt_path_st.h"
#include "core/or/extend_info_st.h" #include "core/or/extend_info_st.h"
#include "core/or/or.h" #include "core/or/or.h"
#include "core/or/or_circuit_st.h"
#include "core/or/origin_circuit_st.h" #include "core/or/origin_circuit_st.h"
#define TRACEPOINT_DEFINE #define TRACEPOINT_DEFINE

View File

@ -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. * 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, TRACEPOINT_EVENT_INSTANCE(tor_circuit, origin_circuit_t_class, opened,
TP_ARGS(const origin_circuit_t *, circ) 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. * General circuit events.
*/ */