Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2014-2016 DeNA Co., Ltd., Kazuho Oku, Fastly, Inc. |
3 | | * |
4 | | * Permission is hereby granted, free of charge, to any person obtaining a copy |
5 | | * of this software and associated documentation files (the "Software"), to |
6 | | * deal in the Software without restriction, including without limitation the |
7 | | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
8 | | * sell copies of the Software, and to permit persons to whom the Software is |
9 | | * furnished to do so, subject to the following conditions: |
10 | | * |
11 | | * The above copyright notice and this permission notice shall be included in |
12 | | * all copies or substantial portions of the Software. |
13 | | * |
14 | | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
15 | | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
16 | | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
17 | | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
18 | | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
19 | | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
20 | | * IN THE SOFTWARE. |
21 | | */ |
22 | | #ifndef h2o__probes_h |
23 | | #define h2o__probes_h |
24 | | |
25 | | #include "picotls.h" |
26 | | |
27 | | #define H2O_LOG_SOCK(_name, _sock, _block) \ |
28 | 50.2k | do { \ |
29 | 50.2k | PTLS_LOG_DEFINE_POINT(h2o, _name, logpoint); \ |
30 | 50.2k | uint32_t active = ptls_log_point_maybe_active(&logpoint); \ |
31 | 50.2k | if (PTLS_LIKELY(active == 0)) \ |
32 | 50.2k | break; \ |
33 | 50.2k | h2o_socket_t *sock_ = (_sock); \ |
34 | 0 | ptls_log_conn_state_t *conn_state = h2o_socket_log_state(sock_); \ |
35 | 0 | active &= ptls_log_conn_maybe_active(conn_state, ptls_log_getsni_h2o_sock(sock_)); \ |
36 | 0 | if (PTLS_LIKELY(active == 0)) \ |
37 | 0 | break; \ |
38 | 0 | PTLS_LOG__DO_LOG(h2o, _name, conn_state, ptls_log_getsni_h2o_sock(sock_), 1, { \ |
39 | 0 | PTLS_LOG_ELEMENT_PTR(sock, sock_); \ |
40 | 0 | do { \ |
41 | 0 | _block \ |
42 | 0 | } while (0); \ |
43 | 0 | }); \ |
44 | 0 | } while (0) |
45 | | #define H2O_LOG_CONN(_name, _conn, _block) \ |
46 | 75.8k | do { \ |
47 | 75.8k | PTLS_LOG_DEFINE_POINT(h2o, _name, logpoint); \ |
48 | 75.8k | uint32_t active = ptls_log_point_maybe_active(&logpoint); \ |
49 | 75.8k | if (active == 0) \ |
50 | 75.8k | break; \ |
51 | 75.8k | h2o_conn_t *conn_ = (_conn); \ |
52 | 0 | ptls_log_conn_state_t *conn_state = conn_->callbacks->log_state(conn_); \ |
53 | 0 | active &= ptls_log_conn_maybe_active(conn_state, ptls_log_getsni_h2o_conn(conn_)); \ |
54 | 0 | if (active == 0) \ |
55 | 0 | break; \ |
56 | 0 | PTLS_LOG__DO_LOG(h2o, _name, conn_state, ptls_log_getsni_h2o_conn(conn_), 1, { \ |
57 | 0 | PTLS_LOG_ELEMENT_UNSIGNED(conn_id, conn_->id); \ |
58 | 0 | do { \ |
59 | 0 | _block \ |
60 | 0 | } while (0); \ |
61 | 0 | }); \ |
62 | 0 | } while (0) |
63 | | |
64 | | /* This file is placed under lib, and must only be included from the source files of the h2o / libh2o, because H2O_USE_DTRACE is a |
65 | | * symbol available only during the build phase of h2o. That's fine, because only h2o / libh2o has the sole right to define probes |
66 | | * belonging to the h2o namespace. |
67 | | */ |
68 | | #if H2O_USE_DTRACE |
69 | | |
70 | | #include "picotls.h" |
71 | | /* as probes_.h is used by files under lib/common, structures that are specific to the server-side implementation have to be |
72 | | * forward-declared. */ |
73 | | struct st_h2o_conn_t; |
74 | | struct st_h2o_tunnel_t; |
75 | | #include "h2o-probes.h" |
76 | | |
77 | | #define H2O_PROBE_IS_ENABLED(label) (PTLS_UNLIKELY(H2O_##label##_ENABLED())) |
78 | | |
79 | | #define H2O_PROBE_CONN0(label, conn) \ |
80 | | do { \ |
81 | | if (H2O_PROBE_IS_ENABLED(label)) { \ |
82 | | H2O_##label((conn)->id); \ |
83 | | } \ |
84 | | } while (0) |
85 | | |
86 | | #define H2O_PROBE_CONN(label, conn, ...) \ |
87 | | do { \ |
88 | | if (H2O_PROBE_IS_ENABLED(label)) { \ |
89 | | H2O_##label((conn)->id, __VA_ARGS__); \ |
90 | | } \ |
91 | | } while (0) |
92 | | |
93 | | #define H2O_PROBE_REQUEST0(label, req) \ |
94 | | do { \ |
95 | | if (H2O_PROBE_IS_ENABLED(label)) { \ |
96 | | h2o_req_t *_req = (req); \ |
97 | | h2o_conn_t *_conn = _req->conn; \ |
98 | | uint64_t _req_id = _conn->callbacks->get_req_id(_req); \ |
99 | | H2O_##label(_conn->id, _req_id); \ |
100 | | } \ |
101 | | } while (0) |
102 | | |
103 | | #define H2O_PROBE_REQUEST(label, req, ...) \ |
104 | | do { \ |
105 | | if (H2O_PROBE_IS_ENABLED(label)) { \ |
106 | | h2o_req_t *_req = (req); \ |
107 | | h2o_conn_t *_conn = _req->conn; \ |
108 | | uint64_t _req_id = _conn->callbacks->get_req_id(_req); \ |
109 | | H2O_##label(_conn->id, _req_id, __VA_ARGS__); \ |
110 | | } \ |
111 | | } while (0) |
112 | | |
113 | | #define H2O_PROBE(label, ...) \ |
114 | | do { \ |
115 | | if (H2O_PROBE_IS_ENABLED(label)) { \ |
116 | | H2O_##label(__VA_ARGS__); \ |
117 | | } \ |
118 | | } while (0) |
119 | | |
120 | | #define H2O_PROBE_HEXDUMP(s, l) \ |
121 | | ({ \ |
122 | | size_t _l = (l); \ |
123 | | ptls_hexdump(alloca(_l * 2 + 1), (s), _l); \ |
124 | | }) |
125 | | |
126 | | #else |
127 | | |
128 | 91.9k | #define H2O_PROBE_IS_ENABLED(label) (0) |
129 | | #define H2O_PROBE_CONN0(label, conn) |
130 | | #define H2O_PROBE_CONN(label, conn, ...) |
131 | | #define H2O_PROBE_REQUEST0(label, req) |
132 | | #define H2O_PROBE_REQUEST(label, req, ...) |
133 | | #define H2O_PROBE(label, ...) |
134 | | #define H2O_PROBE_HEXDUMP(s, l) |
135 | | |
136 | | #endif |
137 | | |
138 | | /* Helper functions for probing; the functions are defined as non-inlineable, as bcc cannot handle relative offset against a static |
139 | | * const (e.g., H2O_TOKEN_PATH->buf.base). They are available only when h2o.h is included, so that files under lib/common can |
140 | | * include this function without creating dependency against lib/core (e.g., `h2o_req_t`). */ |
141 | | #ifdef h2o_h |
142 | | |
143 | | __attribute__((noinline)) static void h2o_probe_request_header(h2o_req_t *req, uint64_t req_index, h2o_iovec_t name, |
144 | | h2o_iovec_t value) |
145 | 0 | { |
146 | 0 | H2O_PROBE_CONN(RECEIVE_REQUEST_HEADER, req->conn, req_index, name.base, name.len, value.base, value.len); |
147 | 0 | H2O_LOG_CONN(receive_request_header, req->conn, { |
148 | 0 | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); |
149 | 0 | PTLS_LOG_APPDATA_ELEMENT_UNSAFESTR(name, name.base, name.len); |
150 | 0 | PTLS_LOG_APPDATA_ELEMENT_UNSAFESTR(value, value.base, value.len); |
151 | 0 | }); |
152 | 0 | } Unexecuted instantiation: http1.c:h2o_probe_request_header Unexecuted instantiation: connection.c:h2o_probe_request_header Unexecuted instantiation: stream.c:h2o_probe_request_header Unexecuted instantiation: common.c:h2o_probe_request_header Unexecuted instantiation: server.c:h2o_probe_request_header Unexecuted instantiation: http3client.c:h2o_probe_request_header Unexecuted instantiation: connect.c:h2o_probe_request_header |
153 | | |
154 | | __attribute__((noinline)) static void h2o_probe_response_header(h2o_req_t *req, uint64_t req_index, h2o_iovec_t name, |
155 | | h2o_iovec_t value) |
156 | 0 | { |
157 | 0 | H2O_PROBE_CONN(SEND_RESPONSE_HEADER, req->conn, req_index, name.base, name.len, value.base, value.len); |
158 | 0 | H2O_LOG_CONN(send_response_header, req->conn, { |
159 | 0 | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); |
160 | 0 | PTLS_LOG_APPDATA_ELEMENT_UNSAFESTR(name, name.base, name.len); |
161 | 0 | PTLS_LOG_APPDATA_ELEMENT_UNSAFESTR(value, value.base, value.len); |
162 | 0 | }); |
163 | 0 | } Unexecuted instantiation: http1.c:h2o_probe_response_header Unexecuted instantiation: connection.c:h2o_probe_response_header Unexecuted instantiation: stream.c:h2o_probe_response_header Unexecuted instantiation: common.c:h2o_probe_response_header Unexecuted instantiation: server.c:h2o_probe_response_header Unexecuted instantiation: http3client.c:h2o_probe_response_header Unexecuted instantiation: connect.c:h2o_probe_response_header |
164 | | |
165 | | static inline void h2o_probe_log_request(h2o_req_t *req, uint64_t req_index) |
166 | 25.3k | { |
167 | 25.3k | H2O_PROBE_CONN(RECEIVE_REQUEST, req->conn, req_index, req->version); |
168 | 25.3k | H2O_LOG_CONN(receive_request, req->conn, { |
169 | 25.3k | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); |
170 | 25.3k | PTLS_LOG_ELEMENT_SIGNED(http_version, req->version); |
171 | 25.3k | }); |
172 | | |
173 | 25.3k | PTLS_LOG_DEFINE_POINT(h2o, receive_request_header, receive_request_header_logpoint); |
174 | 25.3k | if (H2O_PROBE_IS_ENABLED(RECEIVE_REQUEST_HEADER) || |
175 | 25.3k | (ptls_log_point_maybe_active(&receive_request_header_logpoint) != 0 && |
176 | 0 | (receive_request_header_logpoint.state.active_conns & |
177 | 0 | ptls_log_conn_maybe_active(req->conn->callbacks->log_state(req->conn), ptls_log_getsni_h2o_conn(req->conn))) != 0)) { |
178 | 0 | if (req->input.authority.base != NULL) |
179 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_AUTHORITY->buf, req->input.authority); |
180 | 0 | if (req->input.method.base != NULL) |
181 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_METHOD->buf, req->input.method); |
182 | 0 | if (req->input.path.base != NULL) |
183 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_PATH->buf, req->input.path); |
184 | 0 | if (req->input.scheme != NULL) |
185 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_SCHEME->buf, req->input.scheme->name); |
186 | 0 | size_t i; |
187 | 0 | for (i = 0; i != req->headers.size; ++i) { |
188 | 0 | h2o_header_t *h = req->headers.entries + i; |
189 | 0 | h2o_probe_request_header(req, req_index, *h->name, h->value); |
190 | 0 | } |
191 | 0 | } |
192 | 25.3k | } http1.c:h2o_probe_log_request Line | Count | Source | 166 | 9.00k | { | 167 | 9.00k | H2O_PROBE_CONN(RECEIVE_REQUEST, req->conn, req_index, req->version); | 168 | 9.00k | H2O_LOG_CONN(receive_request, req->conn, { | 169 | 9.00k | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); | 170 | 9.00k | PTLS_LOG_ELEMENT_SIGNED(http_version, req->version); | 171 | 9.00k | }); | 172 | | | 173 | 9.00k | PTLS_LOG_DEFINE_POINT(h2o, receive_request_header, receive_request_header_logpoint); | 174 | 9.00k | if (H2O_PROBE_IS_ENABLED(RECEIVE_REQUEST_HEADER) || | 175 | 9.00k | (ptls_log_point_maybe_active(&receive_request_header_logpoint) != 0 && | 176 | 0 | (receive_request_header_logpoint.state.active_conns & | 177 | 0 | ptls_log_conn_maybe_active(req->conn->callbacks->log_state(req->conn), ptls_log_getsni_h2o_conn(req->conn))) != 0)) { | 178 | 0 | if (req->input.authority.base != NULL) | 179 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_AUTHORITY->buf, req->input.authority); | 180 | 0 | if (req->input.method.base != NULL) | 181 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_METHOD->buf, req->input.method); | 182 | 0 | if (req->input.path.base != NULL) | 183 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_PATH->buf, req->input.path); | 184 | 0 | if (req->input.scheme != NULL) | 185 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_SCHEME->buf, req->input.scheme->name); | 186 | 0 | size_t i; | 187 | 0 | for (i = 0; i != req->headers.size; ++i) { | 188 | 0 | h2o_header_t *h = req->headers.entries + i; | 189 | 0 | h2o_probe_request_header(req, req_index, *h->name, h->value); | 190 | 0 | } | 191 | 0 | } | 192 | 9.00k | } |
connection.c:h2o_probe_log_request Line | Count | Source | 166 | 14.2k | { | 167 | 14.2k | H2O_PROBE_CONN(RECEIVE_REQUEST, req->conn, req_index, req->version); | 168 | 14.2k | H2O_LOG_CONN(receive_request, req->conn, { | 169 | 14.2k | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); | 170 | 14.2k | PTLS_LOG_ELEMENT_SIGNED(http_version, req->version); | 171 | 14.2k | }); | 172 | | | 173 | 14.2k | PTLS_LOG_DEFINE_POINT(h2o, receive_request_header, receive_request_header_logpoint); | 174 | 14.2k | if (H2O_PROBE_IS_ENABLED(RECEIVE_REQUEST_HEADER) || | 175 | 14.2k | (ptls_log_point_maybe_active(&receive_request_header_logpoint) != 0 && | 176 | 0 | (receive_request_header_logpoint.state.active_conns & | 177 | 0 | ptls_log_conn_maybe_active(req->conn->callbacks->log_state(req->conn), ptls_log_getsni_h2o_conn(req->conn))) != 0)) { | 178 | 0 | if (req->input.authority.base != NULL) | 179 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_AUTHORITY->buf, req->input.authority); | 180 | 0 | if (req->input.method.base != NULL) | 181 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_METHOD->buf, req->input.method); | 182 | 0 | if (req->input.path.base != NULL) | 183 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_PATH->buf, req->input.path); | 184 | 0 | if (req->input.scheme != NULL) | 185 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_SCHEME->buf, req->input.scheme->name); | 186 | 0 | size_t i; | 187 | 0 | for (i = 0; i != req->headers.size; ++i) { | 188 | 0 | h2o_header_t *h = req->headers.entries + i; | 189 | 0 | h2o_probe_request_header(req, req_index, *h->name, h->value); | 190 | 0 | } | 191 | 0 | } | 192 | 14.2k | } |
Unexecuted instantiation: stream.c:h2o_probe_log_request Unexecuted instantiation: common.c:h2o_probe_log_request server.c:h2o_probe_log_request Line | Count | Source | 166 | 2.11k | { | 167 | 2.11k | H2O_PROBE_CONN(RECEIVE_REQUEST, req->conn, req_index, req->version); | 168 | 2.11k | H2O_LOG_CONN(receive_request, req->conn, { | 169 | 2.11k | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); | 170 | 2.11k | PTLS_LOG_ELEMENT_SIGNED(http_version, req->version); | 171 | 2.11k | }); | 172 | | | 173 | 2.11k | PTLS_LOG_DEFINE_POINT(h2o, receive_request_header, receive_request_header_logpoint); | 174 | 2.11k | if (H2O_PROBE_IS_ENABLED(RECEIVE_REQUEST_HEADER) || | 175 | 2.11k | (ptls_log_point_maybe_active(&receive_request_header_logpoint) != 0 && | 176 | 0 | (receive_request_header_logpoint.state.active_conns & | 177 | 0 | ptls_log_conn_maybe_active(req->conn->callbacks->log_state(req->conn), ptls_log_getsni_h2o_conn(req->conn))) != 0)) { | 178 | 0 | if (req->input.authority.base != NULL) | 179 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_AUTHORITY->buf, req->input.authority); | 180 | 0 | if (req->input.method.base != NULL) | 181 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_METHOD->buf, req->input.method); | 182 | 0 | if (req->input.path.base != NULL) | 183 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_PATH->buf, req->input.path); | 184 | 0 | if (req->input.scheme != NULL) | 185 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_SCHEME->buf, req->input.scheme->name); | 186 | 0 | size_t i; | 187 | 0 | for (i = 0; i != req->headers.size; ++i) { | 188 | 0 | h2o_header_t *h = req->headers.entries + i; | 189 | 0 | h2o_probe_request_header(req, req_index, *h->name, h->value); | 190 | 0 | } | 191 | 0 | } | 192 | 2.11k | } |
Unexecuted instantiation: http3client.c:h2o_probe_log_request Unexecuted instantiation: connect.c:h2o_probe_log_request |
193 | | |
194 | | static inline void h2o_probe_log_response(h2o_req_t *req, uint64_t req_index) |
195 | 20.5k | { |
196 | 20.5k | H2O_PROBE_CONN(SEND_RESPONSE, req->conn, req_index, req->res.status); |
197 | 20.5k | H2O_LOG_CONN(send_response, req->conn, { |
198 | 20.5k | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); |
199 | 20.5k | PTLS_LOG_ELEMENT_SIGNED(status, req->res.status); |
200 | 20.5k | }); |
201 | 20.5k | PTLS_LOG_DEFINE_POINT(h2o, send_response_header, send_response_header_logpoint); |
202 | 20.5k | if (H2O_PROBE_IS_ENABLED(SEND_RESPONSE_HEADER) || |
203 | 20.5k | (ptls_log_point_maybe_active(&send_response_header_logpoint) != 0 && |
204 | 0 | (send_response_header_logpoint.state.active_conns & |
205 | 0 | ptls_log_conn_maybe_active(req->conn->callbacks->log_state(req->conn), ptls_log_getsni_h2o_conn(req->conn))) != 0)) { |
206 | 0 | if (req->res.content_length != SIZE_MAX) { |
207 | 0 | char buf[sizeof(H2O_SIZE_T_LONGEST_STR)]; |
208 | 0 | size_t len = (size_t)sprintf(buf, "%zu", req->res.content_length); |
209 | 0 | h2o_probe_response_header(req, req_index, H2O_TOKEN_CONTENT_LENGTH->buf, h2o_iovec_init(buf, len)); |
210 | 0 | } |
211 | 0 | size_t i; |
212 | 0 | for (i = 0; i != req->res.headers.size; ++i) { |
213 | 0 | h2o_header_t *h = req->res.headers.entries + i; |
214 | 0 | h2o_probe_response_header(req, req_index, *h->name, h->value); |
215 | 0 | } |
216 | 0 | } |
217 | 20.5k | } http1.c:h2o_probe_log_response Line | Count | Source | 195 | 9.74k | { | 196 | 9.74k | H2O_PROBE_CONN(SEND_RESPONSE, req->conn, req_index, req->res.status); | 197 | 9.74k | H2O_LOG_CONN(send_response, req->conn, { | 198 | 9.74k | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); | 199 | 9.74k | PTLS_LOG_ELEMENT_SIGNED(status, req->res.status); | 200 | 9.74k | }); | 201 | 9.74k | PTLS_LOG_DEFINE_POINT(h2o, send_response_header, send_response_header_logpoint); | 202 | 9.74k | if (H2O_PROBE_IS_ENABLED(SEND_RESPONSE_HEADER) || | 203 | 9.74k | (ptls_log_point_maybe_active(&send_response_header_logpoint) != 0 && | 204 | 0 | (send_response_header_logpoint.state.active_conns & | 205 | 0 | ptls_log_conn_maybe_active(req->conn->callbacks->log_state(req->conn), ptls_log_getsni_h2o_conn(req->conn))) != 0)) { | 206 | 0 | if (req->res.content_length != SIZE_MAX) { | 207 | 0 | char buf[sizeof(H2O_SIZE_T_LONGEST_STR)]; | 208 | 0 | size_t len = (size_t)sprintf(buf, "%zu", req->res.content_length); | 209 | 0 | h2o_probe_response_header(req, req_index, H2O_TOKEN_CONTENT_LENGTH->buf, h2o_iovec_init(buf, len)); | 210 | 0 | } | 211 | 0 | size_t i; | 212 | 0 | for (i = 0; i != req->res.headers.size; ++i) { | 213 | 0 | h2o_header_t *h = req->res.headers.entries + i; | 214 | 0 | h2o_probe_response_header(req, req_index, *h->name, h->value); | 215 | 0 | } | 216 | 0 | } | 217 | 9.74k | } |
Unexecuted instantiation: connection.c:h2o_probe_log_response stream.c:h2o_probe_log_response Line | Count | Source | 195 | 9.22k | { | 196 | 9.22k | H2O_PROBE_CONN(SEND_RESPONSE, req->conn, req_index, req->res.status); | 197 | 9.22k | H2O_LOG_CONN(send_response, req->conn, { | 198 | 9.22k | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); | 199 | 9.22k | PTLS_LOG_ELEMENT_SIGNED(status, req->res.status); | 200 | 9.22k | }); | 201 | 9.22k | PTLS_LOG_DEFINE_POINT(h2o, send_response_header, send_response_header_logpoint); | 202 | 9.22k | if (H2O_PROBE_IS_ENABLED(SEND_RESPONSE_HEADER) || | 203 | 9.22k | (ptls_log_point_maybe_active(&send_response_header_logpoint) != 0 && | 204 | 0 | (send_response_header_logpoint.state.active_conns & | 205 | 0 | ptls_log_conn_maybe_active(req->conn->callbacks->log_state(req->conn), ptls_log_getsni_h2o_conn(req->conn))) != 0)) { | 206 | 0 | if (req->res.content_length != SIZE_MAX) { | 207 | 0 | char buf[sizeof(H2O_SIZE_T_LONGEST_STR)]; | 208 | 0 | size_t len = (size_t)sprintf(buf, "%zu", req->res.content_length); | 209 | 0 | h2o_probe_response_header(req, req_index, H2O_TOKEN_CONTENT_LENGTH->buf, h2o_iovec_init(buf, len)); | 210 | 0 | } | 211 | 0 | size_t i; | 212 | 0 | for (i = 0; i != req->res.headers.size; ++i) { | 213 | 0 | h2o_header_t *h = req->res.headers.entries + i; | 214 | 0 | h2o_probe_response_header(req, req_index, *h->name, h->value); | 215 | 0 | } | 216 | 0 | } | 217 | 9.22k | } |
Unexecuted instantiation: common.c:h2o_probe_log_response server.c:h2o_probe_log_response Line | Count | Source | 195 | 1.61k | { | 196 | 1.61k | H2O_PROBE_CONN(SEND_RESPONSE, req->conn, req_index, req->res.status); | 197 | 1.61k | H2O_LOG_CONN(send_response, req->conn, { | 198 | 1.61k | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); | 199 | 1.61k | PTLS_LOG_ELEMENT_SIGNED(status, req->res.status); | 200 | 1.61k | }); | 201 | 1.61k | PTLS_LOG_DEFINE_POINT(h2o, send_response_header, send_response_header_logpoint); | 202 | 1.61k | if (H2O_PROBE_IS_ENABLED(SEND_RESPONSE_HEADER) || | 203 | 1.61k | (ptls_log_point_maybe_active(&send_response_header_logpoint) != 0 && | 204 | 0 | (send_response_header_logpoint.state.active_conns & | 205 | 0 | ptls_log_conn_maybe_active(req->conn->callbacks->log_state(req->conn), ptls_log_getsni_h2o_conn(req->conn))) != 0)) { | 206 | 0 | if (req->res.content_length != SIZE_MAX) { | 207 | 0 | char buf[sizeof(H2O_SIZE_T_LONGEST_STR)]; | 208 | 0 | size_t len = (size_t)sprintf(buf, "%zu", req->res.content_length); | 209 | 0 | h2o_probe_response_header(req, req_index, H2O_TOKEN_CONTENT_LENGTH->buf, h2o_iovec_init(buf, len)); | 210 | 0 | } | 211 | 0 | size_t i; | 212 | 0 | for (i = 0; i != req->res.headers.size; ++i) { | 213 | 0 | h2o_header_t *h = req->res.headers.entries + i; | 214 | 0 | h2o_probe_response_header(req, req_index, *h->name, h->value); | 215 | 0 | } | 216 | 0 | } | 217 | 1.61k | } |
Unexecuted instantiation: http3client.c:h2o_probe_log_response Unexecuted instantiation: connect.c:h2o_probe_log_response |
218 | | |
219 | | #endif |
220 | | |
221 | | #endif |