Artifactspublic-v0

curl

master
ply4 git calls30 ms290 KiB3 cachedprotocol v2
347 lines12 KiBRaw
1#ifndef HEADER_CURL_TRC_H
2#define HEADER_CURL_TRC_H
3/***************************************************************************
4 * _ _ ____ _
5 * Project ___| | | | _ \| |
6 * / __| | | | |_) | |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
9 *
10 * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
11 *
12 * This software is licensed as described in the file COPYING, which
13 * you should have received as part of this distribution. The terms
14 * are also available at https://curl.se/docs/copyright.html.
15 *
16 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 * copies of the Software, and permit persons to whom the Software is
18 * furnished to do so, under the terms of the COPYING file.
19 *
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
22 *
23 * SPDX-License-Identifier: curl
24 *
25 ***************************************************************************/
26struct Curl_easy;
27struct Curl_cfilter;
29/**
30 * Init logging, return != 0 on failure.
31 */
32CURLcode Curl_trc_init(void);
34/**
35 * Configure tracing. May be called several times during global
36 * initialization. Later calls may not take effect.
37 *
38 * Configuration format supported:
39 * - comma-separated list of component names to enable logging on.
40 * E.g. 'http/2,ssl'. Unknown names are ignored. Names are compared
41 * case-insensitive.
42 * - component 'all' applies to all known log components
43 * - prefixing a component with '+' or '-' will en-/disable logging for
44 * that component
45 * Example: 'all,-ssl' would enable logging for all components but the
46 * SSL filters.
47 *
48 * @param config configuration string
49 */
50CURLcode Curl_trc_opt(const char *config);
52/* the function used to output verbose information */
53void Curl_debug(struct Curl_easy *data, curl_infotype type,
54 const char *ptr, size_t size);
56/**
57 * Output a failure message on registered callbacks for transfer.
58 */
59void Curl_failf(struct Curl_easy *data,
60 const char *fmt, ...) CURL_PRINTF(2, 3);
62#define failf Curl_failf
64/* In case failf() reported into the errorbuf, clear it again.
65 * This is used to clear information from happy eyeballing attempts
66 * when ultimately a successful attempt was made. */
67void Curl_reset_fail(struct Curl_easy *data);
69#define CURL_LOG_LVL_NONE 0
70#define CURL_LOG_LVL_INFO 1
72/**
73 * Output an informational message when transfer's verbose logging is enabled.
74 */
75void Curl_infof(struct Curl_easy *data,
76 const char *fmt, ...) CURL_PRINTF(2, 3);
78/**
79 * Output an informational message when both transfer's verbose logging
80 * and connection filters verbose logging are enabled.
81 */
82void Curl_trc_cf_infof(struct Curl_easy *data, const struct Curl_cfilter *cf,
83 const char *fmt, ...) CURL_PRINTF(3, 4);
84void Curl_trc_multi(struct Curl_easy *data,
85 const char *fmt, ...) CURL_PRINTF(2, 3);
86const char *Curl_trc_mstate_name(int state);
87const char *Curl_trc_timer_name(int tid);
88void Curl_trc_easy_timers(struct Curl_easy *data);
90void Curl_trc_write(struct Curl_easy *data,
91 const char *fmt, ...) CURL_PRINTF(2, 3);
92void Curl_trc_read(struct Curl_easy *data,
93 const char *fmt, ...) CURL_PRINTF(2, 3);
94void Curl_trc_dns(struct Curl_easy *data,
95 const char *fmt, ...) CURL_PRINTF(2, 3);
96void Curl_trc_timer(struct Curl_easy *data, int tid,
97 const char *fmt, ...) CURL_PRINTF(3, 4);
99struct curl_trc_feat {
100 const char *name;
101 int log_level;
102};
104void Curl_trc_feat_infof(struct Curl_easy *data,
105 struct curl_trc_feat *feat,
106 const char *fmt, ...) CURL_PRINTF(3, 4);
108#ifndef CURL_DISABLE_FTP
109extern struct curl_trc_feat Curl_trc_feat_ftp;
110void Curl_trc_ftp(struct Curl_easy *data,
111 const char *fmt, ...) CURL_PRINTF(2, 3);
112#endif
113#ifndef CURL_DISABLE_SMTP
114extern struct curl_trc_feat Curl_trc_feat_smtp;
115void Curl_trc_smtp(struct Curl_easy *data,
116 const char *fmt, ...) CURL_PRINTF(2, 3);
117#endif
118#ifdef USE_SSL
119extern struct curl_trc_feat Curl_trc_feat_ssls;
120void Curl_trc_ssls(struct Curl_easy *data,
121 const char *fmt, ...) CURL_PRINTF(2, 3);
122#endif
123#ifdef USE_SSH
124extern struct curl_trc_feat Curl_trc_feat_ssh;
125void Curl_trc_ssh(struct Curl_easy *data,
126 const char *fmt, ...) CURL_PRINTF(2, 3);
127#endif
128#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)
129extern struct curl_trc_feat Curl_trc_feat_ws;
130void Curl_trc_ws(struct Curl_easy *data,
131 const char *fmt, ...) CURL_PRINTF(2, 3);
132#endif
134#define CURL_TRC_M_is_verbose(data) \
135 Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
136#define CURL_TRC_DNS_is_verbose(data) \
137 Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
138#define CURL_TRC_TIMER_is_verbose(data) \
139 Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer)
141#if defined(CURL_HAVE_MACRO_VARARG) && !defined(CURL_DISABLE_VERBOSE_STRINGS)
142#define infof(data, ...) \
143 do { \
144 if(Curl_trc_is_verbose(data)) \
145 Curl_infof(data, __VA_ARGS__); \
146 } while(0)
147#define CURL_TRC_M(data, ...) \
148 do { \
149 if(CURL_TRC_M_is_verbose(data)) \
150 Curl_trc_multi(data, __VA_ARGS__); \
151 } while(0)
152#define CURL_TRC_CF(data, cf, ...) \
153 do { \
154 if(Curl_trc_cf_is_verbose(cf, data)) \
155 Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
156 } while(0)
157#define CURL_TRC_WRITE(data, ...) \
158 do { \
159 if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
160 Curl_trc_write(data, __VA_ARGS__); \
161 } while(0)
162#define CURL_TRC_READ(data, ...) \
163 do { \
164 if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
165 Curl_trc_read(data, __VA_ARGS__); \
166 } while(0)
167#define CURL_TRC_DNS(data, ...) \
168 do { \
169 if(CURL_TRC_DNS_is_verbose(data)) \
170 Curl_trc_dns(data, __VA_ARGS__); \
171 } while(0)
172#define CURL_TRC_TIMER(data, tid, ...) \
173 do { \
174 if(CURL_TRC_TIMER_is_verbose(data)) \
175 Curl_trc_timer(data, tid, __VA_ARGS__); \
176 } while(0)
178#ifndef CURL_DISABLE_FTP
179#define CURL_TRC_FTP(data, ...) \
180 do { \
181 if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
182 Curl_trc_ftp(data, __VA_ARGS__); \
183 } while(0)
184#endif /* !CURL_DISABLE_FTP */
185#ifndef CURL_DISABLE_SMTP
186#define CURL_TRC_SMTP(data, ...) \
187 do { \
188 if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_smtp)) \
189 Curl_trc_smtp(data, __VA_ARGS__); \
190 } while(0)
191#endif /* !CURL_DISABLE_SMTP */
192#ifdef USE_SSL
193#define CURL_TRC_SSLS(data, ...) \
194 do { \
195 if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \
196 Curl_trc_ssls(data, __VA_ARGS__); \
197 } while(0)
198#endif /* USE_SSL */
199#ifdef USE_SSH
200#define CURL_TRC_SSH(data, ...) \
201 do { \
202 if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssh)) \
203 Curl_trc_ssh(data, __VA_ARGS__); \
204 } while(0)
205#endif /* USE_SSH */
206#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)
207#define CURL_TRC_WS(data, ...) \
208 do { \
209 if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ws)) \
210 Curl_trc_ws(data, __VA_ARGS__); \
211 } while(0)
212#endif /* !CURL_DISABLE_WEBSOCKETS && !CURL_DISABLE_HTTP */
214#elif defined(CURL_HAVE_MACRO_VARARG) && defined(CURL_DISABLE_VERBOSE_STRINGS)
216#define infof(data, ...) \
217 do { \
218 (void)(data); \
219 } while(0)
220#define CURL_TRC_M(data, ...) \
221 do { \
222 (void)(data); \
223 } while(0)
224#define CURL_TRC_CF(data, cf, ...) \
225 do { \
226 (void)(data); \
227 (void)(cf); \
228 } while(0)
229#define CURL_TRC_WRITE(data, ...) \
230 do { \
231 (void)(data); \
232 } while(0)
233#define CURL_TRC_READ(data, ...) \
234 do { \
235 (void)(data); \
236 } while(0)
237#define CURL_TRC_DNS(data, ...) \
238 do { \
239 (void)(data); \
240 } while(0)
241#define CURL_TRC_TIMER(data, tid, ...) \
242 do { \
243 (void)(data); \
244 (void)(tid); \
245 } while(0)
246#ifndef CURL_DISABLE_FTP
247#define CURL_TRC_FTP(data, ...) \
248 do { \
249 (void)(data); \
250 } while(0)
251#endif /* !CURL_DISABLE_FTP */
252#ifndef CURL_DISABLE_SMTP
253#define CURL_TRC_SMTP(data, ...) \
254 do { \
255 (void)(data); \
256 } while(0)
257#endif /* !CURL_DISABLE_SMTP */
258#ifdef USE_SSL
259#define CURL_TRC_SSLS(data, ...) \
260 do { \
261 (void)(data); \
262 } while(0)
263#endif /* USE_SSL */
264#ifdef USE_SSH
265#define CURL_TRC_SSH(data, ...) \
266 do { \
267 (void)(data); \
268 } while(0)
269#endif /* USE_SSH */
270#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)
271#define CURL_TRC_WS(data, ...) \
272 do { \
273 (void)(data); \
274 } while(0)
275#endif
277#else /* !CURL_HAVE_MACRO_VARARG */
279#define infof Curl_infof
280#define CURL_TRC_M Curl_trc_multi
281#define CURL_TRC_CF Curl_trc_cf_infof
282#define CURL_TRC_WRITE Curl_trc_write
283#define CURL_TRC_READ Curl_trc_read
284#define CURL_TRC_DNS Curl_trc_dns
285#define CURL_TRC_TIMER Curl_trc_timer
287#ifndef CURL_DISABLE_FTP
288#define CURL_TRC_FTP Curl_trc_ftp
289#endif
290#ifndef CURL_DISABLE_SMTP
291#define CURL_TRC_SMTP Curl_trc_smtp
292#endif
293#ifdef USE_SSL
294#define CURL_TRC_SSLS Curl_trc_ssls
295#endif
296#ifdef USE_SSH
297#define CURL_TRC_SSH Curl_trc_ssh
298#endif
299#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)
300#define CURL_TRC_WS Curl_trc_ws
301#endif
303#endif /* CURL_HAVE_MACRO_VARARG */
305#ifdef CURLVERBOSE
306extern struct curl_trc_feat Curl_trc_feat_multi;
307extern struct curl_trc_feat Curl_trc_feat_read;
308extern struct curl_trc_feat Curl_trc_feat_write;
309extern struct curl_trc_feat Curl_trc_feat_dns;
310#ifndef CURL_DISABLE_DOH
311extern struct curl_trc_feat Curl_trc_feat_doh;
312#endif
313extern struct curl_trc_feat Curl_trc_feat_timer;
314#ifdef USE_THREADS
315extern struct curl_trc_feat Curl_trc_feat_threads;
316#endif
317#endif
319#ifndef CURL_DISABLE_VERBOSE_STRINGS
320/* informational messages enabled */
321#define Curl_trc_is_verbose(data) \
322 ((data) && (data)->set.verbose && \
323 (!(data)->state.feat || \
324 ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
325#define Curl_trc_cf_is_verbose(cf, data) \
326 (Curl_trc_is_verbose(data) && \
327 (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
328#define Curl_trc_ft_is_verbose(data, ft) \
329 (Curl_trc_is_verbose(data) && \
330 (ft)->log_level >= CURL_LOG_LVL_INFO)
331#define CURL_MSTATE_NAME(s) Curl_trc_mstate_name((int)(s))
332#define CURL_TRC_EASY_TIMERS(data) \
333 do { \
334 if(CURL_TRC_TIMER_is_verbose(data)) \
335 Curl_trc_easy_timers(data); \
336 } while(0)
338#else /* CURL_DISABLE_VERBOSE_STRINGS */
339/* All informational messages are not compiled in for size savings */
340#define Curl_trc_is_verbose(d) FALSE
341#define Curl_trc_cf_is_verbose(x, y) FALSE
342#define Curl_trc_ft_is_verbose(x, y) FALSE
343#define CURL_MSTATE_NAME(x) ((void)(x), "-")
344#define CURL_TRC_EASY_TIMERS(x) Curl_nop_stmt
345#endif /* !CURL_DISABLE_VERBOSE_STRINGS */
347#endif /* HEADER_CURL_TRC_H */
Diagnostics4 git calls · 30 ms
CallStatusSizeTime030 ms
discover200152 B2 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B · hit3 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=3
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch2002.8 KiB · hit25 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=25
git.response.bytes=2907
git.response.cache=HIT
git.response.duration_ms=25
git.fetch.wants=fc0e6dedcf9606fc00aae4c52eee45410b4471d0
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=2907
git.pkt.payload.max=2886
git.sideband.band1.bytes=2885
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e1e0884b1cd96e
Request
1aa2d41a…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format