From: Christopher Faulet Date: Thu, 27 Jul 2017 14:58:42 +0000 (+0200) Subject: MINOR: threads/filters: Update trace filter to add _per_thread callbacks X-Git-Tag: v1.8-rc1~128 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f2273728976083e9661107765a9b942af941cc9e;p=thirdparty%2Fhaproxy.git MINOR: threads/filters: Update trace filter to add _per_thread callbacks --- diff --git a/src/flt_trace.c b/src/flt_trace.c index 96ce2ac58e..fa26de1fd3 100644 --- a/src/flt_trace.c +++ b/src/flt_trace.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -155,6 +156,26 @@ trace_check(struct proxy *px, struct flt_conf *fconf) return 0; } +/* Initialize the filter for each thread. Return -1 on error, else 0. */ +static int +trace_init_per_thread(struct proxy *px, struct flt_conf *fconf) +{ + struct trace_config *conf = fconf->conf; + + TRACE(conf, "filter initialized for thread tid %u", tid); + return 0; +} + +/* Free ressources allocate by the trace filter for each thread. */ +static void +trace_deinit_per_thread(struct proxy *px, struct flt_conf *fconf) +{ + struct trace_config *conf = fconf->conf; + + if (conf) + TRACE(conf, "filter deinitialized for thread tid %u", tid); +} + /************************************************************************** * Hooks to handle start/stop of streams *************************************************************************/ @@ -509,9 +530,11 @@ trace_tcp_forward_data(struct stream *s, struct filter *filter, struct channel * ********************************************************************/ struct flt_ops trace_ops = { /* Manage trace filter, called for each filter declaration */ - .init = trace_init, - .deinit = trace_deinit, - .check = trace_check, + .init = trace_init, + .deinit = trace_deinit, + .check = trace_check, + .init_per_thread = trace_init_per_thread, + .deinit_per_thread = trace_deinit_per_thread, /* Handle start/stop of streams */ .attach = trace_attach,