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 | 45.9k | do { \ |
29 | 45.9k | PTLS_LOG_DEFINE_POINT(h2o, _name, logpoint); \ |
30 | 45.9k | uint32_t active = ptls_log_point_maybe_active(&logpoint); \ |
31 | 45.9k | if (PTLS_LIKELY(active == 0)) \ |
32 | 45.9k | break; \ |
33 | 45.9k | 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, (const char *(*)(void *))h2o_socket_get_ssl_server_name, sock_); \ |
36 | 0 | if (PTLS_LIKELY(active == 0)) \ |
37 | 0 | break; \ |
38 | 0 | PTLS_LOG__DO_LOG(h2o, _name, conn_state, (const char *(*)(void *))h2o_socket_get_ssl_server_name, 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 | 69.9k | do { \ |
47 | 69.9k | PTLS_LOG_DEFINE_POINT(h2o, _name, logpoint); \ |
48 | 69.9k | uint32_t active = ptls_log_point_maybe_active(&logpoint); \ |
49 | 69.9k | if (active == 0) \ |
50 | 69.9k | break; \ |
51 | 69.9k | 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, (const char *(*)(void *))conn_->callbacks->get_ssl_server_name, conn_); \ |
54 | 0 | if (active == 0) \ |
55 | 0 | break; \ |
56 | 0 | PTLS_LOG__DO_LOG(h2o, _name, conn_state, (const char *(*)(void *))conn_->callbacks->get_ssl_server_name, 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 | 81.8k | #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 | 22.5k | { |
167 | 22.5k | H2O_PROBE_CONN(RECEIVE_REQUEST, req->conn, req_index, req->version); |
168 | 22.5k | H2O_LOG_CONN(receive_request, req->conn, { |
169 | 22.5k | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); |
170 | 22.5k | PTLS_LOG_ELEMENT_SIGNED(http_version, req->version); |
171 | 22.5k | }); |
172 | | |
173 | 22.5k | PTLS_LOG_DEFINE_POINT(h2o, receive_request_header, receive_request_header_logpoint); |
174 | 22.5k | if (H2O_PROBE_IS_ENABLED(RECEIVE_REQUEST_HEADER) || |
175 | 22.5k | (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), |
178 | 0 | (const char *(*)(void *))req->conn->callbacks->get_ssl_server_name, req->conn)) != 0)) { |
179 | 0 | if (req->input.authority.base != NULL) |
180 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_AUTHORITY->buf, req->input.authority); |
181 | 0 | if (req->input.method.base != NULL) |
182 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_METHOD->buf, req->input.method); |
183 | 0 | if (req->input.path.base != NULL) |
184 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_PATH->buf, req->input.path); |
185 | 0 | if (req->input.scheme != NULL) |
186 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_SCHEME->buf, req->input.scheme->name); |
187 | 0 | size_t i; |
188 | 0 | for (i = 0; i != req->headers.size; ++i) { |
189 | 0 | h2o_header_t *h = req->headers.entries + i; |
190 | 0 | h2o_probe_request_header(req, req_index, *h->name, h->value); |
191 | 0 | } |
192 | 0 | } |
193 | 22.5k | } http1.c:h2o_probe_log_request Line | Count | Source | 166 | 8.40k | { | 167 | 8.40k | H2O_PROBE_CONN(RECEIVE_REQUEST, req->conn, req_index, req->version); | 168 | 8.40k | H2O_LOG_CONN(receive_request, req->conn, { | 169 | 8.40k | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); | 170 | 8.40k | PTLS_LOG_ELEMENT_SIGNED(http_version, req->version); | 171 | 8.40k | }); | 172 | | | 173 | 8.40k | PTLS_LOG_DEFINE_POINT(h2o, receive_request_header, receive_request_header_logpoint); | 174 | 8.40k | if (H2O_PROBE_IS_ENABLED(RECEIVE_REQUEST_HEADER) || | 175 | 8.40k | (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), | 178 | 0 | (const char *(*)(void *))req->conn->callbacks->get_ssl_server_name, req->conn)) != 0)) { | 179 | 0 | if (req->input.authority.base != NULL) | 180 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_AUTHORITY->buf, req->input.authority); | 181 | 0 | if (req->input.method.base != NULL) | 182 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_METHOD->buf, req->input.method); | 183 | 0 | if (req->input.path.base != NULL) | 184 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_PATH->buf, req->input.path); | 185 | 0 | if (req->input.scheme != NULL) | 186 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_SCHEME->buf, req->input.scheme->name); | 187 | 0 | size_t i; | 188 | 0 | for (i = 0; i != req->headers.size; ++i) { | 189 | 0 | h2o_header_t *h = req->headers.entries + i; | 190 | 0 | h2o_probe_request_header(req, req_index, *h->name, h->value); | 191 | 0 | } | 192 | 0 | } | 193 | 8.40k | } |
connection.c:h2o_probe_log_request Line | Count | Source | 166 | 12.0k | { | 167 | 12.0k | H2O_PROBE_CONN(RECEIVE_REQUEST, req->conn, req_index, req->version); | 168 | 12.0k | H2O_LOG_CONN(receive_request, req->conn, { | 169 | 12.0k | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); | 170 | 12.0k | PTLS_LOG_ELEMENT_SIGNED(http_version, req->version); | 171 | 12.0k | }); | 172 | | | 173 | 12.0k | PTLS_LOG_DEFINE_POINT(h2o, receive_request_header, receive_request_header_logpoint); | 174 | 12.0k | if (H2O_PROBE_IS_ENABLED(RECEIVE_REQUEST_HEADER) || | 175 | 12.0k | (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), | 178 | 0 | (const char *(*)(void *))req->conn->callbacks->get_ssl_server_name, req->conn)) != 0)) { | 179 | 0 | if (req->input.authority.base != NULL) | 180 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_AUTHORITY->buf, req->input.authority); | 181 | 0 | if (req->input.method.base != NULL) | 182 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_METHOD->buf, req->input.method); | 183 | 0 | if (req->input.path.base != NULL) | 184 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_PATH->buf, req->input.path); | 185 | 0 | if (req->input.scheme != NULL) | 186 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_SCHEME->buf, req->input.scheme->name); | 187 | 0 | size_t i; | 188 | 0 | for (i = 0; i != req->headers.size; ++i) { | 189 | 0 | h2o_header_t *h = req->headers.entries + i; | 190 | 0 | h2o_probe_request_header(req, req_index, *h->name, h->value); | 191 | 0 | } | 192 | 0 | } | 193 | 12.0k | } |
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.08k | { | 167 | 2.08k | H2O_PROBE_CONN(RECEIVE_REQUEST, req->conn, req_index, req->version); | 168 | 2.08k | H2O_LOG_CONN(receive_request, req->conn, { | 169 | 2.08k | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); | 170 | 2.08k | PTLS_LOG_ELEMENT_SIGNED(http_version, req->version); | 171 | 2.08k | }); | 172 | | | 173 | 2.08k | PTLS_LOG_DEFINE_POINT(h2o, receive_request_header, receive_request_header_logpoint); | 174 | 2.08k | if (H2O_PROBE_IS_ENABLED(RECEIVE_REQUEST_HEADER) || | 175 | 2.08k | (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), | 178 | 0 | (const char *(*)(void *))req->conn->callbacks->get_ssl_server_name, req->conn)) != 0)) { | 179 | 0 | if (req->input.authority.base != NULL) | 180 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_AUTHORITY->buf, req->input.authority); | 181 | 0 | if (req->input.method.base != NULL) | 182 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_METHOD->buf, req->input.method); | 183 | 0 | if (req->input.path.base != NULL) | 184 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_PATH->buf, req->input.path); | 185 | 0 | if (req->input.scheme != NULL) | 186 | 0 | h2o_probe_request_header(req, req_index, H2O_TOKEN_SCHEME->buf, req->input.scheme->name); | 187 | 0 | size_t i; | 188 | 0 | for (i = 0; i != req->headers.size; ++i) { | 189 | 0 | h2o_header_t *h = req->headers.entries + i; | 190 | 0 | h2o_probe_request_header(req, req_index, *h->name, h->value); | 191 | 0 | } | 192 | 0 | } | 193 | 2.08k | } |
Unexecuted instantiation: http3client.c:h2o_probe_log_request Unexecuted instantiation: connect.c:h2o_probe_log_request |
194 | | |
195 | | static inline void h2o_probe_log_response(h2o_req_t *req, uint64_t req_index) |
196 | 18.3k | { |
197 | 18.3k | H2O_PROBE_CONN(SEND_RESPONSE, req->conn, req_index, req->res.status); |
198 | 18.3k | H2O_LOG_CONN(send_response, req->conn, { |
199 | 18.3k | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); |
200 | 18.3k | PTLS_LOG_ELEMENT_SIGNED(status, req->res.status); |
201 | 18.3k | }); |
202 | 18.3k | PTLS_LOG_DEFINE_POINT(h2o, send_response_header, send_response_header_logpoint); |
203 | 18.3k | if (H2O_PROBE_IS_ENABLED(SEND_RESPONSE_HEADER) || |
204 | 18.3k | (ptls_log_point_maybe_active(&send_response_header_logpoint) != 0 && |
205 | 0 | (send_response_header_logpoint.state.active_conns & |
206 | 0 | ptls_log_conn_maybe_active(req->conn->callbacks->log_state(req->conn), |
207 | 0 | (const char *(*)(void *))req->conn->callbacks->get_ssl_server_name, req->conn)) != 0)) { |
208 | 0 | if (req->res.content_length != SIZE_MAX) { |
209 | 0 | char buf[sizeof(H2O_SIZE_T_LONGEST_STR)]; |
210 | 0 | size_t len = (size_t)sprintf(buf, "%zu", req->res.content_length); |
211 | 0 | h2o_probe_response_header(req, req_index, H2O_TOKEN_CONTENT_LENGTH->buf, h2o_iovec_init(buf, len)); |
212 | 0 | } |
213 | 0 | size_t i; |
214 | 0 | for (i = 0; i != req->res.headers.size; ++i) { |
215 | 0 | h2o_header_t *h = req->res.headers.entries + i; |
216 | 0 | h2o_probe_response_header(req, req_index, *h->name, h->value); |
217 | 0 | } |
218 | 0 | } |
219 | 18.3k | } http1.c:h2o_probe_log_response Line | Count | Source | 196 | 9.11k | { | 197 | 9.11k | H2O_PROBE_CONN(SEND_RESPONSE, req->conn, req_index, req->res.status); | 198 | 9.11k | H2O_LOG_CONN(send_response, req->conn, { | 199 | 9.11k | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); | 200 | 9.11k | PTLS_LOG_ELEMENT_SIGNED(status, req->res.status); | 201 | 9.11k | }); | 202 | 9.11k | PTLS_LOG_DEFINE_POINT(h2o, send_response_header, send_response_header_logpoint); | 203 | 9.11k | if (H2O_PROBE_IS_ENABLED(SEND_RESPONSE_HEADER) || | 204 | 9.11k | (ptls_log_point_maybe_active(&send_response_header_logpoint) != 0 && | 205 | 0 | (send_response_header_logpoint.state.active_conns & | 206 | 0 | ptls_log_conn_maybe_active(req->conn->callbacks->log_state(req->conn), | 207 | 0 | (const char *(*)(void *))req->conn->callbacks->get_ssl_server_name, req->conn)) != 0)) { | 208 | 0 | if (req->res.content_length != SIZE_MAX) { | 209 | 0 | char buf[sizeof(H2O_SIZE_T_LONGEST_STR)]; | 210 | 0 | size_t len = (size_t)sprintf(buf, "%zu", req->res.content_length); | 211 | 0 | h2o_probe_response_header(req, req_index, H2O_TOKEN_CONTENT_LENGTH->buf, h2o_iovec_init(buf, len)); | 212 | 0 | } | 213 | 0 | size_t i; | 214 | 0 | for (i = 0; i != req->res.headers.size; ++i) { | 215 | 0 | h2o_header_t *h = req->res.headers.entries + i; | 216 | 0 | h2o_probe_response_header(req, req_index, *h->name, h->value); | 217 | 0 | } | 218 | 0 | } | 219 | 9.11k | } |
Unexecuted instantiation: connection.c:h2o_probe_log_response stream.c:h2o_probe_log_response Line | Count | Source | 196 | 7.65k | { | 197 | 7.65k | H2O_PROBE_CONN(SEND_RESPONSE, req->conn, req_index, req->res.status); | 198 | 7.65k | H2O_LOG_CONN(send_response, req->conn, { | 199 | 7.65k | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); | 200 | 7.65k | PTLS_LOG_ELEMENT_SIGNED(status, req->res.status); | 201 | 7.65k | }); | 202 | 7.65k | PTLS_LOG_DEFINE_POINT(h2o, send_response_header, send_response_header_logpoint); | 203 | 7.65k | if (H2O_PROBE_IS_ENABLED(SEND_RESPONSE_HEADER) || | 204 | 7.65k | (ptls_log_point_maybe_active(&send_response_header_logpoint) != 0 && | 205 | 0 | (send_response_header_logpoint.state.active_conns & | 206 | 0 | ptls_log_conn_maybe_active(req->conn->callbacks->log_state(req->conn), | 207 | 0 | (const char *(*)(void *))req->conn->callbacks->get_ssl_server_name, req->conn)) != 0)) { | 208 | 0 | if (req->res.content_length != SIZE_MAX) { | 209 | 0 | char buf[sizeof(H2O_SIZE_T_LONGEST_STR)]; | 210 | 0 | size_t len = (size_t)sprintf(buf, "%zu", req->res.content_length); | 211 | 0 | h2o_probe_response_header(req, req_index, H2O_TOKEN_CONTENT_LENGTH->buf, h2o_iovec_init(buf, len)); | 212 | 0 | } | 213 | 0 | size_t i; | 214 | 0 | for (i = 0; i != req->res.headers.size; ++i) { | 215 | 0 | h2o_header_t *h = req->res.headers.entries + i; | 216 | 0 | h2o_probe_response_header(req, req_index, *h->name, h->value); | 217 | 0 | } | 218 | 0 | } | 219 | 7.65k | } |
Unexecuted instantiation: common.c:h2o_probe_log_response server.c:h2o_probe_log_response Line | Count | Source | 196 | 1.56k | { | 197 | 1.56k | H2O_PROBE_CONN(SEND_RESPONSE, req->conn, req_index, req->res.status); | 198 | 1.56k | H2O_LOG_CONN(send_response, req->conn, { | 199 | 1.56k | PTLS_LOG_ELEMENT_UNSIGNED(req_id, req_index); | 200 | 1.56k | PTLS_LOG_ELEMENT_SIGNED(status, req->res.status); | 201 | 1.56k | }); | 202 | 1.56k | PTLS_LOG_DEFINE_POINT(h2o, send_response_header, send_response_header_logpoint); | 203 | 1.56k | if (H2O_PROBE_IS_ENABLED(SEND_RESPONSE_HEADER) || | 204 | 1.56k | (ptls_log_point_maybe_active(&send_response_header_logpoint) != 0 && | 205 | 0 | (send_response_header_logpoint.state.active_conns & | 206 | 0 | ptls_log_conn_maybe_active(req->conn->callbacks->log_state(req->conn), | 207 | 0 | (const char *(*)(void *))req->conn->callbacks->get_ssl_server_name, req->conn)) != 0)) { | 208 | 0 | if (req->res.content_length != SIZE_MAX) { | 209 | 0 | char buf[sizeof(H2O_SIZE_T_LONGEST_STR)]; | 210 | 0 | size_t len = (size_t)sprintf(buf, "%zu", req->res.content_length); | 211 | 0 | h2o_probe_response_header(req, req_index, H2O_TOKEN_CONTENT_LENGTH->buf, h2o_iovec_init(buf, len)); | 212 | 0 | } | 213 | 0 | size_t i; | 214 | 0 | for (i = 0; i != req->res.headers.size; ++i) { | 215 | 0 | h2o_header_t *h = req->res.headers.entries + i; | 216 | 0 | h2o_probe_response_header(req, req_index, *h->name, h->value); | 217 | 0 | } | 218 | 0 | } | 219 | 1.56k | } |
Unexecuted instantiation: http3client.c:h2o_probe_log_response Unexecuted instantiation: connect.c:h2o_probe_log_response |
220 | | |
221 | | #endif |
222 | | |
223 | | #endif |