/src/haproxy/include/haproxy/freq_ctr.h
Line | Count | Source |
1 | | /* |
2 | | * include/haproxy/freq_ctr.h |
3 | | * This file contains macros and inline functions for frequency counters. |
4 | | * |
5 | | * Copyright (C) 2000-2020 Willy Tarreau - w@1wt.eu |
6 | | * |
7 | | * This library is free software; you can redistribute it and/or |
8 | | * modify it under the terms of the GNU Lesser General Public |
9 | | * License as published by the Free Software Foundation, version 2.1 |
10 | | * exclusively. |
11 | | * |
12 | | * This library is distributed in the hope that it will be useful, |
13 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 | | * Lesser General Public License for more details. |
16 | | * |
17 | | * You should have received a copy of the GNU Lesser General Public |
18 | | * License along with this library; if not, write to the Free Software |
19 | | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | | */ |
21 | | |
22 | | #ifndef _HAPROXY_FREQ_CTR_H |
23 | | #define _HAPROXY_FREQ_CTR_H |
24 | | |
25 | | #include <haproxy/api.h> |
26 | | #include <haproxy/freq_ctr-t.h> |
27 | | #include <haproxy/intops.h> |
28 | | #include <haproxy/ticks.h> |
29 | | |
30 | | /* exported functions from freq_ctr.c */ |
31 | | ullong _freq_ctr_total_from_values(uint period, int pend, uint tick, ullong past, ullong curr); |
32 | | ullong freq_ctr_total(const struct freq_ctr *ctr, uint period, int pend); |
33 | | ullong freq_ctr_total_estimate(const struct freq_ctr *ctr, uint period, int pend); |
34 | | uint freq_ctr_overshoot_period(const struct freq_ctr *ctr, uint period, uint freq); |
35 | | uint update_freq_ctr_period_slow(struct freq_ctr *ctr, uint period, uint inc); |
36 | | |
37 | | /* Only usable during single threaded startup phase. */ |
38 | | static inline void preload_freq_ctr(struct freq_ctr *ctr, uint value) |
39 | 0 | { |
40 | 0 | ctr->curr_ctr = 0; |
41 | 0 | ctr->prev_ctr = value; |
42 | 0 | ctr->curr_tick = now_ms & ~1; |
43 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:preload_freq_ctr Unexecuted instantiation: cfgparse.c:preload_freq_ctr Unexecuted instantiation: cli.c:preload_freq_ctr Unexecuted instantiation: clock.c:preload_freq_ctr Unexecuted instantiation: connection.c:preload_freq_ctr Unexecuted instantiation: debug.c:preload_freq_ctr Unexecuted instantiation: dynbuf.c:preload_freq_ctr Unexecuted instantiation: errors.c:preload_freq_ctr Unexecuted instantiation: fd.c:preload_freq_ctr Unexecuted instantiation: frontend.c:preload_freq_ctr Unexecuted instantiation: haproxy.c:preload_freq_ctr Unexecuted instantiation: http_ana.c:preload_freq_ctr Unexecuted instantiation: http_ext.c:preload_freq_ctr Unexecuted instantiation: http_htx.c:preload_freq_ctr Unexecuted instantiation: http_rules.c:preload_freq_ctr Unexecuted instantiation: htx.c:preload_freq_ctr Unexecuted instantiation: limits.c:preload_freq_ctr Unexecuted instantiation: listener.c:preload_freq_ctr Unexecuted instantiation: log.c:preload_freq_ctr Unexecuted instantiation: mailers.c:preload_freq_ctr Unexecuted instantiation: mworker.c:preload_freq_ctr Unexecuted instantiation: peers.c:preload_freq_ctr Unexecuted instantiation: pool.c:preload_freq_ctr Unexecuted instantiation: proto_rhttp.c:preload_freq_ctr Unexecuted instantiation: proto_sockpair.c:preload_freq_ctr Unexecuted instantiation: protocol.c:preload_freq_ctr Unexecuted instantiation: proxy.c:preload_freq_ctr Unexecuted instantiation: queue.c:preload_freq_ctr Unexecuted instantiation: regex.c:preload_freq_ctr Unexecuted instantiation: resolvers.c:preload_freq_ctr Unexecuted instantiation: ring.c:preload_freq_ctr Unexecuted instantiation: sample.c:preload_freq_ctr Unexecuted instantiation: server.c:preload_freq_ctr Unexecuted instantiation: session.c:preload_freq_ctr Unexecuted instantiation: signal.c:preload_freq_ctr Unexecuted instantiation: sink.c:preload_freq_ctr Unexecuted instantiation: sock.c:preload_freq_ctr Unexecuted instantiation: sock_inet.c:preload_freq_ctr Unexecuted instantiation: stats-html.c:preload_freq_ctr Unexecuted instantiation: stats.c:preload_freq_ctr Unexecuted instantiation: stconn.c:preload_freq_ctr Unexecuted instantiation: stick_table.c:preload_freq_ctr Unexecuted instantiation: stream.c:preload_freq_ctr Unexecuted instantiation: systemd.c:preload_freq_ctr Unexecuted instantiation: task.c:preload_freq_ctr Unexecuted instantiation: tcp_rules.c:preload_freq_ctr Unexecuted instantiation: tcpcheck.c:preload_freq_ctr Unexecuted instantiation: thread.c:preload_freq_ctr Unexecuted instantiation: tools.c:preload_freq_ctr Unexecuted instantiation: trace.c:preload_freq_ctr Unexecuted instantiation: vars.c:preload_freq_ctr Unexecuted instantiation: acl.c:preload_freq_ctr Unexecuted instantiation: action.c:preload_freq_ctr Unexecuted instantiation: activity.c:preload_freq_ctr Unexecuted instantiation: applet.c:preload_freq_ctr Unexecuted instantiation: arg.c:preload_freq_ctr Unexecuted instantiation: backend.c:preload_freq_ctr Unexecuted instantiation: cfgcond.c:preload_freq_ctr Unexecuted instantiation: cfgparse-global.c:preload_freq_ctr Unexecuted instantiation: cfgparse-listen.c:preload_freq_ctr Unexecuted instantiation: channel.c:preload_freq_ctr Unexecuted instantiation: check.c:preload_freq_ctr Unexecuted instantiation: chunk.c:preload_freq_ctr Unexecuted instantiation: compression.c:preload_freq_ctr Unexecuted instantiation: counters.c:preload_freq_ctr Unexecuted instantiation: dgram.c:preload_freq_ctr Unexecuted instantiation: dns.c:preload_freq_ctr Unexecuted instantiation: dns_ring.c:preload_freq_ctr Unexecuted instantiation: event_hdl.c:preload_freq_ctr Unexecuted instantiation: extcheck.c:preload_freq_ctr Unexecuted instantiation: filters.c:preload_freq_ctr Unexecuted instantiation: fix.c:preload_freq_ctr Unexecuted instantiation: flt_http_comp.c:preload_freq_ctr Unexecuted instantiation: freq_ctr.c:preload_freq_ctr Unexecuted instantiation: guid.c:preload_freq_ctr Unexecuted instantiation: h1.c:preload_freq_ctr Unexecuted instantiation: haterm.c:preload_freq_ctr Unexecuted instantiation: http.c:preload_freq_ctr Unexecuted instantiation: http_fetch.c:preload_freq_ctr Unexecuted instantiation: lb_chash.c:preload_freq_ctr Unexecuted instantiation: lb_fas.c:preload_freq_ctr Unexecuted instantiation: lb_fwlc.c:preload_freq_ctr Unexecuted instantiation: lb_fwrr.c:preload_freq_ctr Unexecuted instantiation: lb_map.c:preload_freq_ctr Unexecuted instantiation: mqtt.c:preload_freq_ctr Unexecuted instantiation: mux_spop.c:preload_freq_ctr Unexecuted instantiation: pattern.c:preload_freq_ctr Unexecuted instantiation: payload.c:preload_freq_ctr Unexecuted instantiation: pipe.c:preload_freq_ctr Unexecuted instantiation: proto_tcp.c:preload_freq_ctr Unexecuted instantiation: stats-file.c:preload_freq_ctr Unexecuted instantiation: stats-json.c:preload_freq_ctr Unexecuted instantiation: stats-proxy.c:preload_freq_ctr Unexecuted instantiation: cache.c:preload_freq_ctr Unexecuted instantiation: fcgi-app.c:preload_freq_ctr Unexecuted instantiation: flt_spoe.c:preload_freq_ctr Unexecuted instantiation: h1_htx.c:preload_freq_ctr Unexecuted instantiation: shctx.c:preload_freq_ctr |
44 | | |
45 | | /* Update a frequency counter by <inc> incremental units. It is automatically |
46 | | * rotated if the period is over. It is important that it correctly initializes |
47 | | * a null area. |
48 | | */ |
49 | | static inline uint update_freq_ctr_period(struct freq_ctr *ctr, uint period, uint inc) |
50 | 0 | { |
51 | 0 | uint curr_tick; |
52 | | |
53 | | /* our local clock (now_ms) is most of the time strictly equal to |
54 | | * global_now_ms, and during the edge of the millisecond, global_now_ms |
55 | | * might have been pushed further by another thread. Given that |
56 | | * accessing this shared variable is extremely expensive, we first try |
57 | | * to use our local date, which will be good almost every time. And we |
58 | | * only switch to the global clock when we're out of the period so as |
59 | | * to never put a date in the past there. |
60 | | */ |
61 | 0 | curr_tick = HA_ATOMIC_LOAD(&ctr->curr_tick); |
62 | 0 | if (likely(now_ms - curr_tick < period)) |
63 | 0 | return HA_ATOMIC_ADD_FETCH(&ctr->curr_ctr, inc); |
64 | | |
65 | 0 | return update_freq_ctr_period_slow(ctr, period, inc); |
66 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:update_freq_ctr_period Unexecuted instantiation: cfgparse.c:update_freq_ctr_period Unexecuted instantiation: cli.c:update_freq_ctr_period Unexecuted instantiation: clock.c:update_freq_ctr_period Unexecuted instantiation: connection.c:update_freq_ctr_period Unexecuted instantiation: debug.c:update_freq_ctr_period Unexecuted instantiation: dynbuf.c:update_freq_ctr_period Unexecuted instantiation: errors.c:update_freq_ctr_period Unexecuted instantiation: fd.c:update_freq_ctr_period Unexecuted instantiation: frontend.c:update_freq_ctr_period Unexecuted instantiation: haproxy.c:update_freq_ctr_period Unexecuted instantiation: http_ana.c:update_freq_ctr_period Unexecuted instantiation: http_ext.c:update_freq_ctr_period Unexecuted instantiation: http_htx.c:update_freq_ctr_period Unexecuted instantiation: http_rules.c:update_freq_ctr_period Unexecuted instantiation: htx.c:update_freq_ctr_period Unexecuted instantiation: limits.c:update_freq_ctr_period Unexecuted instantiation: listener.c:update_freq_ctr_period Unexecuted instantiation: log.c:update_freq_ctr_period Unexecuted instantiation: mailers.c:update_freq_ctr_period Unexecuted instantiation: mworker.c:update_freq_ctr_period Unexecuted instantiation: peers.c:update_freq_ctr_period Unexecuted instantiation: pool.c:update_freq_ctr_period Unexecuted instantiation: proto_rhttp.c:update_freq_ctr_period Unexecuted instantiation: proto_sockpair.c:update_freq_ctr_period Unexecuted instantiation: protocol.c:update_freq_ctr_period Unexecuted instantiation: proxy.c:update_freq_ctr_period Unexecuted instantiation: queue.c:update_freq_ctr_period Unexecuted instantiation: regex.c:update_freq_ctr_period Unexecuted instantiation: resolvers.c:update_freq_ctr_period Unexecuted instantiation: ring.c:update_freq_ctr_period Unexecuted instantiation: sample.c:update_freq_ctr_period Unexecuted instantiation: server.c:update_freq_ctr_period Unexecuted instantiation: session.c:update_freq_ctr_period Unexecuted instantiation: signal.c:update_freq_ctr_period Unexecuted instantiation: sink.c:update_freq_ctr_period Unexecuted instantiation: sock.c:update_freq_ctr_period Unexecuted instantiation: sock_inet.c:update_freq_ctr_period Unexecuted instantiation: stats-html.c:update_freq_ctr_period Unexecuted instantiation: stats.c:update_freq_ctr_period Unexecuted instantiation: stconn.c:update_freq_ctr_period Unexecuted instantiation: stick_table.c:update_freq_ctr_period Unexecuted instantiation: stream.c:update_freq_ctr_period Unexecuted instantiation: systemd.c:update_freq_ctr_period Unexecuted instantiation: task.c:update_freq_ctr_period Unexecuted instantiation: tcp_rules.c:update_freq_ctr_period Unexecuted instantiation: tcpcheck.c:update_freq_ctr_period Unexecuted instantiation: thread.c:update_freq_ctr_period Unexecuted instantiation: tools.c:update_freq_ctr_period Unexecuted instantiation: trace.c:update_freq_ctr_period Unexecuted instantiation: vars.c:update_freq_ctr_period Unexecuted instantiation: acl.c:update_freq_ctr_period Unexecuted instantiation: action.c:update_freq_ctr_period Unexecuted instantiation: activity.c:update_freq_ctr_period Unexecuted instantiation: applet.c:update_freq_ctr_period Unexecuted instantiation: arg.c:update_freq_ctr_period Unexecuted instantiation: backend.c:update_freq_ctr_period Unexecuted instantiation: cfgcond.c:update_freq_ctr_period Unexecuted instantiation: cfgparse-global.c:update_freq_ctr_period Unexecuted instantiation: cfgparse-listen.c:update_freq_ctr_period Unexecuted instantiation: channel.c:update_freq_ctr_period Unexecuted instantiation: check.c:update_freq_ctr_period Unexecuted instantiation: chunk.c:update_freq_ctr_period Unexecuted instantiation: compression.c:update_freq_ctr_period Unexecuted instantiation: counters.c:update_freq_ctr_period Unexecuted instantiation: dgram.c:update_freq_ctr_period Unexecuted instantiation: dns.c:update_freq_ctr_period Unexecuted instantiation: dns_ring.c:update_freq_ctr_period Unexecuted instantiation: event_hdl.c:update_freq_ctr_period Unexecuted instantiation: extcheck.c:update_freq_ctr_period Unexecuted instantiation: filters.c:update_freq_ctr_period Unexecuted instantiation: fix.c:update_freq_ctr_period Unexecuted instantiation: flt_http_comp.c:update_freq_ctr_period Unexecuted instantiation: freq_ctr.c:update_freq_ctr_period Unexecuted instantiation: guid.c:update_freq_ctr_period Unexecuted instantiation: h1.c:update_freq_ctr_period Unexecuted instantiation: haterm.c:update_freq_ctr_period Unexecuted instantiation: http.c:update_freq_ctr_period Unexecuted instantiation: http_fetch.c:update_freq_ctr_period Unexecuted instantiation: lb_chash.c:update_freq_ctr_period Unexecuted instantiation: lb_fas.c:update_freq_ctr_period Unexecuted instantiation: lb_fwlc.c:update_freq_ctr_period Unexecuted instantiation: lb_fwrr.c:update_freq_ctr_period Unexecuted instantiation: lb_map.c:update_freq_ctr_period Unexecuted instantiation: mqtt.c:update_freq_ctr_period Unexecuted instantiation: mux_spop.c:update_freq_ctr_period Unexecuted instantiation: pattern.c:update_freq_ctr_period Unexecuted instantiation: payload.c:update_freq_ctr_period Unexecuted instantiation: pipe.c:update_freq_ctr_period Unexecuted instantiation: proto_tcp.c:update_freq_ctr_period Unexecuted instantiation: stats-file.c:update_freq_ctr_period Unexecuted instantiation: stats-json.c:update_freq_ctr_period Unexecuted instantiation: stats-proxy.c:update_freq_ctr_period Unexecuted instantiation: cache.c:update_freq_ctr_period Unexecuted instantiation: fcgi-app.c:update_freq_ctr_period Unexecuted instantiation: flt_spoe.c:update_freq_ctr_period Unexecuted instantiation: h1_htx.c:update_freq_ctr_period Unexecuted instantiation: shctx.c:update_freq_ctr_period |
67 | | |
68 | | /* Update a 1-sec frequency counter by <inc> incremental units. It is automatically |
69 | | * rotated if the period is over. It is important that it correctly initializes |
70 | | * a null area. |
71 | | */ |
72 | | static inline unsigned int update_freq_ctr(struct freq_ctr *ctr, unsigned int inc) |
73 | 0 | { |
74 | 0 | return update_freq_ctr_period(ctr, MS_TO_TICKS(1000), inc); |
75 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:update_freq_ctr Unexecuted instantiation: cfgparse.c:update_freq_ctr Unexecuted instantiation: cli.c:update_freq_ctr Unexecuted instantiation: clock.c:update_freq_ctr Unexecuted instantiation: connection.c:update_freq_ctr Unexecuted instantiation: debug.c:update_freq_ctr Unexecuted instantiation: dynbuf.c:update_freq_ctr Unexecuted instantiation: errors.c:update_freq_ctr Unexecuted instantiation: fd.c:update_freq_ctr Unexecuted instantiation: frontend.c:update_freq_ctr Unexecuted instantiation: haproxy.c:update_freq_ctr Unexecuted instantiation: http_ana.c:update_freq_ctr Unexecuted instantiation: http_ext.c:update_freq_ctr Unexecuted instantiation: http_htx.c:update_freq_ctr Unexecuted instantiation: http_rules.c:update_freq_ctr Unexecuted instantiation: htx.c:update_freq_ctr Unexecuted instantiation: limits.c:update_freq_ctr Unexecuted instantiation: listener.c:update_freq_ctr Unexecuted instantiation: log.c:update_freq_ctr Unexecuted instantiation: mailers.c:update_freq_ctr Unexecuted instantiation: mworker.c:update_freq_ctr Unexecuted instantiation: peers.c:update_freq_ctr Unexecuted instantiation: pool.c:update_freq_ctr Unexecuted instantiation: proto_rhttp.c:update_freq_ctr Unexecuted instantiation: proto_sockpair.c:update_freq_ctr Unexecuted instantiation: protocol.c:update_freq_ctr Unexecuted instantiation: proxy.c:update_freq_ctr Unexecuted instantiation: queue.c:update_freq_ctr Unexecuted instantiation: regex.c:update_freq_ctr Unexecuted instantiation: resolvers.c:update_freq_ctr Unexecuted instantiation: ring.c:update_freq_ctr Unexecuted instantiation: sample.c:update_freq_ctr Unexecuted instantiation: server.c:update_freq_ctr Unexecuted instantiation: session.c:update_freq_ctr Unexecuted instantiation: signal.c:update_freq_ctr Unexecuted instantiation: sink.c:update_freq_ctr Unexecuted instantiation: sock.c:update_freq_ctr Unexecuted instantiation: sock_inet.c:update_freq_ctr Unexecuted instantiation: stats-html.c:update_freq_ctr Unexecuted instantiation: stats.c:update_freq_ctr Unexecuted instantiation: stconn.c:update_freq_ctr Unexecuted instantiation: stick_table.c:update_freq_ctr Unexecuted instantiation: stream.c:update_freq_ctr Unexecuted instantiation: systemd.c:update_freq_ctr Unexecuted instantiation: task.c:update_freq_ctr Unexecuted instantiation: tcp_rules.c:update_freq_ctr Unexecuted instantiation: tcpcheck.c:update_freq_ctr Unexecuted instantiation: thread.c:update_freq_ctr Unexecuted instantiation: tools.c:update_freq_ctr Unexecuted instantiation: trace.c:update_freq_ctr Unexecuted instantiation: vars.c:update_freq_ctr Unexecuted instantiation: acl.c:update_freq_ctr Unexecuted instantiation: action.c:update_freq_ctr Unexecuted instantiation: activity.c:update_freq_ctr Unexecuted instantiation: applet.c:update_freq_ctr Unexecuted instantiation: arg.c:update_freq_ctr Unexecuted instantiation: backend.c:update_freq_ctr Unexecuted instantiation: cfgcond.c:update_freq_ctr Unexecuted instantiation: cfgparse-global.c:update_freq_ctr Unexecuted instantiation: cfgparse-listen.c:update_freq_ctr Unexecuted instantiation: channel.c:update_freq_ctr Unexecuted instantiation: check.c:update_freq_ctr Unexecuted instantiation: chunk.c:update_freq_ctr Unexecuted instantiation: compression.c:update_freq_ctr Unexecuted instantiation: counters.c:update_freq_ctr Unexecuted instantiation: dgram.c:update_freq_ctr Unexecuted instantiation: dns.c:update_freq_ctr Unexecuted instantiation: dns_ring.c:update_freq_ctr Unexecuted instantiation: event_hdl.c:update_freq_ctr Unexecuted instantiation: extcheck.c:update_freq_ctr Unexecuted instantiation: filters.c:update_freq_ctr Unexecuted instantiation: fix.c:update_freq_ctr Unexecuted instantiation: flt_http_comp.c:update_freq_ctr Unexecuted instantiation: freq_ctr.c:update_freq_ctr Unexecuted instantiation: guid.c:update_freq_ctr Unexecuted instantiation: h1.c:update_freq_ctr Unexecuted instantiation: haterm.c:update_freq_ctr Unexecuted instantiation: http.c:update_freq_ctr Unexecuted instantiation: http_fetch.c:update_freq_ctr Unexecuted instantiation: lb_chash.c:update_freq_ctr Unexecuted instantiation: lb_fas.c:update_freq_ctr Unexecuted instantiation: lb_fwlc.c:update_freq_ctr Unexecuted instantiation: lb_fwrr.c:update_freq_ctr Unexecuted instantiation: lb_map.c:update_freq_ctr Unexecuted instantiation: mqtt.c:update_freq_ctr Unexecuted instantiation: mux_spop.c:update_freq_ctr Unexecuted instantiation: pattern.c:update_freq_ctr Unexecuted instantiation: payload.c:update_freq_ctr Unexecuted instantiation: pipe.c:update_freq_ctr Unexecuted instantiation: proto_tcp.c:update_freq_ctr Unexecuted instantiation: stats-file.c:update_freq_ctr Unexecuted instantiation: stats-json.c:update_freq_ctr Unexecuted instantiation: stats-proxy.c:update_freq_ctr Unexecuted instantiation: cache.c:update_freq_ctr Unexecuted instantiation: fcgi-app.c:update_freq_ctr Unexecuted instantiation: flt_spoe.c:update_freq_ctr Unexecuted instantiation: h1_htx.c:update_freq_ctr Unexecuted instantiation: shctx.c:update_freq_ctr |
76 | | |
77 | | /* Reads a frequency counter taking history into account for missing time in |
78 | | * current period. The period has to be passed in number of ticks and must |
79 | | * match the one used to feed the counter. The counter value is reported for |
80 | | * current global date. The return value has the same precision as one input |
81 | | * data sample, so low rates over the period will be inaccurate but still |
82 | | * appropriate for max checking. One trick we use for low values is to specially |
83 | | * handle the case where the rate is between 0 and 1 in order to avoid flapping |
84 | | * while waiting for the next event. |
85 | | * |
86 | | * For immediate limit checking, it's recommended to use freq_ctr_period_remain() |
87 | | * instead which does not have the flapping correction, so that even frequencies |
88 | | * as low as one event/period are properly handled. |
89 | | */ |
90 | | static inline uint read_freq_ctr_period(const struct freq_ctr *ctr, uint period) |
91 | 0 | { |
92 | 0 | ullong total = freq_ctr_total(ctr, period, -1); |
93 | |
|
94 | 0 | return div64_32(total, period); |
95 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:read_freq_ctr_period Unexecuted instantiation: cfgparse.c:read_freq_ctr_period Unexecuted instantiation: cli.c:read_freq_ctr_period Unexecuted instantiation: clock.c:read_freq_ctr_period Unexecuted instantiation: connection.c:read_freq_ctr_period Unexecuted instantiation: debug.c:read_freq_ctr_period Unexecuted instantiation: dynbuf.c:read_freq_ctr_period Unexecuted instantiation: errors.c:read_freq_ctr_period Unexecuted instantiation: fd.c:read_freq_ctr_period Unexecuted instantiation: frontend.c:read_freq_ctr_period Unexecuted instantiation: haproxy.c:read_freq_ctr_period Unexecuted instantiation: http_ana.c:read_freq_ctr_period Unexecuted instantiation: http_ext.c:read_freq_ctr_period Unexecuted instantiation: http_htx.c:read_freq_ctr_period Unexecuted instantiation: http_rules.c:read_freq_ctr_period Unexecuted instantiation: htx.c:read_freq_ctr_period Unexecuted instantiation: limits.c:read_freq_ctr_period Unexecuted instantiation: listener.c:read_freq_ctr_period Unexecuted instantiation: log.c:read_freq_ctr_period Unexecuted instantiation: mailers.c:read_freq_ctr_period Unexecuted instantiation: mworker.c:read_freq_ctr_period Unexecuted instantiation: peers.c:read_freq_ctr_period Unexecuted instantiation: pool.c:read_freq_ctr_period Unexecuted instantiation: proto_rhttp.c:read_freq_ctr_period Unexecuted instantiation: proto_sockpair.c:read_freq_ctr_period Unexecuted instantiation: protocol.c:read_freq_ctr_period Unexecuted instantiation: proxy.c:read_freq_ctr_period Unexecuted instantiation: queue.c:read_freq_ctr_period Unexecuted instantiation: regex.c:read_freq_ctr_period Unexecuted instantiation: resolvers.c:read_freq_ctr_period Unexecuted instantiation: ring.c:read_freq_ctr_period Unexecuted instantiation: sample.c:read_freq_ctr_period Unexecuted instantiation: server.c:read_freq_ctr_period Unexecuted instantiation: session.c:read_freq_ctr_period Unexecuted instantiation: signal.c:read_freq_ctr_period Unexecuted instantiation: sink.c:read_freq_ctr_period Unexecuted instantiation: sock.c:read_freq_ctr_period Unexecuted instantiation: sock_inet.c:read_freq_ctr_period Unexecuted instantiation: stats-html.c:read_freq_ctr_period Unexecuted instantiation: stats.c:read_freq_ctr_period Unexecuted instantiation: stconn.c:read_freq_ctr_period Unexecuted instantiation: stick_table.c:read_freq_ctr_period Unexecuted instantiation: stream.c:read_freq_ctr_period Unexecuted instantiation: systemd.c:read_freq_ctr_period Unexecuted instantiation: task.c:read_freq_ctr_period Unexecuted instantiation: tcp_rules.c:read_freq_ctr_period Unexecuted instantiation: tcpcheck.c:read_freq_ctr_period Unexecuted instantiation: thread.c:read_freq_ctr_period Unexecuted instantiation: tools.c:read_freq_ctr_period Unexecuted instantiation: trace.c:read_freq_ctr_period Unexecuted instantiation: vars.c:read_freq_ctr_period Unexecuted instantiation: acl.c:read_freq_ctr_period Unexecuted instantiation: action.c:read_freq_ctr_period Unexecuted instantiation: activity.c:read_freq_ctr_period Unexecuted instantiation: applet.c:read_freq_ctr_period Unexecuted instantiation: arg.c:read_freq_ctr_period Unexecuted instantiation: backend.c:read_freq_ctr_period Unexecuted instantiation: cfgcond.c:read_freq_ctr_period Unexecuted instantiation: cfgparse-global.c:read_freq_ctr_period Unexecuted instantiation: cfgparse-listen.c:read_freq_ctr_period Unexecuted instantiation: channel.c:read_freq_ctr_period Unexecuted instantiation: check.c:read_freq_ctr_period Unexecuted instantiation: chunk.c:read_freq_ctr_period Unexecuted instantiation: compression.c:read_freq_ctr_period Unexecuted instantiation: counters.c:read_freq_ctr_period Unexecuted instantiation: dgram.c:read_freq_ctr_period Unexecuted instantiation: dns.c:read_freq_ctr_period Unexecuted instantiation: dns_ring.c:read_freq_ctr_period Unexecuted instantiation: event_hdl.c:read_freq_ctr_period Unexecuted instantiation: extcheck.c:read_freq_ctr_period Unexecuted instantiation: filters.c:read_freq_ctr_period Unexecuted instantiation: fix.c:read_freq_ctr_period Unexecuted instantiation: flt_http_comp.c:read_freq_ctr_period Unexecuted instantiation: freq_ctr.c:read_freq_ctr_period Unexecuted instantiation: guid.c:read_freq_ctr_period Unexecuted instantiation: h1.c:read_freq_ctr_period Unexecuted instantiation: haterm.c:read_freq_ctr_period Unexecuted instantiation: http.c:read_freq_ctr_period Unexecuted instantiation: http_fetch.c:read_freq_ctr_period Unexecuted instantiation: lb_chash.c:read_freq_ctr_period Unexecuted instantiation: lb_fas.c:read_freq_ctr_period Unexecuted instantiation: lb_fwlc.c:read_freq_ctr_period Unexecuted instantiation: lb_fwrr.c:read_freq_ctr_period Unexecuted instantiation: lb_map.c:read_freq_ctr_period Unexecuted instantiation: mqtt.c:read_freq_ctr_period Unexecuted instantiation: mux_spop.c:read_freq_ctr_period Unexecuted instantiation: pattern.c:read_freq_ctr_period Unexecuted instantiation: payload.c:read_freq_ctr_period Unexecuted instantiation: pipe.c:read_freq_ctr_period Unexecuted instantiation: proto_tcp.c:read_freq_ctr_period Unexecuted instantiation: stats-file.c:read_freq_ctr_period Unexecuted instantiation: stats-json.c:read_freq_ctr_period Unexecuted instantiation: stats-proxy.c:read_freq_ctr_period Unexecuted instantiation: cache.c:read_freq_ctr_period Unexecuted instantiation: fcgi-app.c:read_freq_ctr_period Unexecuted instantiation: flt_spoe.c:read_freq_ctr_period Unexecuted instantiation: h1_htx.c:read_freq_ctr_period Unexecuted instantiation: shctx.c:read_freq_ctr_period |
96 | | |
97 | | /* same as read_freq_ctr_period() above except that it doesn't lock and may |
98 | | * return incorrect values. This is only meant for use in signal handlers. |
99 | | */ |
100 | | static inline uint read_freq_ctr_period_estimate(const struct freq_ctr *ctr, uint period) |
101 | 0 | { |
102 | 0 | ullong total = freq_ctr_total_estimate(ctr, period, -1); |
103 | |
|
104 | 0 | return div64_32(total, period); |
105 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:read_freq_ctr_period_estimate Unexecuted instantiation: cfgparse.c:read_freq_ctr_period_estimate Unexecuted instantiation: cli.c:read_freq_ctr_period_estimate Unexecuted instantiation: clock.c:read_freq_ctr_period_estimate Unexecuted instantiation: connection.c:read_freq_ctr_period_estimate Unexecuted instantiation: debug.c:read_freq_ctr_period_estimate Unexecuted instantiation: dynbuf.c:read_freq_ctr_period_estimate Unexecuted instantiation: errors.c:read_freq_ctr_period_estimate Unexecuted instantiation: fd.c:read_freq_ctr_period_estimate Unexecuted instantiation: frontend.c:read_freq_ctr_period_estimate Unexecuted instantiation: haproxy.c:read_freq_ctr_period_estimate Unexecuted instantiation: http_ana.c:read_freq_ctr_period_estimate Unexecuted instantiation: http_ext.c:read_freq_ctr_period_estimate Unexecuted instantiation: http_htx.c:read_freq_ctr_period_estimate Unexecuted instantiation: http_rules.c:read_freq_ctr_period_estimate Unexecuted instantiation: htx.c:read_freq_ctr_period_estimate Unexecuted instantiation: limits.c:read_freq_ctr_period_estimate Unexecuted instantiation: listener.c:read_freq_ctr_period_estimate Unexecuted instantiation: log.c:read_freq_ctr_period_estimate Unexecuted instantiation: mailers.c:read_freq_ctr_period_estimate Unexecuted instantiation: mworker.c:read_freq_ctr_period_estimate Unexecuted instantiation: peers.c:read_freq_ctr_period_estimate Unexecuted instantiation: pool.c:read_freq_ctr_period_estimate Unexecuted instantiation: proto_rhttp.c:read_freq_ctr_period_estimate Unexecuted instantiation: proto_sockpair.c:read_freq_ctr_period_estimate Unexecuted instantiation: protocol.c:read_freq_ctr_period_estimate Unexecuted instantiation: proxy.c:read_freq_ctr_period_estimate Unexecuted instantiation: queue.c:read_freq_ctr_period_estimate Unexecuted instantiation: regex.c:read_freq_ctr_period_estimate Unexecuted instantiation: resolvers.c:read_freq_ctr_period_estimate Unexecuted instantiation: ring.c:read_freq_ctr_period_estimate Unexecuted instantiation: sample.c:read_freq_ctr_period_estimate Unexecuted instantiation: server.c:read_freq_ctr_period_estimate Unexecuted instantiation: session.c:read_freq_ctr_period_estimate Unexecuted instantiation: signal.c:read_freq_ctr_period_estimate Unexecuted instantiation: sink.c:read_freq_ctr_period_estimate Unexecuted instantiation: sock.c:read_freq_ctr_period_estimate Unexecuted instantiation: sock_inet.c:read_freq_ctr_period_estimate Unexecuted instantiation: stats-html.c:read_freq_ctr_period_estimate Unexecuted instantiation: stats.c:read_freq_ctr_period_estimate Unexecuted instantiation: stconn.c:read_freq_ctr_period_estimate Unexecuted instantiation: stick_table.c:read_freq_ctr_period_estimate Unexecuted instantiation: stream.c:read_freq_ctr_period_estimate Unexecuted instantiation: systemd.c:read_freq_ctr_period_estimate Unexecuted instantiation: task.c:read_freq_ctr_period_estimate Unexecuted instantiation: tcp_rules.c:read_freq_ctr_period_estimate Unexecuted instantiation: tcpcheck.c:read_freq_ctr_period_estimate Unexecuted instantiation: thread.c:read_freq_ctr_period_estimate Unexecuted instantiation: tools.c:read_freq_ctr_period_estimate Unexecuted instantiation: trace.c:read_freq_ctr_period_estimate Unexecuted instantiation: vars.c:read_freq_ctr_period_estimate Unexecuted instantiation: acl.c:read_freq_ctr_period_estimate Unexecuted instantiation: action.c:read_freq_ctr_period_estimate Unexecuted instantiation: activity.c:read_freq_ctr_period_estimate Unexecuted instantiation: applet.c:read_freq_ctr_period_estimate Unexecuted instantiation: arg.c:read_freq_ctr_period_estimate Unexecuted instantiation: backend.c:read_freq_ctr_period_estimate Unexecuted instantiation: cfgcond.c:read_freq_ctr_period_estimate Unexecuted instantiation: cfgparse-global.c:read_freq_ctr_period_estimate Unexecuted instantiation: cfgparse-listen.c:read_freq_ctr_period_estimate Unexecuted instantiation: channel.c:read_freq_ctr_period_estimate Unexecuted instantiation: check.c:read_freq_ctr_period_estimate Unexecuted instantiation: chunk.c:read_freq_ctr_period_estimate Unexecuted instantiation: compression.c:read_freq_ctr_period_estimate Unexecuted instantiation: counters.c:read_freq_ctr_period_estimate Unexecuted instantiation: dgram.c:read_freq_ctr_period_estimate Unexecuted instantiation: dns.c:read_freq_ctr_period_estimate Unexecuted instantiation: dns_ring.c:read_freq_ctr_period_estimate Unexecuted instantiation: event_hdl.c:read_freq_ctr_period_estimate Unexecuted instantiation: extcheck.c:read_freq_ctr_period_estimate Unexecuted instantiation: filters.c:read_freq_ctr_period_estimate Unexecuted instantiation: fix.c:read_freq_ctr_period_estimate Unexecuted instantiation: flt_http_comp.c:read_freq_ctr_period_estimate Unexecuted instantiation: freq_ctr.c:read_freq_ctr_period_estimate Unexecuted instantiation: guid.c:read_freq_ctr_period_estimate Unexecuted instantiation: h1.c:read_freq_ctr_period_estimate Unexecuted instantiation: haterm.c:read_freq_ctr_period_estimate Unexecuted instantiation: http.c:read_freq_ctr_period_estimate Unexecuted instantiation: http_fetch.c:read_freq_ctr_period_estimate Unexecuted instantiation: lb_chash.c:read_freq_ctr_period_estimate Unexecuted instantiation: lb_fas.c:read_freq_ctr_period_estimate Unexecuted instantiation: lb_fwlc.c:read_freq_ctr_period_estimate Unexecuted instantiation: lb_fwrr.c:read_freq_ctr_period_estimate Unexecuted instantiation: lb_map.c:read_freq_ctr_period_estimate Unexecuted instantiation: mqtt.c:read_freq_ctr_period_estimate Unexecuted instantiation: mux_spop.c:read_freq_ctr_period_estimate Unexecuted instantiation: pattern.c:read_freq_ctr_period_estimate Unexecuted instantiation: payload.c:read_freq_ctr_period_estimate Unexecuted instantiation: pipe.c:read_freq_ctr_period_estimate Unexecuted instantiation: proto_tcp.c:read_freq_ctr_period_estimate Unexecuted instantiation: stats-file.c:read_freq_ctr_period_estimate Unexecuted instantiation: stats-json.c:read_freq_ctr_period_estimate Unexecuted instantiation: stats-proxy.c:read_freq_ctr_period_estimate Unexecuted instantiation: cache.c:read_freq_ctr_period_estimate Unexecuted instantiation: fcgi-app.c:read_freq_ctr_period_estimate Unexecuted instantiation: flt_spoe.c:read_freq_ctr_period_estimate Unexecuted instantiation: h1_htx.c:read_freq_ctr_period_estimate Unexecuted instantiation: shctx.c:read_freq_ctr_period_estimate |
106 | | |
107 | | /* same as read_freq_ctr_period() above except that floats are used for the |
108 | | * output so that low rates can be more precise. |
109 | | */ |
110 | | static inline double read_freq_ctr_period_flt(const struct freq_ctr *ctr, uint period) |
111 | 0 | { |
112 | 0 | ullong total = freq_ctr_total(ctr, period, -1); |
113 | |
|
114 | 0 | return (double)total / (double)period; |
115 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:read_freq_ctr_period_flt Unexecuted instantiation: cfgparse.c:read_freq_ctr_period_flt Unexecuted instantiation: cli.c:read_freq_ctr_period_flt Unexecuted instantiation: clock.c:read_freq_ctr_period_flt Unexecuted instantiation: connection.c:read_freq_ctr_period_flt Unexecuted instantiation: debug.c:read_freq_ctr_period_flt Unexecuted instantiation: dynbuf.c:read_freq_ctr_period_flt Unexecuted instantiation: errors.c:read_freq_ctr_period_flt Unexecuted instantiation: fd.c:read_freq_ctr_period_flt Unexecuted instantiation: frontend.c:read_freq_ctr_period_flt Unexecuted instantiation: haproxy.c:read_freq_ctr_period_flt Unexecuted instantiation: http_ana.c:read_freq_ctr_period_flt Unexecuted instantiation: http_ext.c:read_freq_ctr_period_flt Unexecuted instantiation: http_htx.c:read_freq_ctr_period_flt Unexecuted instantiation: http_rules.c:read_freq_ctr_period_flt Unexecuted instantiation: htx.c:read_freq_ctr_period_flt Unexecuted instantiation: limits.c:read_freq_ctr_period_flt Unexecuted instantiation: listener.c:read_freq_ctr_period_flt Unexecuted instantiation: log.c:read_freq_ctr_period_flt Unexecuted instantiation: mailers.c:read_freq_ctr_period_flt Unexecuted instantiation: mworker.c:read_freq_ctr_period_flt Unexecuted instantiation: peers.c:read_freq_ctr_period_flt Unexecuted instantiation: pool.c:read_freq_ctr_period_flt Unexecuted instantiation: proto_rhttp.c:read_freq_ctr_period_flt Unexecuted instantiation: proto_sockpair.c:read_freq_ctr_period_flt Unexecuted instantiation: protocol.c:read_freq_ctr_period_flt Unexecuted instantiation: proxy.c:read_freq_ctr_period_flt Unexecuted instantiation: queue.c:read_freq_ctr_period_flt Unexecuted instantiation: regex.c:read_freq_ctr_period_flt Unexecuted instantiation: resolvers.c:read_freq_ctr_period_flt Unexecuted instantiation: ring.c:read_freq_ctr_period_flt Unexecuted instantiation: sample.c:read_freq_ctr_period_flt Unexecuted instantiation: server.c:read_freq_ctr_period_flt Unexecuted instantiation: session.c:read_freq_ctr_period_flt Unexecuted instantiation: signal.c:read_freq_ctr_period_flt Unexecuted instantiation: sink.c:read_freq_ctr_period_flt Unexecuted instantiation: sock.c:read_freq_ctr_period_flt Unexecuted instantiation: sock_inet.c:read_freq_ctr_period_flt Unexecuted instantiation: stats-html.c:read_freq_ctr_period_flt Unexecuted instantiation: stats.c:read_freq_ctr_period_flt Unexecuted instantiation: stconn.c:read_freq_ctr_period_flt Unexecuted instantiation: stick_table.c:read_freq_ctr_period_flt Unexecuted instantiation: stream.c:read_freq_ctr_period_flt Unexecuted instantiation: systemd.c:read_freq_ctr_period_flt Unexecuted instantiation: task.c:read_freq_ctr_period_flt Unexecuted instantiation: tcp_rules.c:read_freq_ctr_period_flt Unexecuted instantiation: tcpcheck.c:read_freq_ctr_period_flt Unexecuted instantiation: thread.c:read_freq_ctr_period_flt Unexecuted instantiation: tools.c:read_freq_ctr_period_flt Unexecuted instantiation: trace.c:read_freq_ctr_period_flt Unexecuted instantiation: vars.c:read_freq_ctr_period_flt Unexecuted instantiation: acl.c:read_freq_ctr_period_flt Unexecuted instantiation: action.c:read_freq_ctr_period_flt Unexecuted instantiation: activity.c:read_freq_ctr_period_flt Unexecuted instantiation: applet.c:read_freq_ctr_period_flt Unexecuted instantiation: arg.c:read_freq_ctr_period_flt Unexecuted instantiation: backend.c:read_freq_ctr_period_flt Unexecuted instantiation: cfgcond.c:read_freq_ctr_period_flt Unexecuted instantiation: cfgparse-global.c:read_freq_ctr_period_flt Unexecuted instantiation: cfgparse-listen.c:read_freq_ctr_period_flt Unexecuted instantiation: channel.c:read_freq_ctr_period_flt Unexecuted instantiation: check.c:read_freq_ctr_period_flt Unexecuted instantiation: chunk.c:read_freq_ctr_period_flt Unexecuted instantiation: compression.c:read_freq_ctr_period_flt Unexecuted instantiation: counters.c:read_freq_ctr_period_flt Unexecuted instantiation: dgram.c:read_freq_ctr_period_flt Unexecuted instantiation: dns.c:read_freq_ctr_period_flt Unexecuted instantiation: dns_ring.c:read_freq_ctr_period_flt Unexecuted instantiation: event_hdl.c:read_freq_ctr_period_flt Unexecuted instantiation: extcheck.c:read_freq_ctr_period_flt Unexecuted instantiation: filters.c:read_freq_ctr_period_flt Unexecuted instantiation: fix.c:read_freq_ctr_period_flt Unexecuted instantiation: flt_http_comp.c:read_freq_ctr_period_flt Unexecuted instantiation: freq_ctr.c:read_freq_ctr_period_flt Unexecuted instantiation: guid.c:read_freq_ctr_period_flt Unexecuted instantiation: h1.c:read_freq_ctr_period_flt Unexecuted instantiation: haterm.c:read_freq_ctr_period_flt Unexecuted instantiation: http.c:read_freq_ctr_period_flt Unexecuted instantiation: http_fetch.c:read_freq_ctr_period_flt Unexecuted instantiation: lb_chash.c:read_freq_ctr_period_flt Unexecuted instantiation: lb_fas.c:read_freq_ctr_period_flt Unexecuted instantiation: lb_fwlc.c:read_freq_ctr_period_flt Unexecuted instantiation: lb_fwrr.c:read_freq_ctr_period_flt Unexecuted instantiation: lb_map.c:read_freq_ctr_period_flt Unexecuted instantiation: mqtt.c:read_freq_ctr_period_flt Unexecuted instantiation: mux_spop.c:read_freq_ctr_period_flt Unexecuted instantiation: pattern.c:read_freq_ctr_period_flt Unexecuted instantiation: payload.c:read_freq_ctr_period_flt Unexecuted instantiation: pipe.c:read_freq_ctr_period_flt Unexecuted instantiation: proto_tcp.c:read_freq_ctr_period_flt Unexecuted instantiation: stats-file.c:read_freq_ctr_period_flt Unexecuted instantiation: stats-json.c:read_freq_ctr_period_flt Unexecuted instantiation: stats-proxy.c:read_freq_ctr_period_flt Unexecuted instantiation: cache.c:read_freq_ctr_period_flt Unexecuted instantiation: fcgi-app.c:read_freq_ctr_period_flt Unexecuted instantiation: flt_spoe.c:read_freq_ctr_period_flt Unexecuted instantiation: h1_htx.c:read_freq_ctr_period_flt Unexecuted instantiation: shctx.c:read_freq_ctr_period_flt |
116 | | |
117 | | /* Read a 1-sec frequency counter taking history into account for missing time |
118 | | * in current period. |
119 | | */ |
120 | | static inline unsigned int read_freq_ctr(const struct freq_ctr *ctr) |
121 | 0 | { |
122 | 0 | return read_freq_ctr_period(ctr, MS_TO_TICKS(1000)); |
123 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:read_freq_ctr Unexecuted instantiation: cfgparse.c:read_freq_ctr Unexecuted instantiation: cli.c:read_freq_ctr Unexecuted instantiation: clock.c:read_freq_ctr Unexecuted instantiation: connection.c:read_freq_ctr Unexecuted instantiation: debug.c:read_freq_ctr Unexecuted instantiation: dynbuf.c:read_freq_ctr Unexecuted instantiation: errors.c:read_freq_ctr Unexecuted instantiation: fd.c:read_freq_ctr Unexecuted instantiation: frontend.c:read_freq_ctr Unexecuted instantiation: haproxy.c:read_freq_ctr Unexecuted instantiation: http_ana.c:read_freq_ctr Unexecuted instantiation: http_ext.c:read_freq_ctr Unexecuted instantiation: http_htx.c:read_freq_ctr Unexecuted instantiation: http_rules.c:read_freq_ctr Unexecuted instantiation: htx.c:read_freq_ctr Unexecuted instantiation: limits.c:read_freq_ctr Unexecuted instantiation: listener.c:read_freq_ctr Unexecuted instantiation: log.c:read_freq_ctr Unexecuted instantiation: mailers.c:read_freq_ctr Unexecuted instantiation: mworker.c:read_freq_ctr Unexecuted instantiation: peers.c:read_freq_ctr Unexecuted instantiation: pool.c:read_freq_ctr Unexecuted instantiation: proto_rhttp.c:read_freq_ctr Unexecuted instantiation: proto_sockpair.c:read_freq_ctr Unexecuted instantiation: protocol.c:read_freq_ctr Unexecuted instantiation: proxy.c:read_freq_ctr Unexecuted instantiation: queue.c:read_freq_ctr Unexecuted instantiation: regex.c:read_freq_ctr Unexecuted instantiation: resolvers.c:read_freq_ctr Unexecuted instantiation: ring.c:read_freq_ctr Unexecuted instantiation: sample.c:read_freq_ctr Unexecuted instantiation: server.c:read_freq_ctr Unexecuted instantiation: session.c:read_freq_ctr Unexecuted instantiation: signal.c:read_freq_ctr Unexecuted instantiation: sink.c:read_freq_ctr Unexecuted instantiation: sock.c:read_freq_ctr Unexecuted instantiation: sock_inet.c:read_freq_ctr Unexecuted instantiation: stats-html.c:read_freq_ctr Unexecuted instantiation: stats.c:read_freq_ctr Unexecuted instantiation: stconn.c:read_freq_ctr Unexecuted instantiation: stick_table.c:read_freq_ctr Unexecuted instantiation: stream.c:read_freq_ctr Unexecuted instantiation: systemd.c:read_freq_ctr Unexecuted instantiation: task.c:read_freq_ctr Unexecuted instantiation: tcp_rules.c:read_freq_ctr Unexecuted instantiation: tcpcheck.c:read_freq_ctr Unexecuted instantiation: thread.c:read_freq_ctr Unexecuted instantiation: tools.c:read_freq_ctr Unexecuted instantiation: trace.c:read_freq_ctr Unexecuted instantiation: vars.c:read_freq_ctr Unexecuted instantiation: acl.c:read_freq_ctr Unexecuted instantiation: action.c:read_freq_ctr Unexecuted instantiation: activity.c:read_freq_ctr Unexecuted instantiation: applet.c:read_freq_ctr Unexecuted instantiation: arg.c:read_freq_ctr Unexecuted instantiation: backend.c:read_freq_ctr Unexecuted instantiation: cfgcond.c:read_freq_ctr Unexecuted instantiation: cfgparse-global.c:read_freq_ctr Unexecuted instantiation: cfgparse-listen.c:read_freq_ctr Unexecuted instantiation: channel.c:read_freq_ctr Unexecuted instantiation: check.c:read_freq_ctr Unexecuted instantiation: chunk.c:read_freq_ctr Unexecuted instantiation: compression.c:read_freq_ctr Unexecuted instantiation: counters.c:read_freq_ctr Unexecuted instantiation: dgram.c:read_freq_ctr Unexecuted instantiation: dns.c:read_freq_ctr Unexecuted instantiation: dns_ring.c:read_freq_ctr Unexecuted instantiation: event_hdl.c:read_freq_ctr Unexecuted instantiation: extcheck.c:read_freq_ctr Unexecuted instantiation: filters.c:read_freq_ctr Unexecuted instantiation: fix.c:read_freq_ctr Unexecuted instantiation: flt_http_comp.c:read_freq_ctr Unexecuted instantiation: freq_ctr.c:read_freq_ctr Unexecuted instantiation: guid.c:read_freq_ctr Unexecuted instantiation: h1.c:read_freq_ctr Unexecuted instantiation: haterm.c:read_freq_ctr Unexecuted instantiation: http.c:read_freq_ctr Unexecuted instantiation: http_fetch.c:read_freq_ctr Unexecuted instantiation: lb_chash.c:read_freq_ctr Unexecuted instantiation: lb_fas.c:read_freq_ctr Unexecuted instantiation: lb_fwlc.c:read_freq_ctr Unexecuted instantiation: lb_fwrr.c:read_freq_ctr Unexecuted instantiation: lb_map.c:read_freq_ctr Unexecuted instantiation: mqtt.c:read_freq_ctr Unexecuted instantiation: mux_spop.c:read_freq_ctr Unexecuted instantiation: pattern.c:read_freq_ctr Unexecuted instantiation: payload.c:read_freq_ctr Unexecuted instantiation: pipe.c:read_freq_ctr Unexecuted instantiation: proto_tcp.c:read_freq_ctr Unexecuted instantiation: stats-file.c:read_freq_ctr Unexecuted instantiation: stats-json.c:read_freq_ctr Unexecuted instantiation: stats-proxy.c:read_freq_ctr Unexecuted instantiation: cache.c:read_freq_ctr Unexecuted instantiation: fcgi-app.c:read_freq_ctr Unexecuted instantiation: flt_spoe.c:read_freq_ctr Unexecuted instantiation: h1_htx.c:read_freq_ctr Unexecuted instantiation: shctx.c:read_freq_ctr |
124 | | |
125 | | /* same as read_freq_ctr() above except that floats are used for the |
126 | | * output so that low rates can be more precise. |
127 | | */ |
128 | | static inline double read_freq_ctr_flt(const struct freq_ctr *ctr) |
129 | 0 | { |
130 | 0 | return read_freq_ctr_period_flt(ctr, MS_TO_TICKS(1000)); |
131 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:read_freq_ctr_flt Unexecuted instantiation: cfgparse.c:read_freq_ctr_flt Unexecuted instantiation: cli.c:read_freq_ctr_flt Unexecuted instantiation: clock.c:read_freq_ctr_flt Unexecuted instantiation: connection.c:read_freq_ctr_flt Unexecuted instantiation: debug.c:read_freq_ctr_flt Unexecuted instantiation: dynbuf.c:read_freq_ctr_flt Unexecuted instantiation: errors.c:read_freq_ctr_flt Unexecuted instantiation: fd.c:read_freq_ctr_flt Unexecuted instantiation: frontend.c:read_freq_ctr_flt Unexecuted instantiation: haproxy.c:read_freq_ctr_flt Unexecuted instantiation: http_ana.c:read_freq_ctr_flt Unexecuted instantiation: http_ext.c:read_freq_ctr_flt Unexecuted instantiation: http_htx.c:read_freq_ctr_flt Unexecuted instantiation: http_rules.c:read_freq_ctr_flt Unexecuted instantiation: htx.c:read_freq_ctr_flt Unexecuted instantiation: limits.c:read_freq_ctr_flt Unexecuted instantiation: listener.c:read_freq_ctr_flt Unexecuted instantiation: log.c:read_freq_ctr_flt Unexecuted instantiation: mailers.c:read_freq_ctr_flt Unexecuted instantiation: mworker.c:read_freq_ctr_flt Unexecuted instantiation: peers.c:read_freq_ctr_flt Unexecuted instantiation: pool.c:read_freq_ctr_flt Unexecuted instantiation: proto_rhttp.c:read_freq_ctr_flt Unexecuted instantiation: proto_sockpair.c:read_freq_ctr_flt Unexecuted instantiation: protocol.c:read_freq_ctr_flt Unexecuted instantiation: proxy.c:read_freq_ctr_flt Unexecuted instantiation: queue.c:read_freq_ctr_flt Unexecuted instantiation: regex.c:read_freq_ctr_flt Unexecuted instantiation: resolvers.c:read_freq_ctr_flt Unexecuted instantiation: ring.c:read_freq_ctr_flt Unexecuted instantiation: sample.c:read_freq_ctr_flt Unexecuted instantiation: server.c:read_freq_ctr_flt Unexecuted instantiation: session.c:read_freq_ctr_flt Unexecuted instantiation: signal.c:read_freq_ctr_flt Unexecuted instantiation: sink.c:read_freq_ctr_flt Unexecuted instantiation: sock.c:read_freq_ctr_flt Unexecuted instantiation: sock_inet.c:read_freq_ctr_flt Unexecuted instantiation: stats-html.c:read_freq_ctr_flt Unexecuted instantiation: stats.c:read_freq_ctr_flt Unexecuted instantiation: stconn.c:read_freq_ctr_flt Unexecuted instantiation: stick_table.c:read_freq_ctr_flt Unexecuted instantiation: stream.c:read_freq_ctr_flt Unexecuted instantiation: systemd.c:read_freq_ctr_flt Unexecuted instantiation: task.c:read_freq_ctr_flt Unexecuted instantiation: tcp_rules.c:read_freq_ctr_flt Unexecuted instantiation: tcpcheck.c:read_freq_ctr_flt Unexecuted instantiation: thread.c:read_freq_ctr_flt Unexecuted instantiation: tools.c:read_freq_ctr_flt Unexecuted instantiation: trace.c:read_freq_ctr_flt Unexecuted instantiation: vars.c:read_freq_ctr_flt Unexecuted instantiation: acl.c:read_freq_ctr_flt Unexecuted instantiation: action.c:read_freq_ctr_flt Unexecuted instantiation: activity.c:read_freq_ctr_flt Unexecuted instantiation: applet.c:read_freq_ctr_flt Unexecuted instantiation: arg.c:read_freq_ctr_flt Unexecuted instantiation: backend.c:read_freq_ctr_flt Unexecuted instantiation: cfgcond.c:read_freq_ctr_flt Unexecuted instantiation: cfgparse-global.c:read_freq_ctr_flt Unexecuted instantiation: cfgparse-listen.c:read_freq_ctr_flt Unexecuted instantiation: channel.c:read_freq_ctr_flt Unexecuted instantiation: check.c:read_freq_ctr_flt Unexecuted instantiation: chunk.c:read_freq_ctr_flt Unexecuted instantiation: compression.c:read_freq_ctr_flt Unexecuted instantiation: counters.c:read_freq_ctr_flt Unexecuted instantiation: dgram.c:read_freq_ctr_flt Unexecuted instantiation: dns.c:read_freq_ctr_flt Unexecuted instantiation: dns_ring.c:read_freq_ctr_flt Unexecuted instantiation: event_hdl.c:read_freq_ctr_flt Unexecuted instantiation: extcheck.c:read_freq_ctr_flt Unexecuted instantiation: filters.c:read_freq_ctr_flt Unexecuted instantiation: fix.c:read_freq_ctr_flt Unexecuted instantiation: flt_http_comp.c:read_freq_ctr_flt Unexecuted instantiation: freq_ctr.c:read_freq_ctr_flt Unexecuted instantiation: guid.c:read_freq_ctr_flt Unexecuted instantiation: h1.c:read_freq_ctr_flt Unexecuted instantiation: haterm.c:read_freq_ctr_flt Unexecuted instantiation: http.c:read_freq_ctr_flt Unexecuted instantiation: http_fetch.c:read_freq_ctr_flt Unexecuted instantiation: lb_chash.c:read_freq_ctr_flt Unexecuted instantiation: lb_fas.c:read_freq_ctr_flt Unexecuted instantiation: lb_fwlc.c:read_freq_ctr_flt Unexecuted instantiation: lb_fwrr.c:read_freq_ctr_flt Unexecuted instantiation: lb_map.c:read_freq_ctr_flt Unexecuted instantiation: mqtt.c:read_freq_ctr_flt Unexecuted instantiation: mux_spop.c:read_freq_ctr_flt Unexecuted instantiation: pattern.c:read_freq_ctr_flt Unexecuted instantiation: payload.c:read_freq_ctr_flt Unexecuted instantiation: pipe.c:read_freq_ctr_flt Unexecuted instantiation: proto_tcp.c:read_freq_ctr_flt Unexecuted instantiation: stats-file.c:read_freq_ctr_flt Unexecuted instantiation: stats-json.c:read_freq_ctr_flt Unexecuted instantiation: stats-proxy.c:read_freq_ctr_flt Unexecuted instantiation: cache.c:read_freq_ctr_flt Unexecuted instantiation: fcgi-app.c:read_freq_ctr_flt Unexecuted instantiation: flt_spoe.c:read_freq_ctr_flt Unexecuted instantiation: h1_htx.c:read_freq_ctr_flt Unexecuted instantiation: shctx.c:read_freq_ctr_flt |
132 | | |
133 | | /* Returns the number of remaining events that can occur on this freq counter |
134 | | * while respecting <freq> events per period, and taking into account that |
135 | | * <pend> events are already known to be pending. Returns 0 if limit was reached. |
136 | | */ |
137 | | static inline uint freq_ctr_remain_period(const struct freq_ctr *ctr, uint period, uint freq, uint pend) |
138 | 0 | { |
139 | 0 | ullong total = freq_ctr_total(ctr, period, pend); |
140 | 0 | uint avg = div64_32(total, period); |
141 | |
|
142 | 0 | if (avg > freq) |
143 | 0 | avg = freq; |
144 | 0 | return freq - avg; |
145 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:freq_ctr_remain_period Unexecuted instantiation: cfgparse.c:freq_ctr_remain_period Unexecuted instantiation: cli.c:freq_ctr_remain_period Unexecuted instantiation: clock.c:freq_ctr_remain_period Unexecuted instantiation: connection.c:freq_ctr_remain_period Unexecuted instantiation: debug.c:freq_ctr_remain_period Unexecuted instantiation: dynbuf.c:freq_ctr_remain_period Unexecuted instantiation: errors.c:freq_ctr_remain_period Unexecuted instantiation: fd.c:freq_ctr_remain_period Unexecuted instantiation: frontend.c:freq_ctr_remain_period Unexecuted instantiation: haproxy.c:freq_ctr_remain_period Unexecuted instantiation: http_ana.c:freq_ctr_remain_period Unexecuted instantiation: http_ext.c:freq_ctr_remain_period Unexecuted instantiation: http_htx.c:freq_ctr_remain_period Unexecuted instantiation: http_rules.c:freq_ctr_remain_period Unexecuted instantiation: htx.c:freq_ctr_remain_period Unexecuted instantiation: limits.c:freq_ctr_remain_period Unexecuted instantiation: listener.c:freq_ctr_remain_period Unexecuted instantiation: log.c:freq_ctr_remain_period Unexecuted instantiation: mailers.c:freq_ctr_remain_period Unexecuted instantiation: mworker.c:freq_ctr_remain_period Unexecuted instantiation: peers.c:freq_ctr_remain_period Unexecuted instantiation: pool.c:freq_ctr_remain_period Unexecuted instantiation: proto_rhttp.c:freq_ctr_remain_period Unexecuted instantiation: proto_sockpair.c:freq_ctr_remain_period Unexecuted instantiation: protocol.c:freq_ctr_remain_period Unexecuted instantiation: proxy.c:freq_ctr_remain_period Unexecuted instantiation: queue.c:freq_ctr_remain_period Unexecuted instantiation: regex.c:freq_ctr_remain_period Unexecuted instantiation: resolvers.c:freq_ctr_remain_period Unexecuted instantiation: ring.c:freq_ctr_remain_period Unexecuted instantiation: sample.c:freq_ctr_remain_period Unexecuted instantiation: server.c:freq_ctr_remain_period Unexecuted instantiation: session.c:freq_ctr_remain_period Unexecuted instantiation: signal.c:freq_ctr_remain_period Unexecuted instantiation: sink.c:freq_ctr_remain_period Unexecuted instantiation: sock.c:freq_ctr_remain_period Unexecuted instantiation: sock_inet.c:freq_ctr_remain_period Unexecuted instantiation: stats-html.c:freq_ctr_remain_period Unexecuted instantiation: stats.c:freq_ctr_remain_period Unexecuted instantiation: stconn.c:freq_ctr_remain_period Unexecuted instantiation: stick_table.c:freq_ctr_remain_period Unexecuted instantiation: stream.c:freq_ctr_remain_period Unexecuted instantiation: systemd.c:freq_ctr_remain_period Unexecuted instantiation: task.c:freq_ctr_remain_period Unexecuted instantiation: tcp_rules.c:freq_ctr_remain_period Unexecuted instantiation: tcpcheck.c:freq_ctr_remain_period Unexecuted instantiation: thread.c:freq_ctr_remain_period Unexecuted instantiation: tools.c:freq_ctr_remain_period Unexecuted instantiation: trace.c:freq_ctr_remain_period Unexecuted instantiation: vars.c:freq_ctr_remain_period Unexecuted instantiation: acl.c:freq_ctr_remain_period Unexecuted instantiation: action.c:freq_ctr_remain_period Unexecuted instantiation: activity.c:freq_ctr_remain_period Unexecuted instantiation: applet.c:freq_ctr_remain_period Unexecuted instantiation: arg.c:freq_ctr_remain_period Unexecuted instantiation: backend.c:freq_ctr_remain_period Unexecuted instantiation: cfgcond.c:freq_ctr_remain_period Unexecuted instantiation: cfgparse-global.c:freq_ctr_remain_period Unexecuted instantiation: cfgparse-listen.c:freq_ctr_remain_period Unexecuted instantiation: channel.c:freq_ctr_remain_period Unexecuted instantiation: check.c:freq_ctr_remain_period Unexecuted instantiation: chunk.c:freq_ctr_remain_period Unexecuted instantiation: compression.c:freq_ctr_remain_period Unexecuted instantiation: counters.c:freq_ctr_remain_period Unexecuted instantiation: dgram.c:freq_ctr_remain_period Unexecuted instantiation: dns.c:freq_ctr_remain_period Unexecuted instantiation: dns_ring.c:freq_ctr_remain_period Unexecuted instantiation: event_hdl.c:freq_ctr_remain_period Unexecuted instantiation: extcheck.c:freq_ctr_remain_period Unexecuted instantiation: filters.c:freq_ctr_remain_period Unexecuted instantiation: fix.c:freq_ctr_remain_period Unexecuted instantiation: flt_http_comp.c:freq_ctr_remain_period Unexecuted instantiation: freq_ctr.c:freq_ctr_remain_period Unexecuted instantiation: guid.c:freq_ctr_remain_period Unexecuted instantiation: h1.c:freq_ctr_remain_period Unexecuted instantiation: haterm.c:freq_ctr_remain_period Unexecuted instantiation: http.c:freq_ctr_remain_period Unexecuted instantiation: http_fetch.c:freq_ctr_remain_period Unexecuted instantiation: lb_chash.c:freq_ctr_remain_period Unexecuted instantiation: lb_fas.c:freq_ctr_remain_period Unexecuted instantiation: lb_fwlc.c:freq_ctr_remain_period Unexecuted instantiation: lb_fwrr.c:freq_ctr_remain_period Unexecuted instantiation: lb_map.c:freq_ctr_remain_period Unexecuted instantiation: mqtt.c:freq_ctr_remain_period Unexecuted instantiation: mux_spop.c:freq_ctr_remain_period Unexecuted instantiation: pattern.c:freq_ctr_remain_period Unexecuted instantiation: payload.c:freq_ctr_remain_period Unexecuted instantiation: pipe.c:freq_ctr_remain_period Unexecuted instantiation: proto_tcp.c:freq_ctr_remain_period Unexecuted instantiation: stats-file.c:freq_ctr_remain_period Unexecuted instantiation: stats-json.c:freq_ctr_remain_period Unexecuted instantiation: stats-proxy.c:freq_ctr_remain_period Unexecuted instantiation: cache.c:freq_ctr_remain_period Unexecuted instantiation: fcgi-app.c:freq_ctr_remain_period Unexecuted instantiation: flt_spoe.c:freq_ctr_remain_period Unexecuted instantiation: h1_htx.c:freq_ctr_remain_period Unexecuted instantiation: shctx.c:freq_ctr_remain_period |
146 | | |
147 | | /* returns the number of remaining events that can occur on this freq counter |
148 | | * while respecting <freq> and taking into account that <pend> events are |
149 | | * already known to be pending. Returns 0 if limit was reached. |
150 | | */ |
151 | | static inline unsigned int freq_ctr_remain(const struct freq_ctr *ctr, unsigned int freq, unsigned int pend) |
152 | 0 | { |
153 | 0 | return freq_ctr_remain_period(ctr, MS_TO_TICKS(1000), freq, pend); |
154 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:freq_ctr_remain Unexecuted instantiation: cfgparse.c:freq_ctr_remain Unexecuted instantiation: cli.c:freq_ctr_remain Unexecuted instantiation: clock.c:freq_ctr_remain Unexecuted instantiation: connection.c:freq_ctr_remain Unexecuted instantiation: debug.c:freq_ctr_remain Unexecuted instantiation: dynbuf.c:freq_ctr_remain Unexecuted instantiation: errors.c:freq_ctr_remain Unexecuted instantiation: fd.c:freq_ctr_remain Unexecuted instantiation: frontend.c:freq_ctr_remain Unexecuted instantiation: haproxy.c:freq_ctr_remain Unexecuted instantiation: http_ana.c:freq_ctr_remain Unexecuted instantiation: http_ext.c:freq_ctr_remain Unexecuted instantiation: http_htx.c:freq_ctr_remain Unexecuted instantiation: http_rules.c:freq_ctr_remain Unexecuted instantiation: htx.c:freq_ctr_remain Unexecuted instantiation: limits.c:freq_ctr_remain Unexecuted instantiation: listener.c:freq_ctr_remain Unexecuted instantiation: log.c:freq_ctr_remain Unexecuted instantiation: mailers.c:freq_ctr_remain Unexecuted instantiation: mworker.c:freq_ctr_remain Unexecuted instantiation: peers.c:freq_ctr_remain Unexecuted instantiation: pool.c:freq_ctr_remain Unexecuted instantiation: proto_rhttp.c:freq_ctr_remain Unexecuted instantiation: proto_sockpair.c:freq_ctr_remain Unexecuted instantiation: protocol.c:freq_ctr_remain Unexecuted instantiation: proxy.c:freq_ctr_remain Unexecuted instantiation: queue.c:freq_ctr_remain Unexecuted instantiation: regex.c:freq_ctr_remain Unexecuted instantiation: resolvers.c:freq_ctr_remain Unexecuted instantiation: ring.c:freq_ctr_remain Unexecuted instantiation: sample.c:freq_ctr_remain Unexecuted instantiation: server.c:freq_ctr_remain Unexecuted instantiation: session.c:freq_ctr_remain Unexecuted instantiation: signal.c:freq_ctr_remain Unexecuted instantiation: sink.c:freq_ctr_remain Unexecuted instantiation: sock.c:freq_ctr_remain Unexecuted instantiation: sock_inet.c:freq_ctr_remain Unexecuted instantiation: stats-html.c:freq_ctr_remain Unexecuted instantiation: stats.c:freq_ctr_remain Unexecuted instantiation: stconn.c:freq_ctr_remain Unexecuted instantiation: stick_table.c:freq_ctr_remain Unexecuted instantiation: stream.c:freq_ctr_remain Unexecuted instantiation: systemd.c:freq_ctr_remain Unexecuted instantiation: task.c:freq_ctr_remain Unexecuted instantiation: tcp_rules.c:freq_ctr_remain Unexecuted instantiation: tcpcheck.c:freq_ctr_remain Unexecuted instantiation: thread.c:freq_ctr_remain Unexecuted instantiation: tools.c:freq_ctr_remain Unexecuted instantiation: trace.c:freq_ctr_remain Unexecuted instantiation: vars.c:freq_ctr_remain Unexecuted instantiation: acl.c:freq_ctr_remain Unexecuted instantiation: action.c:freq_ctr_remain Unexecuted instantiation: activity.c:freq_ctr_remain Unexecuted instantiation: applet.c:freq_ctr_remain Unexecuted instantiation: arg.c:freq_ctr_remain Unexecuted instantiation: backend.c:freq_ctr_remain Unexecuted instantiation: cfgcond.c:freq_ctr_remain Unexecuted instantiation: cfgparse-global.c:freq_ctr_remain Unexecuted instantiation: cfgparse-listen.c:freq_ctr_remain Unexecuted instantiation: channel.c:freq_ctr_remain Unexecuted instantiation: check.c:freq_ctr_remain Unexecuted instantiation: chunk.c:freq_ctr_remain Unexecuted instantiation: compression.c:freq_ctr_remain Unexecuted instantiation: counters.c:freq_ctr_remain Unexecuted instantiation: dgram.c:freq_ctr_remain Unexecuted instantiation: dns.c:freq_ctr_remain Unexecuted instantiation: dns_ring.c:freq_ctr_remain Unexecuted instantiation: event_hdl.c:freq_ctr_remain Unexecuted instantiation: extcheck.c:freq_ctr_remain Unexecuted instantiation: filters.c:freq_ctr_remain Unexecuted instantiation: fix.c:freq_ctr_remain Unexecuted instantiation: flt_http_comp.c:freq_ctr_remain Unexecuted instantiation: freq_ctr.c:freq_ctr_remain Unexecuted instantiation: guid.c:freq_ctr_remain Unexecuted instantiation: h1.c:freq_ctr_remain Unexecuted instantiation: haterm.c:freq_ctr_remain Unexecuted instantiation: http.c:freq_ctr_remain Unexecuted instantiation: http_fetch.c:freq_ctr_remain Unexecuted instantiation: lb_chash.c:freq_ctr_remain Unexecuted instantiation: lb_fas.c:freq_ctr_remain Unexecuted instantiation: lb_fwlc.c:freq_ctr_remain Unexecuted instantiation: lb_fwrr.c:freq_ctr_remain Unexecuted instantiation: lb_map.c:freq_ctr_remain Unexecuted instantiation: mqtt.c:freq_ctr_remain Unexecuted instantiation: mux_spop.c:freq_ctr_remain Unexecuted instantiation: pattern.c:freq_ctr_remain Unexecuted instantiation: payload.c:freq_ctr_remain Unexecuted instantiation: pipe.c:freq_ctr_remain Unexecuted instantiation: proto_tcp.c:freq_ctr_remain Unexecuted instantiation: stats-file.c:freq_ctr_remain Unexecuted instantiation: stats-json.c:freq_ctr_remain Unexecuted instantiation: stats-proxy.c:freq_ctr_remain Unexecuted instantiation: cache.c:freq_ctr_remain Unexecuted instantiation: fcgi-app.c:freq_ctr_remain Unexecuted instantiation: flt_spoe.c:freq_ctr_remain Unexecuted instantiation: h1_htx.c:freq_ctr_remain Unexecuted instantiation: shctx.c:freq_ctr_remain |
155 | | |
156 | | /* return the expected wait time in ms before the next event may occur, |
157 | | * respecting frequency <freq>, and assuming there may already be some pending |
158 | | * events. It returns zero if we can proceed immediately, otherwise the wait |
159 | | * time, which will be rounded down 1ms for better accuracy, with a minimum |
160 | | * of one ms. |
161 | | */ |
162 | | static inline uint next_event_delay_period(const struct freq_ctr *ctr, uint period, uint freq, uint pend) |
163 | 0 | { |
164 | 0 | ullong total = freq_ctr_total(ctr, period, pend); |
165 | 0 | ullong limit = (ullong)freq * period; |
166 | 0 | uint wait; |
167 | |
|
168 | 0 | if (total < limit) |
169 | 0 | return 0; |
170 | | |
171 | | /* too many events already, let's count how long to wait before they're |
172 | | * processed. For this we'll subtract from the number of pending events |
173 | | * the ones programmed for the current period, to know how long to wait |
174 | | * for the next period. Each event takes period/freq ticks. |
175 | | */ |
176 | 0 | total -= limit; |
177 | 0 | wait = div64_32(total, (freq ? freq : 1)); |
178 | 0 | return MAX(wait, 1); |
179 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:next_event_delay_period Unexecuted instantiation: cfgparse.c:next_event_delay_period Unexecuted instantiation: cli.c:next_event_delay_period Unexecuted instantiation: clock.c:next_event_delay_period Unexecuted instantiation: connection.c:next_event_delay_period Unexecuted instantiation: debug.c:next_event_delay_period Unexecuted instantiation: dynbuf.c:next_event_delay_period Unexecuted instantiation: errors.c:next_event_delay_period Unexecuted instantiation: fd.c:next_event_delay_period Unexecuted instantiation: frontend.c:next_event_delay_period Unexecuted instantiation: haproxy.c:next_event_delay_period Unexecuted instantiation: http_ana.c:next_event_delay_period Unexecuted instantiation: http_ext.c:next_event_delay_period Unexecuted instantiation: http_htx.c:next_event_delay_period Unexecuted instantiation: http_rules.c:next_event_delay_period Unexecuted instantiation: htx.c:next_event_delay_period Unexecuted instantiation: limits.c:next_event_delay_period Unexecuted instantiation: listener.c:next_event_delay_period Unexecuted instantiation: log.c:next_event_delay_period Unexecuted instantiation: mailers.c:next_event_delay_period Unexecuted instantiation: mworker.c:next_event_delay_period Unexecuted instantiation: peers.c:next_event_delay_period Unexecuted instantiation: pool.c:next_event_delay_period Unexecuted instantiation: proto_rhttp.c:next_event_delay_period Unexecuted instantiation: proto_sockpair.c:next_event_delay_period Unexecuted instantiation: protocol.c:next_event_delay_period Unexecuted instantiation: proxy.c:next_event_delay_period Unexecuted instantiation: queue.c:next_event_delay_period Unexecuted instantiation: regex.c:next_event_delay_period Unexecuted instantiation: resolvers.c:next_event_delay_period Unexecuted instantiation: ring.c:next_event_delay_period Unexecuted instantiation: sample.c:next_event_delay_period Unexecuted instantiation: server.c:next_event_delay_period Unexecuted instantiation: session.c:next_event_delay_period Unexecuted instantiation: signal.c:next_event_delay_period Unexecuted instantiation: sink.c:next_event_delay_period Unexecuted instantiation: sock.c:next_event_delay_period Unexecuted instantiation: sock_inet.c:next_event_delay_period Unexecuted instantiation: stats-html.c:next_event_delay_period Unexecuted instantiation: stats.c:next_event_delay_period Unexecuted instantiation: stconn.c:next_event_delay_period Unexecuted instantiation: stick_table.c:next_event_delay_period Unexecuted instantiation: stream.c:next_event_delay_period Unexecuted instantiation: systemd.c:next_event_delay_period Unexecuted instantiation: task.c:next_event_delay_period Unexecuted instantiation: tcp_rules.c:next_event_delay_period Unexecuted instantiation: tcpcheck.c:next_event_delay_period Unexecuted instantiation: thread.c:next_event_delay_period Unexecuted instantiation: tools.c:next_event_delay_period Unexecuted instantiation: trace.c:next_event_delay_period Unexecuted instantiation: vars.c:next_event_delay_period Unexecuted instantiation: acl.c:next_event_delay_period Unexecuted instantiation: action.c:next_event_delay_period Unexecuted instantiation: activity.c:next_event_delay_period Unexecuted instantiation: applet.c:next_event_delay_period Unexecuted instantiation: arg.c:next_event_delay_period Unexecuted instantiation: backend.c:next_event_delay_period Unexecuted instantiation: cfgcond.c:next_event_delay_period Unexecuted instantiation: cfgparse-global.c:next_event_delay_period Unexecuted instantiation: cfgparse-listen.c:next_event_delay_period Unexecuted instantiation: channel.c:next_event_delay_period Unexecuted instantiation: check.c:next_event_delay_period Unexecuted instantiation: chunk.c:next_event_delay_period Unexecuted instantiation: compression.c:next_event_delay_period Unexecuted instantiation: counters.c:next_event_delay_period Unexecuted instantiation: dgram.c:next_event_delay_period Unexecuted instantiation: dns.c:next_event_delay_period Unexecuted instantiation: dns_ring.c:next_event_delay_period Unexecuted instantiation: event_hdl.c:next_event_delay_period Unexecuted instantiation: extcheck.c:next_event_delay_period Unexecuted instantiation: filters.c:next_event_delay_period Unexecuted instantiation: fix.c:next_event_delay_period Unexecuted instantiation: flt_http_comp.c:next_event_delay_period Unexecuted instantiation: freq_ctr.c:next_event_delay_period Unexecuted instantiation: guid.c:next_event_delay_period Unexecuted instantiation: h1.c:next_event_delay_period Unexecuted instantiation: haterm.c:next_event_delay_period Unexecuted instantiation: http.c:next_event_delay_period Unexecuted instantiation: http_fetch.c:next_event_delay_period Unexecuted instantiation: lb_chash.c:next_event_delay_period Unexecuted instantiation: lb_fas.c:next_event_delay_period Unexecuted instantiation: lb_fwlc.c:next_event_delay_period Unexecuted instantiation: lb_fwrr.c:next_event_delay_period Unexecuted instantiation: lb_map.c:next_event_delay_period Unexecuted instantiation: mqtt.c:next_event_delay_period Unexecuted instantiation: mux_spop.c:next_event_delay_period Unexecuted instantiation: pattern.c:next_event_delay_period Unexecuted instantiation: payload.c:next_event_delay_period Unexecuted instantiation: pipe.c:next_event_delay_period Unexecuted instantiation: proto_tcp.c:next_event_delay_period Unexecuted instantiation: stats-file.c:next_event_delay_period Unexecuted instantiation: stats-json.c:next_event_delay_period Unexecuted instantiation: stats-proxy.c:next_event_delay_period Unexecuted instantiation: cache.c:next_event_delay_period Unexecuted instantiation: fcgi-app.c:next_event_delay_period Unexecuted instantiation: flt_spoe.c:next_event_delay_period Unexecuted instantiation: h1_htx.c:next_event_delay_period Unexecuted instantiation: shctx.c:next_event_delay_period |
180 | | |
181 | | /* Returns the expected wait time in ms before the next event may occur, |
182 | | * respecting frequency <freq> over 1 second, and assuming there may already be |
183 | | * some pending events. It returns zero if we can proceed immediately, otherwise |
184 | | * the wait time, which will be rounded down 1ms for better accuracy, with a |
185 | | * minimum of one ms. |
186 | | */ |
187 | | static inline unsigned int next_event_delay(const struct freq_ctr *ctr, unsigned int freq, unsigned int pend) |
188 | 0 | { |
189 | 0 | return next_event_delay_period(ctr, MS_TO_TICKS(1000), freq, pend); |
190 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:next_event_delay Unexecuted instantiation: cfgparse.c:next_event_delay Unexecuted instantiation: cli.c:next_event_delay Unexecuted instantiation: clock.c:next_event_delay Unexecuted instantiation: connection.c:next_event_delay Unexecuted instantiation: debug.c:next_event_delay Unexecuted instantiation: dynbuf.c:next_event_delay Unexecuted instantiation: errors.c:next_event_delay Unexecuted instantiation: fd.c:next_event_delay Unexecuted instantiation: frontend.c:next_event_delay Unexecuted instantiation: haproxy.c:next_event_delay Unexecuted instantiation: http_ana.c:next_event_delay Unexecuted instantiation: http_ext.c:next_event_delay Unexecuted instantiation: http_htx.c:next_event_delay Unexecuted instantiation: http_rules.c:next_event_delay Unexecuted instantiation: htx.c:next_event_delay Unexecuted instantiation: limits.c:next_event_delay Unexecuted instantiation: listener.c:next_event_delay Unexecuted instantiation: log.c:next_event_delay Unexecuted instantiation: mailers.c:next_event_delay Unexecuted instantiation: mworker.c:next_event_delay Unexecuted instantiation: peers.c:next_event_delay Unexecuted instantiation: pool.c:next_event_delay Unexecuted instantiation: proto_rhttp.c:next_event_delay Unexecuted instantiation: proto_sockpair.c:next_event_delay Unexecuted instantiation: protocol.c:next_event_delay Unexecuted instantiation: proxy.c:next_event_delay Unexecuted instantiation: queue.c:next_event_delay Unexecuted instantiation: regex.c:next_event_delay Unexecuted instantiation: resolvers.c:next_event_delay Unexecuted instantiation: ring.c:next_event_delay Unexecuted instantiation: sample.c:next_event_delay Unexecuted instantiation: server.c:next_event_delay Unexecuted instantiation: session.c:next_event_delay Unexecuted instantiation: signal.c:next_event_delay Unexecuted instantiation: sink.c:next_event_delay Unexecuted instantiation: sock.c:next_event_delay Unexecuted instantiation: sock_inet.c:next_event_delay Unexecuted instantiation: stats-html.c:next_event_delay Unexecuted instantiation: stats.c:next_event_delay Unexecuted instantiation: stconn.c:next_event_delay Unexecuted instantiation: stick_table.c:next_event_delay Unexecuted instantiation: stream.c:next_event_delay Unexecuted instantiation: systemd.c:next_event_delay Unexecuted instantiation: task.c:next_event_delay Unexecuted instantiation: tcp_rules.c:next_event_delay Unexecuted instantiation: tcpcheck.c:next_event_delay Unexecuted instantiation: thread.c:next_event_delay Unexecuted instantiation: tools.c:next_event_delay Unexecuted instantiation: trace.c:next_event_delay Unexecuted instantiation: vars.c:next_event_delay Unexecuted instantiation: acl.c:next_event_delay Unexecuted instantiation: action.c:next_event_delay Unexecuted instantiation: activity.c:next_event_delay Unexecuted instantiation: applet.c:next_event_delay Unexecuted instantiation: arg.c:next_event_delay Unexecuted instantiation: backend.c:next_event_delay Unexecuted instantiation: cfgcond.c:next_event_delay Unexecuted instantiation: cfgparse-global.c:next_event_delay Unexecuted instantiation: cfgparse-listen.c:next_event_delay Unexecuted instantiation: channel.c:next_event_delay Unexecuted instantiation: check.c:next_event_delay Unexecuted instantiation: chunk.c:next_event_delay Unexecuted instantiation: compression.c:next_event_delay Unexecuted instantiation: counters.c:next_event_delay Unexecuted instantiation: dgram.c:next_event_delay Unexecuted instantiation: dns.c:next_event_delay Unexecuted instantiation: dns_ring.c:next_event_delay Unexecuted instantiation: event_hdl.c:next_event_delay Unexecuted instantiation: extcheck.c:next_event_delay Unexecuted instantiation: filters.c:next_event_delay Unexecuted instantiation: fix.c:next_event_delay Unexecuted instantiation: flt_http_comp.c:next_event_delay Unexecuted instantiation: freq_ctr.c:next_event_delay Unexecuted instantiation: guid.c:next_event_delay Unexecuted instantiation: h1.c:next_event_delay Unexecuted instantiation: haterm.c:next_event_delay Unexecuted instantiation: http.c:next_event_delay Unexecuted instantiation: http_fetch.c:next_event_delay Unexecuted instantiation: lb_chash.c:next_event_delay Unexecuted instantiation: lb_fas.c:next_event_delay Unexecuted instantiation: lb_fwlc.c:next_event_delay Unexecuted instantiation: lb_fwrr.c:next_event_delay Unexecuted instantiation: lb_map.c:next_event_delay Unexecuted instantiation: mqtt.c:next_event_delay Unexecuted instantiation: mux_spop.c:next_event_delay Unexecuted instantiation: pattern.c:next_event_delay Unexecuted instantiation: payload.c:next_event_delay Unexecuted instantiation: pipe.c:next_event_delay Unexecuted instantiation: proto_tcp.c:next_event_delay Unexecuted instantiation: stats-file.c:next_event_delay Unexecuted instantiation: stats-json.c:next_event_delay Unexecuted instantiation: stats-proxy.c:next_event_delay Unexecuted instantiation: cache.c:next_event_delay Unexecuted instantiation: fcgi-app.c:next_event_delay Unexecuted instantiation: flt_spoe.c:next_event_delay Unexecuted instantiation: h1_htx.c:next_event_delay Unexecuted instantiation: shctx.c:next_event_delay |
191 | | |
192 | | /* While the functions above report average event counts per period, we are |
193 | | * also interested in average values per event. For this we use a different |
194 | | * method. The principle is to rely on a long tail which sums the new value |
195 | | * with a fraction of the previous value, resulting in a sliding window of |
196 | | * infinite length depending on the precision we're interested in. |
197 | | * |
198 | | * The idea is that we always keep (N-1)/N of the sum and add the new sampled |
199 | | * value. The sum over N values can be computed with a simple program for a |
200 | | * constant value 1 at each iteration : |
201 | | * |
202 | | * N |
203 | | * ,--- |
204 | | * \ N - 1 e - 1 |
205 | | * > ( --------- )^x ~= N * ----- |
206 | | * / N e |
207 | | * '--- |
208 | | * x = 1 |
209 | | * |
210 | | * Note: I'm not sure how to demonstrate this but at least this is easily |
211 | | * verified with a simple program, the sum equals N * 0.632120 for any N |
212 | | * moderately large (tens to hundreds). |
213 | | * |
214 | | * Inserting a constant sample value V here simply results in : |
215 | | * |
216 | | * sum = V * N * (e - 1) / e |
217 | | * |
218 | | * But we don't want to integrate over a small period, but infinitely. Let's |
219 | | * cut the infinity in P periods of N values. Each period M is exactly the same |
220 | | * as period M-1 with a factor of ((N-1)/N)^N applied. A test shows that given a |
221 | | * large N : |
222 | | * |
223 | | * N - 1 1 |
224 | | * ( ------- )^N ~= --- |
225 | | * N e |
226 | | * |
227 | | * Our sum is now a sum of each factor times : |
228 | | * |
229 | | * N*P P |
230 | | * ,--- ,--- |
231 | | * \ N - 1 e - 1 \ 1 |
232 | | * > v ( --------- )^x ~= VN * ----- * > --- |
233 | | * / N e / e^x |
234 | | * '--- '--- |
235 | | * x = 1 x = 0 |
236 | | * |
237 | | * For P "large enough", in tests we get this : |
238 | | * |
239 | | * P |
240 | | * ,--- |
241 | | * \ 1 e |
242 | | * > --- ~= ----- |
243 | | * / e^x e - 1 |
244 | | * '--- |
245 | | * x = 0 |
246 | | * |
247 | | * This simplifies the sum above : |
248 | | * |
249 | | * N*P |
250 | | * ,--- |
251 | | * \ N - 1 |
252 | | * > v ( --------- )^x = VN |
253 | | * / N |
254 | | * '--- |
255 | | * x = 1 |
256 | | * |
257 | | * So basically by summing values and applying the last result an (N-1)/N factor |
258 | | * we just get N times the values over the long term, so we can recover the |
259 | | * constant value V by dividing by N. In order to limit the impact of integer |
260 | | * overflows, we'll use this equivalence which saves us one multiply : |
261 | | * |
262 | | * N - 1 1 x0 |
263 | | * x1 = x0 * ------- = x0 * ( 1 - --- ) = x0 - ---- |
264 | | * N N N |
265 | | * |
266 | | * And given that x0 is discrete here we'll have to saturate the values before |
267 | | * performing the divide, so the value insertion will become : |
268 | | * |
269 | | * x0 + N - 1 |
270 | | * x1 = x0 - ------------ |
271 | | * N |
272 | | * |
273 | | * A value added at the entry of the sliding window of N values will thus be |
274 | | * reduced to 1/e or 36.7% after N terms have been added. After a second batch, |
275 | | * it will only be 1/e^2, or 13.5%, and so on. So practically speaking, each |
276 | | * old period of N values represents only a quickly fading ratio of the global |
277 | | * sum : |
278 | | * |
279 | | * period ratio |
280 | | * 1 36.7% |
281 | | * 2 13.5% |
282 | | * 3 4.98% |
283 | | * 4 1.83% |
284 | | * 5 0.67% |
285 | | * 6 0.25% |
286 | | * 7 0.09% |
287 | | * 8 0.033% |
288 | | * 9 0.012% |
289 | | * 10 0.0045% |
290 | | * |
291 | | * So after 10N samples, the initial value has already faded out by a factor of |
292 | | * 22026, which is quite fast. If the sliding window is 1024 samples wide, it |
293 | | * means that a sample will only count for 1/22k of its initial value after 10k |
294 | | * samples went after it, which results in half of the value it would represent |
295 | | * using an arithmetic mean. The benefit of this method is that it's very cheap |
296 | | * in terms of computations when N is a power of two. This is very well suited |
297 | | * to record response times as large values will fade out faster than with an |
298 | | * arithmetic mean and will depend on sample count and not time. |
299 | | * |
300 | | * Demonstrating all the above assumptions with maths instead of a program is |
301 | | * left as an exercise for the reader. |
302 | | */ |
303 | | |
304 | | /* Adds sample value <v> to sliding window sum <sum> configured for <n> samples. |
305 | | * The sample is returned. Better if <n> is a power of two. This function is |
306 | | * thread-safe. |
307 | | */ |
308 | | static inline unsigned int swrate_add(unsigned int *sum, unsigned int n, unsigned int v) |
309 | 0 | { |
310 | 0 | unsigned int new_sum, old_sum; |
311 | |
|
312 | 0 | old_sum = *sum; |
313 | 0 | do { |
314 | 0 | new_sum = old_sum - (old_sum + n - 1) / n + v; |
315 | 0 | } while (!HA_ATOMIC_CAS(sum, &old_sum, new_sum) && __ha_cpu_relax()); |
316 | 0 | return new_sum; |
317 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:swrate_add Unexecuted instantiation: cfgparse.c:swrate_add Unexecuted instantiation: cli.c:swrate_add Unexecuted instantiation: clock.c:swrate_add Unexecuted instantiation: connection.c:swrate_add Unexecuted instantiation: debug.c:swrate_add Unexecuted instantiation: dynbuf.c:swrate_add Unexecuted instantiation: errors.c:swrate_add Unexecuted instantiation: fd.c:swrate_add Unexecuted instantiation: frontend.c:swrate_add Unexecuted instantiation: haproxy.c:swrate_add Unexecuted instantiation: http_ana.c:swrate_add Unexecuted instantiation: http_ext.c:swrate_add Unexecuted instantiation: http_htx.c:swrate_add Unexecuted instantiation: http_rules.c:swrate_add Unexecuted instantiation: htx.c:swrate_add Unexecuted instantiation: limits.c:swrate_add Unexecuted instantiation: listener.c:swrate_add Unexecuted instantiation: log.c:swrate_add Unexecuted instantiation: mailers.c:swrate_add Unexecuted instantiation: mworker.c:swrate_add Unexecuted instantiation: peers.c:swrate_add Unexecuted instantiation: pool.c:swrate_add Unexecuted instantiation: proto_rhttp.c:swrate_add Unexecuted instantiation: proto_sockpair.c:swrate_add Unexecuted instantiation: protocol.c:swrate_add Unexecuted instantiation: proxy.c:swrate_add Unexecuted instantiation: queue.c:swrate_add Unexecuted instantiation: regex.c:swrate_add Unexecuted instantiation: resolvers.c:swrate_add Unexecuted instantiation: ring.c:swrate_add Unexecuted instantiation: sample.c:swrate_add Unexecuted instantiation: server.c:swrate_add Unexecuted instantiation: session.c:swrate_add Unexecuted instantiation: signal.c:swrate_add Unexecuted instantiation: sink.c:swrate_add Unexecuted instantiation: sock.c:swrate_add Unexecuted instantiation: sock_inet.c:swrate_add Unexecuted instantiation: stats-html.c:swrate_add Unexecuted instantiation: stats.c:swrate_add Unexecuted instantiation: stconn.c:swrate_add Unexecuted instantiation: stick_table.c:swrate_add Unexecuted instantiation: stream.c:swrate_add Unexecuted instantiation: systemd.c:swrate_add Unexecuted instantiation: task.c:swrate_add Unexecuted instantiation: tcp_rules.c:swrate_add Unexecuted instantiation: tcpcheck.c:swrate_add Unexecuted instantiation: thread.c:swrate_add Unexecuted instantiation: tools.c:swrate_add Unexecuted instantiation: trace.c:swrate_add Unexecuted instantiation: vars.c:swrate_add Unexecuted instantiation: acl.c:swrate_add Unexecuted instantiation: action.c:swrate_add Unexecuted instantiation: activity.c:swrate_add Unexecuted instantiation: applet.c:swrate_add Unexecuted instantiation: arg.c:swrate_add Unexecuted instantiation: backend.c:swrate_add Unexecuted instantiation: cfgcond.c:swrate_add Unexecuted instantiation: cfgparse-global.c:swrate_add Unexecuted instantiation: cfgparse-listen.c:swrate_add Unexecuted instantiation: channel.c:swrate_add Unexecuted instantiation: check.c:swrate_add Unexecuted instantiation: chunk.c:swrate_add Unexecuted instantiation: compression.c:swrate_add Unexecuted instantiation: counters.c:swrate_add Unexecuted instantiation: dgram.c:swrate_add Unexecuted instantiation: dns.c:swrate_add Unexecuted instantiation: dns_ring.c:swrate_add Unexecuted instantiation: event_hdl.c:swrate_add Unexecuted instantiation: extcheck.c:swrate_add Unexecuted instantiation: filters.c:swrate_add Unexecuted instantiation: fix.c:swrate_add Unexecuted instantiation: flt_http_comp.c:swrate_add Unexecuted instantiation: freq_ctr.c:swrate_add Unexecuted instantiation: guid.c:swrate_add Unexecuted instantiation: h1.c:swrate_add Unexecuted instantiation: haterm.c:swrate_add Unexecuted instantiation: http.c:swrate_add Unexecuted instantiation: http_fetch.c:swrate_add Unexecuted instantiation: lb_chash.c:swrate_add Unexecuted instantiation: lb_fas.c:swrate_add Unexecuted instantiation: lb_fwlc.c:swrate_add Unexecuted instantiation: lb_fwrr.c:swrate_add Unexecuted instantiation: lb_map.c:swrate_add Unexecuted instantiation: mqtt.c:swrate_add Unexecuted instantiation: mux_spop.c:swrate_add Unexecuted instantiation: pattern.c:swrate_add Unexecuted instantiation: payload.c:swrate_add Unexecuted instantiation: pipe.c:swrate_add Unexecuted instantiation: proto_tcp.c:swrate_add Unexecuted instantiation: stats-file.c:swrate_add Unexecuted instantiation: stats-json.c:swrate_add Unexecuted instantiation: stats-proxy.c:swrate_add Unexecuted instantiation: cache.c:swrate_add Unexecuted instantiation: fcgi-app.c:swrate_add Unexecuted instantiation: flt_spoe.c:swrate_add Unexecuted instantiation: h1_htx.c:swrate_add Unexecuted instantiation: shctx.c:swrate_add |
318 | | |
319 | | /* Adds sample value <v> to sliding window sum <sum> configured for <n> samples. |
320 | | * The sample is returned. Better if <n> is a power of two. This function is |
321 | | * thread-safe. |
322 | | * This function should give better accuracy than swrate_add when number of |
323 | | * samples collected is lower than nominal window size. In such circumstances |
324 | | * <n> should be set to 0. |
325 | | */ |
326 | | static inline unsigned int swrate_add_dynamic(unsigned int *sum, unsigned int n, unsigned int v) |
327 | 0 | { |
328 | 0 | unsigned int new_sum, old_sum; |
329 | |
|
330 | 0 | old_sum = *sum; |
331 | 0 | do { |
332 | 0 | new_sum = old_sum - (n ? (old_sum + n - 1) / n : 0) + v; |
333 | 0 | } while (!HA_ATOMIC_CAS(sum, &old_sum, new_sum) && __ha_cpu_relax()); |
334 | 0 | return new_sum; |
335 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:swrate_add_dynamic Unexecuted instantiation: cfgparse.c:swrate_add_dynamic Unexecuted instantiation: cli.c:swrate_add_dynamic Unexecuted instantiation: clock.c:swrate_add_dynamic Unexecuted instantiation: connection.c:swrate_add_dynamic Unexecuted instantiation: debug.c:swrate_add_dynamic Unexecuted instantiation: dynbuf.c:swrate_add_dynamic Unexecuted instantiation: errors.c:swrate_add_dynamic Unexecuted instantiation: fd.c:swrate_add_dynamic Unexecuted instantiation: frontend.c:swrate_add_dynamic Unexecuted instantiation: haproxy.c:swrate_add_dynamic Unexecuted instantiation: http_ana.c:swrate_add_dynamic Unexecuted instantiation: http_ext.c:swrate_add_dynamic Unexecuted instantiation: http_htx.c:swrate_add_dynamic Unexecuted instantiation: http_rules.c:swrate_add_dynamic Unexecuted instantiation: htx.c:swrate_add_dynamic Unexecuted instantiation: limits.c:swrate_add_dynamic Unexecuted instantiation: listener.c:swrate_add_dynamic Unexecuted instantiation: log.c:swrate_add_dynamic Unexecuted instantiation: mailers.c:swrate_add_dynamic Unexecuted instantiation: mworker.c:swrate_add_dynamic Unexecuted instantiation: peers.c:swrate_add_dynamic Unexecuted instantiation: pool.c:swrate_add_dynamic Unexecuted instantiation: proto_rhttp.c:swrate_add_dynamic Unexecuted instantiation: proto_sockpair.c:swrate_add_dynamic Unexecuted instantiation: protocol.c:swrate_add_dynamic Unexecuted instantiation: proxy.c:swrate_add_dynamic Unexecuted instantiation: queue.c:swrate_add_dynamic Unexecuted instantiation: regex.c:swrate_add_dynamic Unexecuted instantiation: resolvers.c:swrate_add_dynamic Unexecuted instantiation: ring.c:swrate_add_dynamic Unexecuted instantiation: sample.c:swrate_add_dynamic Unexecuted instantiation: server.c:swrate_add_dynamic Unexecuted instantiation: session.c:swrate_add_dynamic Unexecuted instantiation: signal.c:swrate_add_dynamic Unexecuted instantiation: sink.c:swrate_add_dynamic Unexecuted instantiation: sock.c:swrate_add_dynamic Unexecuted instantiation: sock_inet.c:swrate_add_dynamic Unexecuted instantiation: stats-html.c:swrate_add_dynamic Unexecuted instantiation: stats.c:swrate_add_dynamic Unexecuted instantiation: stconn.c:swrate_add_dynamic Unexecuted instantiation: stick_table.c:swrate_add_dynamic Unexecuted instantiation: stream.c:swrate_add_dynamic Unexecuted instantiation: systemd.c:swrate_add_dynamic Unexecuted instantiation: task.c:swrate_add_dynamic Unexecuted instantiation: tcp_rules.c:swrate_add_dynamic Unexecuted instantiation: tcpcheck.c:swrate_add_dynamic Unexecuted instantiation: thread.c:swrate_add_dynamic Unexecuted instantiation: tools.c:swrate_add_dynamic Unexecuted instantiation: trace.c:swrate_add_dynamic Unexecuted instantiation: vars.c:swrate_add_dynamic Unexecuted instantiation: acl.c:swrate_add_dynamic Unexecuted instantiation: action.c:swrate_add_dynamic Unexecuted instantiation: activity.c:swrate_add_dynamic Unexecuted instantiation: applet.c:swrate_add_dynamic Unexecuted instantiation: arg.c:swrate_add_dynamic Unexecuted instantiation: backend.c:swrate_add_dynamic Unexecuted instantiation: cfgcond.c:swrate_add_dynamic Unexecuted instantiation: cfgparse-global.c:swrate_add_dynamic Unexecuted instantiation: cfgparse-listen.c:swrate_add_dynamic Unexecuted instantiation: channel.c:swrate_add_dynamic Unexecuted instantiation: check.c:swrate_add_dynamic Unexecuted instantiation: chunk.c:swrate_add_dynamic Unexecuted instantiation: compression.c:swrate_add_dynamic Unexecuted instantiation: counters.c:swrate_add_dynamic Unexecuted instantiation: dgram.c:swrate_add_dynamic Unexecuted instantiation: dns.c:swrate_add_dynamic Unexecuted instantiation: dns_ring.c:swrate_add_dynamic Unexecuted instantiation: event_hdl.c:swrate_add_dynamic Unexecuted instantiation: extcheck.c:swrate_add_dynamic Unexecuted instantiation: filters.c:swrate_add_dynamic Unexecuted instantiation: fix.c:swrate_add_dynamic Unexecuted instantiation: flt_http_comp.c:swrate_add_dynamic Unexecuted instantiation: freq_ctr.c:swrate_add_dynamic Unexecuted instantiation: guid.c:swrate_add_dynamic Unexecuted instantiation: h1.c:swrate_add_dynamic Unexecuted instantiation: haterm.c:swrate_add_dynamic Unexecuted instantiation: http.c:swrate_add_dynamic Unexecuted instantiation: http_fetch.c:swrate_add_dynamic Unexecuted instantiation: lb_chash.c:swrate_add_dynamic Unexecuted instantiation: lb_fas.c:swrate_add_dynamic Unexecuted instantiation: lb_fwlc.c:swrate_add_dynamic Unexecuted instantiation: lb_fwrr.c:swrate_add_dynamic Unexecuted instantiation: lb_map.c:swrate_add_dynamic Unexecuted instantiation: mqtt.c:swrate_add_dynamic Unexecuted instantiation: mux_spop.c:swrate_add_dynamic Unexecuted instantiation: pattern.c:swrate_add_dynamic Unexecuted instantiation: payload.c:swrate_add_dynamic Unexecuted instantiation: pipe.c:swrate_add_dynamic Unexecuted instantiation: proto_tcp.c:swrate_add_dynamic Unexecuted instantiation: stats-file.c:swrate_add_dynamic Unexecuted instantiation: stats-json.c:swrate_add_dynamic Unexecuted instantiation: stats-proxy.c:swrate_add_dynamic Unexecuted instantiation: cache.c:swrate_add_dynamic Unexecuted instantiation: fcgi-app.c:swrate_add_dynamic Unexecuted instantiation: flt_spoe.c:swrate_add_dynamic Unexecuted instantiation: h1_htx.c:swrate_add_dynamic Unexecuted instantiation: shctx.c:swrate_add_dynamic |
336 | | |
337 | | /* Adds sample value <v> spanning <s> samples to sliding window sum <sum> |
338 | | * configured for <n> samples, where <n> is supposed to be "much larger" than |
339 | | * <s>. The sample is returned. Better if <n> is a power of two. Note that this |
340 | | * is only an approximate. Indeed, as can be seen with two samples only over a |
341 | | * 8-sample window, the original function would return : |
342 | | * sum1 = sum - (sum + 7) / 8 + v |
343 | | * sum2 = sum1 - (sum1 + 7) / 8 + v |
344 | | * = (sum - (sum + 7) / 8 + v) - (sum - (sum + 7) / 8 + v + 7) / 8 + v |
345 | | * ~= 7sum/8 - 7/8 + v - sum/8 + sum/64 - 7/64 - v/8 - 7/8 + v |
346 | | * ~= (3sum/4 + sum/64) - (7/4 + 7/64) + 15v/8 |
347 | | * |
348 | | * while the function below would return : |
349 | | * sum = sum + 2*v - (sum + 8) * 2 / 8 |
350 | | * = 3sum/4 + 2v - 2 |
351 | | * |
352 | | * this presents an error of ~ (sum/64 + 9/64 + v/8) = (sum+n+1)/(n^s) + v/n |
353 | | * |
354 | | * Thus the simplified function effectively replaces a part of the history with |
355 | | * a linear sum instead of applying the exponential one. But as long as s/n is |
356 | | * "small enough", the error fades away and remains small for both small and |
357 | | * large values of n and s (typically < 0.2% measured). This function is |
358 | | * thread-safe. |
359 | | */ |
360 | | static inline unsigned int swrate_add_scaled(unsigned int *sum, unsigned int n, unsigned int v, unsigned int s) |
361 | 0 | { |
362 | 0 | unsigned int new_sum, old_sum; |
363 | 0 |
|
364 | 0 | old_sum = *sum; |
365 | 0 | do { |
366 | 0 | new_sum = old_sum + v * s - div64_32((unsigned long long)old_sum * s + n - 1, n); |
367 | 0 | } while (!HA_ATOMIC_CAS(sum, &old_sum, new_sum) && __ha_cpu_relax()); |
368 | 0 | return new_sum; |
369 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:swrate_add_scaled Unexecuted instantiation: cfgparse.c:swrate_add_scaled Unexecuted instantiation: cli.c:swrate_add_scaled Unexecuted instantiation: clock.c:swrate_add_scaled Unexecuted instantiation: connection.c:swrate_add_scaled Unexecuted instantiation: debug.c:swrate_add_scaled Unexecuted instantiation: dynbuf.c:swrate_add_scaled Unexecuted instantiation: errors.c:swrate_add_scaled Unexecuted instantiation: fd.c:swrate_add_scaled Unexecuted instantiation: frontend.c:swrate_add_scaled Unexecuted instantiation: haproxy.c:swrate_add_scaled Unexecuted instantiation: http_ana.c:swrate_add_scaled Unexecuted instantiation: http_ext.c:swrate_add_scaled Unexecuted instantiation: http_htx.c:swrate_add_scaled Unexecuted instantiation: http_rules.c:swrate_add_scaled Unexecuted instantiation: htx.c:swrate_add_scaled Unexecuted instantiation: limits.c:swrate_add_scaled Unexecuted instantiation: listener.c:swrate_add_scaled Unexecuted instantiation: log.c:swrate_add_scaled Unexecuted instantiation: mailers.c:swrate_add_scaled Unexecuted instantiation: mworker.c:swrate_add_scaled Unexecuted instantiation: peers.c:swrate_add_scaled Unexecuted instantiation: pool.c:swrate_add_scaled Unexecuted instantiation: proto_rhttp.c:swrate_add_scaled Unexecuted instantiation: proto_sockpair.c:swrate_add_scaled Unexecuted instantiation: protocol.c:swrate_add_scaled Unexecuted instantiation: proxy.c:swrate_add_scaled Unexecuted instantiation: queue.c:swrate_add_scaled Unexecuted instantiation: regex.c:swrate_add_scaled Unexecuted instantiation: resolvers.c:swrate_add_scaled Unexecuted instantiation: ring.c:swrate_add_scaled Unexecuted instantiation: sample.c:swrate_add_scaled Unexecuted instantiation: server.c:swrate_add_scaled Unexecuted instantiation: session.c:swrate_add_scaled Unexecuted instantiation: signal.c:swrate_add_scaled Unexecuted instantiation: sink.c:swrate_add_scaled Unexecuted instantiation: sock.c:swrate_add_scaled Unexecuted instantiation: sock_inet.c:swrate_add_scaled Unexecuted instantiation: stats-html.c:swrate_add_scaled Unexecuted instantiation: stats.c:swrate_add_scaled Unexecuted instantiation: stconn.c:swrate_add_scaled Unexecuted instantiation: stick_table.c:swrate_add_scaled Unexecuted instantiation: stream.c:swrate_add_scaled Unexecuted instantiation: systemd.c:swrate_add_scaled Unexecuted instantiation: task.c:swrate_add_scaled Unexecuted instantiation: tcp_rules.c:swrate_add_scaled Unexecuted instantiation: tcpcheck.c:swrate_add_scaled Unexecuted instantiation: thread.c:swrate_add_scaled Unexecuted instantiation: tools.c:swrate_add_scaled Unexecuted instantiation: trace.c:swrate_add_scaled Unexecuted instantiation: vars.c:swrate_add_scaled Unexecuted instantiation: acl.c:swrate_add_scaled Unexecuted instantiation: action.c:swrate_add_scaled Unexecuted instantiation: activity.c:swrate_add_scaled Unexecuted instantiation: applet.c:swrate_add_scaled Unexecuted instantiation: arg.c:swrate_add_scaled Unexecuted instantiation: backend.c:swrate_add_scaled Unexecuted instantiation: cfgcond.c:swrate_add_scaled Unexecuted instantiation: cfgparse-global.c:swrate_add_scaled Unexecuted instantiation: cfgparse-listen.c:swrate_add_scaled Unexecuted instantiation: channel.c:swrate_add_scaled Unexecuted instantiation: check.c:swrate_add_scaled Unexecuted instantiation: chunk.c:swrate_add_scaled Unexecuted instantiation: compression.c:swrate_add_scaled Unexecuted instantiation: counters.c:swrate_add_scaled Unexecuted instantiation: dgram.c:swrate_add_scaled Unexecuted instantiation: dns.c:swrate_add_scaled Unexecuted instantiation: dns_ring.c:swrate_add_scaled Unexecuted instantiation: event_hdl.c:swrate_add_scaled Unexecuted instantiation: extcheck.c:swrate_add_scaled Unexecuted instantiation: filters.c:swrate_add_scaled Unexecuted instantiation: fix.c:swrate_add_scaled Unexecuted instantiation: flt_http_comp.c:swrate_add_scaled Unexecuted instantiation: freq_ctr.c:swrate_add_scaled Unexecuted instantiation: guid.c:swrate_add_scaled Unexecuted instantiation: h1.c:swrate_add_scaled Unexecuted instantiation: haterm.c:swrate_add_scaled Unexecuted instantiation: http.c:swrate_add_scaled Unexecuted instantiation: http_fetch.c:swrate_add_scaled Unexecuted instantiation: lb_chash.c:swrate_add_scaled Unexecuted instantiation: lb_fas.c:swrate_add_scaled Unexecuted instantiation: lb_fwlc.c:swrate_add_scaled Unexecuted instantiation: lb_fwrr.c:swrate_add_scaled Unexecuted instantiation: lb_map.c:swrate_add_scaled Unexecuted instantiation: mqtt.c:swrate_add_scaled Unexecuted instantiation: mux_spop.c:swrate_add_scaled Unexecuted instantiation: pattern.c:swrate_add_scaled Unexecuted instantiation: payload.c:swrate_add_scaled Unexecuted instantiation: pipe.c:swrate_add_scaled Unexecuted instantiation: proto_tcp.c:swrate_add_scaled Unexecuted instantiation: stats-file.c:swrate_add_scaled Unexecuted instantiation: stats-json.c:swrate_add_scaled Unexecuted instantiation: stats-proxy.c:swrate_add_scaled Unexecuted instantiation: cache.c:swrate_add_scaled Unexecuted instantiation: fcgi-app.c:swrate_add_scaled Unexecuted instantiation: flt_spoe.c:swrate_add_scaled Unexecuted instantiation: h1_htx.c:swrate_add_scaled Unexecuted instantiation: shctx.c:swrate_add_scaled |
370 | | |
371 | | /* opportunistic versions of the functions above: an attempt is made to update |
372 | | * the value, but in case of contention, it's not retried. This is fine when |
373 | | * rough estimates are needed and speed is preferred over accuracy. |
374 | | */ |
375 | | |
376 | | static inline uint swrate_add_opportunistic(uint *sum, uint n, uint v) |
377 | 0 | { |
378 | 0 | uint new_sum, old_sum; |
379 | |
|
380 | 0 | old_sum = *sum; |
381 | 0 | new_sum = old_sum - (old_sum + n - 1) / n + v; |
382 | 0 | HA_ATOMIC_CAS(sum, &old_sum, new_sum); |
383 | 0 | return new_sum; |
384 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:swrate_add_opportunistic Unexecuted instantiation: cfgparse.c:swrate_add_opportunistic Unexecuted instantiation: cli.c:swrate_add_opportunistic Unexecuted instantiation: clock.c:swrate_add_opportunistic Unexecuted instantiation: connection.c:swrate_add_opportunistic Unexecuted instantiation: debug.c:swrate_add_opportunistic Unexecuted instantiation: dynbuf.c:swrate_add_opportunistic Unexecuted instantiation: errors.c:swrate_add_opportunistic Unexecuted instantiation: fd.c:swrate_add_opportunistic Unexecuted instantiation: frontend.c:swrate_add_opportunistic Unexecuted instantiation: haproxy.c:swrate_add_opportunistic Unexecuted instantiation: http_ana.c:swrate_add_opportunistic Unexecuted instantiation: http_ext.c:swrate_add_opportunistic Unexecuted instantiation: http_htx.c:swrate_add_opportunistic Unexecuted instantiation: http_rules.c:swrate_add_opportunistic Unexecuted instantiation: htx.c:swrate_add_opportunistic Unexecuted instantiation: limits.c:swrate_add_opportunistic Unexecuted instantiation: listener.c:swrate_add_opportunistic Unexecuted instantiation: log.c:swrate_add_opportunistic Unexecuted instantiation: mailers.c:swrate_add_opportunistic Unexecuted instantiation: mworker.c:swrate_add_opportunistic Unexecuted instantiation: peers.c:swrate_add_opportunistic Unexecuted instantiation: pool.c:swrate_add_opportunistic Unexecuted instantiation: proto_rhttp.c:swrate_add_opportunistic Unexecuted instantiation: proto_sockpair.c:swrate_add_opportunistic Unexecuted instantiation: protocol.c:swrate_add_opportunistic Unexecuted instantiation: proxy.c:swrate_add_opportunistic Unexecuted instantiation: queue.c:swrate_add_opportunistic Unexecuted instantiation: regex.c:swrate_add_opportunistic Unexecuted instantiation: resolvers.c:swrate_add_opportunistic Unexecuted instantiation: ring.c:swrate_add_opportunistic Unexecuted instantiation: sample.c:swrate_add_opportunistic Unexecuted instantiation: server.c:swrate_add_opportunistic Unexecuted instantiation: session.c:swrate_add_opportunistic Unexecuted instantiation: signal.c:swrate_add_opportunistic Unexecuted instantiation: sink.c:swrate_add_opportunistic Unexecuted instantiation: sock.c:swrate_add_opportunistic Unexecuted instantiation: sock_inet.c:swrate_add_opportunistic Unexecuted instantiation: stats-html.c:swrate_add_opportunistic Unexecuted instantiation: stats.c:swrate_add_opportunistic Unexecuted instantiation: stconn.c:swrate_add_opportunistic Unexecuted instantiation: stick_table.c:swrate_add_opportunistic Unexecuted instantiation: stream.c:swrate_add_opportunistic Unexecuted instantiation: systemd.c:swrate_add_opportunistic Unexecuted instantiation: task.c:swrate_add_opportunistic Unexecuted instantiation: tcp_rules.c:swrate_add_opportunistic Unexecuted instantiation: tcpcheck.c:swrate_add_opportunistic Unexecuted instantiation: thread.c:swrate_add_opportunistic Unexecuted instantiation: tools.c:swrate_add_opportunistic Unexecuted instantiation: trace.c:swrate_add_opportunistic Unexecuted instantiation: vars.c:swrate_add_opportunistic Unexecuted instantiation: acl.c:swrate_add_opportunistic Unexecuted instantiation: action.c:swrate_add_opportunistic Unexecuted instantiation: activity.c:swrate_add_opportunistic Unexecuted instantiation: applet.c:swrate_add_opportunistic Unexecuted instantiation: arg.c:swrate_add_opportunistic Unexecuted instantiation: backend.c:swrate_add_opportunistic Unexecuted instantiation: cfgcond.c:swrate_add_opportunistic Unexecuted instantiation: cfgparse-global.c:swrate_add_opportunistic Unexecuted instantiation: cfgparse-listen.c:swrate_add_opportunistic Unexecuted instantiation: channel.c:swrate_add_opportunistic Unexecuted instantiation: check.c:swrate_add_opportunistic Unexecuted instantiation: chunk.c:swrate_add_opportunistic Unexecuted instantiation: compression.c:swrate_add_opportunistic Unexecuted instantiation: counters.c:swrate_add_opportunistic Unexecuted instantiation: dgram.c:swrate_add_opportunistic Unexecuted instantiation: dns.c:swrate_add_opportunistic Unexecuted instantiation: dns_ring.c:swrate_add_opportunistic Unexecuted instantiation: event_hdl.c:swrate_add_opportunistic Unexecuted instantiation: extcheck.c:swrate_add_opportunistic Unexecuted instantiation: filters.c:swrate_add_opportunistic Unexecuted instantiation: fix.c:swrate_add_opportunistic Unexecuted instantiation: flt_http_comp.c:swrate_add_opportunistic Unexecuted instantiation: freq_ctr.c:swrate_add_opportunistic Unexecuted instantiation: guid.c:swrate_add_opportunistic Unexecuted instantiation: h1.c:swrate_add_opportunistic Unexecuted instantiation: haterm.c:swrate_add_opportunistic Unexecuted instantiation: http.c:swrate_add_opportunistic Unexecuted instantiation: http_fetch.c:swrate_add_opportunistic Unexecuted instantiation: lb_chash.c:swrate_add_opportunistic Unexecuted instantiation: lb_fas.c:swrate_add_opportunistic Unexecuted instantiation: lb_fwlc.c:swrate_add_opportunistic Unexecuted instantiation: lb_fwrr.c:swrate_add_opportunistic Unexecuted instantiation: lb_map.c:swrate_add_opportunistic Unexecuted instantiation: mqtt.c:swrate_add_opportunistic Unexecuted instantiation: mux_spop.c:swrate_add_opportunistic Unexecuted instantiation: pattern.c:swrate_add_opportunistic Unexecuted instantiation: payload.c:swrate_add_opportunistic Unexecuted instantiation: pipe.c:swrate_add_opportunistic Unexecuted instantiation: proto_tcp.c:swrate_add_opportunistic Unexecuted instantiation: stats-file.c:swrate_add_opportunistic Unexecuted instantiation: stats-json.c:swrate_add_opportunistic Unexecuted instantiation: stats-proxy.c:swrate_add_opportunistic Unexecuted instantiation: cache.c:swrate_add_opportunistic Unexecuted instantiation: fcgi-app.c:swrate_add_opportunistic Unexecuted instantiation: flt_spoe.c:swrate_add_opportunistic Unexecuted instantiation: h1_htx.c:swrate_add_opportunistic Unexecuted instantiation: shctx.c:swrate_add_opportunistic |
385 | | |
386 | | static inline uint swrate_add_dynamic_opportunistic(uint *sum, uint n, uint v) |
387 | 0 | { |
388 | 0 | uint new_sum, old_sum; |
389 | 0 |
|
390 | 0 | old_sum = *sum; |
391 | 0 | new_sum = old_sum - (n ? (old_sum + n - 1) / n : 0) + v; |
392 | 0 | HA_ATOMIC_CAS(sum, &old_sum, new_sum); |
393 | 0 | return new_sum; |
394 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: cfgparse.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: cli.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: clock.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: connection.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: debug.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: dynbuf.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: errors.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: fd.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: frontend.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: haproxy.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: http_ana.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: http_ext.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: http_htx.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: http_rules.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: htx.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: limits.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: listener.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: log.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: mailers.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: mworker.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: peers.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: pool.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: proto_rhttp.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: proto_sockpair.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: protocol.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: proxy.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: queue.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: regex.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: resolvers.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: ring.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: sample.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: server.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: session.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: signal.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: sink.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: sock.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: sock_inet.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: stats-html.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: stats.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: stconn.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: stick_table.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: stream.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: systemd.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: task.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: tcp_rules.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: tcpcheck.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: thread.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: tools.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: trace.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: vars.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: acl.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: action.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: activity.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: applet.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: arg.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: backend.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: cfgcond.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: cfgparse-global.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: cfgparse-listen.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: channel.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: check.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: chunk.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: compression.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: counters.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: dgram.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: dns.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: dns_ring.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: event_hdl.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: extcheck.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: filters.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: fix.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: flt_http_comp.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: freq_ctr.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: guid.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: h1.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: haterm.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: http.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: http_fetch.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: lb_chash.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: lb_fas.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: lb_fwlc.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: lb_fwrr.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: lb_map.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: mqtt.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: mux_spop.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: pattern.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: payload.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: pipe.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: proto_tcp.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: stats-file.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: stats-json.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: stats-proxy.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: cache.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: fcgi-app.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: flt_spoe.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: h1_htx.c:swrate_add_dynamic_opportunistic Unexecuted instantiation: shctx.c:swrate_add_dynamic_opportunistic |
395 | | |
396 | | static inline uint swrate_add_scaled_opportunistic(uint *sum, uint n, uint v, uint s) |
397 | 0 | { |
398 | 0 | uint new_sum, old_sum; |
399 | |
|
400 | 0 | old_sum = *sum; |
401 | 0 | new_sum = old_sum + v * s - div64_32((unsigned long long)old_sum * s + n - 1, n); |
402 | 0 | HA_ATOMIC_CAS(sum, &old_sum, new_sum); |
403 | 0 | return new_sum; |
404 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:swrate_add_scaled_opportunistic Unexecuted instantiation: cfgparse.c:swrate_add_scaled_opportunistic Unexecuted instantiation: cli.c:swrate_add_scaled_opportunistic Unexecuted instantiation: clock.c:swrate_add_scaled_opportunistic Unexecuted instantiation: connection.c:swrate_add_scaled_opportunistic Unexecuted instantiation: debug.c:swrate_add_scaled_opportunistic Unexecuted instantiation: dynbuf.c:swrate_add_scaled_opportunistic Unexecuted instantiation: errors.c:swrate_add_scaled_opportunistic Unexecuted instantiation: fd.c:swrate_add_scaled_opportunistic Unexecuted instantiation: frontend.c:swrate_add_scaled_opportunistic Unexecuted instantiation: haproxy.c:swrate_add_scaled_opportunistic Unexecuted instantiation: http_ana.c:swrate_add_scaled_opportunistic Unexecuted instantiation: http_ext.c:swrate_add_scaled_opportunistic Unexecuted instantiation: http_htx.c:swrate_add_scaled_opportunistic Unexecuted instantiation: http_rules.c:swrate_add_scaled_opportunistic Unexecuted instantiation: htx.c:swrate_add_scaled_opportunistic Unexecuted instantiation: limits.c:swrate_add_scaled_opportunistic Unexecuted instantiation: listener.c:swrate_add_scaled_opportunistic Unexecuted instantiation: log.c:swrate_add_scaled_opportunistic Unexecuted instantiation: mailers.c:swrate_add_scaled_opportunistic Unexecuted instantiation: mworker.c:swrate_add_scaled_opportunistic Unexecuted instantiation: peers.c:swrate_add_scaled_opportunistic Unexecuted instantiation: pool.c:swrate_add_scaled_opportunistic Unexecuted instantiation: proto_rhttp.c:swrate_add_scaled_opportunistic Unexecuted instantiation: proto_sockpair.c:swrate_add_scaled_opportunistic Unexecuted instantiation: protocol.c:swrate_add_scaled_opportunistic Unexecuted instantiation: proxy.c:swrate_add_scaled_opportunistic Unexecuted instantiation: queue.c:swrate_add_scaled_opportunistic Unexecuted instantiation: regex.c:swrate_add_scaled_opportunistic Unexecuted instantiation: resolvers.c:swrate_add_scaled_opportunistic Unexecuted instantiation: ring.c:swrate_add_scaled_opportunistic Unexecuted instantiation: sample.c:swrate_add_scaled_opportunistic Unexecuted instantiation: server.c:swrate_add_scaled_opportunistic Unexecuted instantiation: session.c:swrate_add_scaled_opportunistic Unexecuted instantiation: signal.c:swrate_add_scaled_opportunistic Unexecuted instantiation: sink.c:swrate_add_scaled_opportunistic Unexecuted instantiation: sock.c:swrate_add_scaled_opportunistic Unexecuted instantiation: sock_inet.c:swrate_add_scaled_opportunistic Unexecuted instantiation: stats-html.c:swrate_add_scaled_opportunistic Unexecuted instantiation: stats.c:swrate_add_scaled_opportunistic Unexecuted instantiation: stconn.c:swrate_add_scaled_opportunistic Unexecuted instantiation: stick_table.c:swrate_add_scaled_opportunistic Unexecuted instantiation: stream.c:swrate_add_scaled_opportunistic Unexecuted instantiation: systemd.c:swrate_add_scaled_opportunistic Unexecuted instantiation: task.c:swrate_add_scaled_opportunistic Unexecuted instantiation: tcp_rules.c:swrate_add_scaled_opportunistic Unexecuted instantiation: tcpcheck.c:swrate_add_scaled_opportunistic Unexecuted instantiation: thread.c:swrate_add_scaled_opportunistic Unexecuted instantiation: tools.c:swrate_add_scaled_opportunistic Unexecuted instantiation: trace.c:swrate_add_scaled_opportunistic Unexecuted instantiation: vars.c:swrate_add_scaled_opportunistic Unexecuted instantiation: acl.c:swrate_add_scaled_opportunistic Unexecuted instantiation: action.c:swrate_add_scaled_opportunistic Unexecuted instantiation: activity.c:swrate_add_scaled_opportunistic Unexecuted instantiation: applet.c:swrate_add_scaled_opportunistic Unexecuted instantiation: arg.c:swrate_add_scaled_opportunistic Unexecuted instantiation: backend.c:swrate_add_scaled_opportunistic Unexecuted instantiation: cfgcond.c:swrate_add_scaled_opportunistic Unexecuted instantiation: cfgparse-global.c:swrate_add_scaled_opportunistic Unexecuted instantiation: cfgparse-listen.c:swrate_add_scaled_opportunistic Unexecuted instantiation: channel.c:swrate_add_scaled_opportunistic Unexecuted instantiation: check.c:swrate_add_scaled_opportunistic Unexecuted instantiation: chunk.c:swrate_add_scaled_opportunistic Unexecuted instantiation: compression.c:swrate_add_scaled_opportunistic Unexecuted instantiation: counters.c:swrate_add_scaled_opportunistic Unexecuted instantiation: dgram.c:swrate_add_scaled_opportunistic Unexecuted instantiation: dns.c:swrate_add_scaled_opportunistic Unexecuted instantiation: dns_ring.c:swrate_add_scaled_opportunistic Unexecuted instantiation: event_hdl.c:swrate_add_scaled_opportunistic Unexecuted instantiation: extcheck.c:swrate_add_scaled_opportunistic Unexecuted instantiation: filters.c:swrate_add_scaled_opportunistic Unexecuted instantiation: fix.c:swrate_add_scaled_opportunistic Unexecuted instantiation: flt_http_comp.c:swrate_add_scaled_opportunistic Unexecuted instantiation: freq_ctr.c:swrate_add_scaled_opportunistic Unexecuted instantiation: guid.c:swrate_add_scaled_opportunistic Unexecuted instantiation: h1.c:swrate_add_scaled_opportunistic Unexecuted instantiation: haterm.c:swrate_add_scaled_opportunistic Unexecuted instantiation: http.c:swrate_add_scaled_opportunistic Unexecuted instantiation: http_fetch.c:swrate_add_scaled_opportunistic Unexecuted instantiation: lb_chash.c:swrate_add_scaled_opportunistic Unexecuted instantiation: lb_fas.c:swrate_add_scaled_opportunistic Unexecuted instantiation: lb_fwlc.c:swrate_add_scaled_opportunistic Unexecuted instantiation: lb_fwrr.c:swrate_add_scaled_opportunistic Unexecuted instantiation: lb_map.c:swrate_add_scaled_opportunistic Unexecuted instantiation: mqtt.c:swrate_add_scaled_opportunistic Unexecuted instantiation: mux_spop.c:swrate_add_scaled_opportunistic Unexecuted instantiation: pattern.c:swrate_add_scaled_opportunistic Unexecuted instantiation: payload.c:swrate_add_scaled_opportunistic Unexecuted instantiation: pipe.c:swrate_add_scaled_opportunistic Unexecuted instantiation: proto_tcp.c:swrate_add_scaled_opportunistic Unexecuted instantiation: stats-file.c:swrate_add_scaled_opportunistic Unexecuted instantiation: stats-json.c:swrate_add_scaled_opportunistic Unexecuted instantiation: stats-proxy.c:swrate_add_scaled_opportunistic Unexecuted instantiation: cache.c:swrate_add_scaled_opportunistic Unexecuted instantiation: fcgi-app.c:swrate_add_scaled_opportunistic Unexecuted instantiation: flt_spoe.c:swrate_add_scaled_opportunistic Unexecuted instantiation: h1_htx.c:swrate_add_scaled_opportunistic Unexecuted instantiation: shctx.c:swrate_add_scaled_opportunistic |
405 | | |
406 | | /* Returns the average sample value for the sum <sum> over a sliding window of |
407 | | * <n> samples. Better if <n> is a power of two. It must be the same <n> as the |
408 | | * one used above in all additions. |
409 | | */ |
410 | | static inline unsigned int swrate_avg(unsigned int sum, unsigned int n) |
411 | 0 | { |
412 | 0 | return (sum + n - 1) / n; |
413 | 0 | } Unexecuted instantiation: fuzz_hpack_decode.c:swrate_avg Unexecuted instantiation: cfgparse.c:swrate_avg Unexecuted instantiation: cli.c:swrate_avg Unexecuted instantiation: clock.c:swrate_avg Unexecuted instantiation: connection.c:swrate_avg Unexecuted instantiation: debug.c:swrate_avg Unexecuted instantiation: dynbuf.c:swrate_avg Unexecuted instantiation: errors.c:swrate_avg Unexecuted instantiation: fd.c:swrate_avg Unexecuted instantiation: frontend.c:swrate_avg Unexecuted instantiation: haproxy.c:swrate_avg Unexecuted instantiation: http_ana.c:swrate_avg Unexecuted instantiation: http_ext.c:swrate_avg Unexecuted instantiation: http_htx.c:swrate_avg Unexecuted instantiation: http_rules.c:swrate_avg Unexecuted instantiation: htx.c:swrate_avg Unexecuted instantiation: limits.c:swrate_avg Unexecuted instantiation: listener.c:swrate_avg Unexecuted instantiation: log.c:swrate_avg Unexecuted instantiation: mailers.c:swrate_avg Unexecuted instantiation: mworker.c:swrate_avg Unexecuted instantiation: peers.c:swrate_avg Unexecuted instantiation: pool.c:swrate_avg Unexecuted instantiation: proto_rhttp.c:swrate_avg Unexecuted instantiation: proto_sockpair.c:swrate_avg Unexecuted instantiation: protocol.c:swrate_avg Unexecuted instantiation: proxy.c:swrate_avg Unexecuted instantiation: queue.c:swrate_avg Unexecuted instantiation: regex.c:swrate_avg Unexecuted instantiation: resolvers.c:swrate_avg Unexecuted instantiation: ring.c:swrate_avg Unexecuted instantiation: sample.c:swrate_avg Unexecuted instantiation: server.c:swrate_avg Unexecuted instantiation: session.c:swrate_avg Unexecuted instantiation: signal.c:swrate_avg Unexecuted instantiation: sink.c:swrate_avg Unexecuted instantiation: sock.c:swrate_avg Unexecuted instantiation: sock_inet.c:swrate_avg Unexecuted instantiation: stats-html.c:swrate_avg Unexecuted instantiation: stats.c:swrate_avg Unexecuted instantiation: stconn.c:swrate_avg Unexecuted instantiation: stick_table.c:swrate_avg Unexecuted instantiation: stream.c:swrate_avg Unexecuted instantiation: systemd.c:swrate_avg Unexecuted instantiation: task.c:swrate_avg Unexecuted instantiation: tcp_rules.c:swrate_avg Unexecuted instantiation: tcpcheck.c:swrate_avg Unexecuted instantiation: thread.c:swrate_avg Unexecuted instantiation: tools.c:swrate_avg Unexecuted instantiation: trace.c:swrate_avg Unexecuted instantiation: vars.c:swrate_avg Unexecuted instantiation: acl.c:swrate_avg Unexecuted instantiation: action.c:swrate_avg Unexecuted instantiation: activity.c:swrate_avg Unexecuted instantiation: applet.c:swrate_avg Unexecuted instantiation: arg.c:swrate_avg Unexecuted instantiation: backend.c:swrate_avg Unexecuted instantiation: cfgcond.c:swrate_avg Unexecuted instantiation: cfgparse-global.c:swrate_avg Unexecuted instantiation: cfgparse-listen.c:swrate_avg Unexecuted instantiation: channel.c:swrate_avg Unexecuted instantiation: check.c:swrate_avg Unexecuted instantiation: chunk.c:swrate_avg Unexecuted instantiation: compression.c:swrate_avg Unexecuted instantiation: counters.c:swrate_avg Unexecuted instantiation: dgram.c:swrate_avg Unexecuted instantiation: dns.c:swrate_avg Unexecuted instantiation: dns_ring.c:swrate_avg Unexecuted instantiation: event_hdl.c:swrate_avg Unexecuted instantiation: extcheck.c:swrate_avg Unexecuted instantiation: filters.c:swrate_avg Unexecuted instantiation: fix.c:swrate_avg Unexecuted instantiation: flt_http_comp.c:swrate_avg Unexecuted instantiation: freq_ctr.c:swrate_avg Unexecuted instantiation: guid.c:swrate_avg Unexecuted instantiation: h1.c:swrate_avg Unexecuted instantiation: haterm.c:swrate_avg Unexecuted instantiation: http.c:swrate_avg Unexecuted instantiation: http_fetch.c:swrate_avg Unexecuted instantiation: lb_chash.c:swrate_avg Unexecuted instantiation: lb_fas.c:swrate_avg Unexecuted instantiation: lb_fwlc.c:swrate_avg Unexecuted instantiation: lb_fwrr.c:swrate_avg Unexecuted instantiation: lb_map.c:swrate_avg Unexecuted instantiation: mqtt.c:swrate_avg Unexecuted instantiation: mux_spop.c:swrate_avg Unexecuted instantiation: pattern.c:swrate_avg Unexecuted instantiation: payload.c:swrate_avg Unexecuted instantiation: pipe.c:swrate_avg Unexecuted instantiation: proto_tcp.c:swrate_avg Unexecuted instantiation: stats-file.c:swrate_avg Unexecuted instantiation: stats-json.c:swrate_avg Unexecuted instantiation: stats-proxy.c:swrate_avg Unexecuted instantiation: cache.c:swrate_avg Unexecuted instantiation: fcgi-app.c:swrate_avg Unexecuted instantiation: flt_spoe.c:swrate_avg Unexecuted instantiation: h1_htx.c:swrate_avg Unexecuted instantiation: shctx.c:swrate_avg |
414 | | |
415 | | #endif /* _HAPROXY_FREQ_CTR_H */ |
416 | | |
417 | | /* |
418 | | * Local variables: |
419 | | * c-indent-level: 8 |
420 | | * c-basic-offset: 8 |
421 | | * End: |
422 | | */ |