aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/circuitlist.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-01-15 12:36:18 -0500
committerDavid Goulet <dgoulet@torproject.org>2020-07-08 09:10:29 -0400
commitd36a44ffa965e69a943068ab457a6528ef204b00 (patch)
tree3f38f8a342009351c4f9da05d64b40152b3a318f /src/core/or/circuitlist.c
parenta7063345770002082c2334f290f662c8d4ce644b (diff)
downloadtor-d36a44ffa965e69a943068ab457a6528ef204b00.tar.gz
tor-d36a44ffa965e69a943068ab457a6528ef204b00.zip
trace: Add four generic circuit tracepoints
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/core/or/circuitlist.c')
-rw-r--r--src/core/or/circuitlist.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/or/circuitlist.c b/src/core/or/circuitlist.c
index f4d6cd3c12..10fba498ad 100644
--- a/src/core/or/circuitlist.c
+++ b/src/core/or/circuitlist.c
@@ -65,6 +65,7 @@
#include "core/or/circuitpadding.h"
#include "core/or/crypt_path.h"
#include "core/or/extendinfo.h"
+#include "core/or/trace_probes_circuit.h"
#include "core/mainloop/connection.h"
#include "app/config/config.h"
#include "core/or/connection_edge.h"
@@ -99,6 +100,7 @@
#include "lib/compress/compress_zlib.h"
#include "lib/compress/compress_zstd.h"
#include "lib/buf/buffers.h"
+#include "lib/trace/events.h"
#include "core/or/ocirc_event.h"
@@ -565,6 +567,8 @@ circuit_set_state(circuit_t *circ, uint8_t state)
}
if (state == CIRCUIT_STATE_GUARD_WAIT || state == CIRCUIT_STATE_OPEN)
tor_assert(!circ->n_chan_create_cell);
+
+ tor_trace(circuit, change_state, circ, circ->state, state);
circ->state = state;
if (CIRCUIT_IS_ORIGIN(circ))
circuit_state_publish(circ);
@@ -1253,6 +1257,10 @@ circuit_free_(circuit_t *circ)
/* Clear all dangling handle references. */
circuit_handles_clear(circ);
+ /* Tracepoint. Data within the circuit object is recorded so do this before
+ * the actual memory free. */
+ tor_trace(circuit, free, circ);
+
if (should_free) {
memwipe(mem, 0xAA, memlen); /* poison memory */
tor_free(mem);
@@ -2275,6 +2283,7 @@ circuit_mark_for_close_, (circuit_t *circ, int reason, int line,
CIRCUIT_IS_ORIGIN(circ) ?
TO_ORIGIN_CIRCUIT(circ)->global_identifier : 0,
file, line, orig_reason, reason);
+ tor_trace(circuit, mark_for_close, circ);
}
/** Called immediately before freeing a marked circuit <b>circ</b> from