trace: Add two origin circuit specific tracepoints

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

View File

@ -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;
}

View File

@ -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"

View File

@ -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.
*/