Skip to content

Commit 2704ade

Browse files
authored
Allow configuring all ConnTrackers' debug trace level at runtime (#2023)
Summary: Allow configuring all ConnTrackers' debug trace level at runtime When debugging tracing issues with servers that handle requests pre-fork, it's not practical to use `--stirling_conn_trace_pid` (each request is served by a new PID). This change allows enabling debug tracing for all conn trackers to facilitate easier debugging. Relevant Issues: N/A Type of change: /kind feature Test Plan: Skaffolded this change and verified that the following `stirling_ctrl` command enables `CONN_TRACE` globally. ``` $ ./stirling_ctrl ${pid_of_pem} 1 2 ``` Changelog Message: Provide mechanism for debugging a PEM's connection tracking more easily at runtime Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent 6fc0f18 commit 2704ade

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/stirling/source_connectors/socket_tracer/socket_trace_connector.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,12 @@ void SocketTraceConnector::UpdateTrackerTraceLevel(ConnTracker* tracker) {
706706
if (pids_to_trace_disable_.contains(tracker->conn_id().upid.pid)) {
707707
tracker->SetDebugTrace(0);
708708
}
709+
// Debugging Server side tracing is difficult when the server side services requests pre fork
710+
// (certain web servers, postgres, etc). This provides a means for enabling CONN_TRACE for
711+
// all processes since these situations are impossible to debug via --stirling_conn_trace_pid.
712+
if (debug_level_ >= 2) {
713+
tracker->SetDebugTrace(2);
714+
}
709715
}
710716

711717
// Verifies that our openssl tracing does not encounter conditions that invalidate our

0 commit comments

Comments
 (0)