From 6eb3d37bf45844789a7118d259ea14dc0b398a51 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 10 Apr 2021 19:29:26 +0200 Subject: [PATCH] MINOR: trace: make trace sources read_mostly The trace sources are checked at plenty of places in the code and their contents only change when trace status changes, let's mark them read_mostly. --- src/mux_fcgi.c | 2 +- src/mux_h1.c | 2 +- src/mux_h2.c | 2 +- src/mux_pt.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index ddb2a60..f938a57 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -335,7 +335,7 @@ static const struct name_desc fcgi_trace_decoding[] = { { /* end */ } }; -static struct trace_source trace_fcgi = { +static struct trace_source trace_fcgi __read_mostly = { .name = IST("fcgi"), .desc = "FastCGI multiplexer", .arg_def = TRC_ARG1_CONN, // TRACE()'s first argument is always a connection diff --git a/src/mux_h1.c b/src/mux_h1.c index 5b23a29..aa885b8 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -244,7 +244,7 @@ static const struct name_desc h1_trace_decoding[] = { { /* end */ } }; -static struct trace_source trace_h1 = { +static struct trace_source trace_h1 __read_mostly = { .name = IST("h1"), .desc = "HTTP/1 multiplexer", .arg_def = TRC_ARG1_CONN, // TRACE()'s first argument is always a connection diff --git a/src/mux_h2.c b/src/mux_h2.c index a42d573..7d2c64e 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -372,7 +372,7 @@ static const struct name_desc h2_trace_decoding[] = { { /* end */ } }; -static struct trace_source trace_h2 = { +static struct trace_source trace_h2 __read_mostly = { .name = IST("h2"), .desc = "HTTP/2 multiplexer", .arg_def = TRC_ARG1_CONN, // TRACE()'s first argument is always a connection diff --git a/src/mux_pt.c b/src/mux_pt.c index 3a36f37..86b86e2 100644 --- a/src/mux_pt.c +++ b/src/mux_pt.c @@ -76,7 +76,7 @@ static const struct name_desc pt_trace_decoding[] = { { /* end */ } }; -static struct trace_source trace_pt = { +static struct trace_source trace_pt __read_mostly = { .name = IST("pt"), .desc = "Passthrough multiplexer", .arg_def = TRC_ARG1_CONN, // TRACE()'s first argument is always a connection -- 1.7.10.4