master
1#!/usr/bin/env perl
2#***************************************************************************
3# _ _ ____ _
4# Project ___| | | | _ \| |
5# / __| | | | |_) | |
6# | (__| |_| | _ <| |___
7# \___|\___/|_| \_\_____|
8#
9# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
10#
11# This software is licensed as described in the file COPYING, which
12# you should have received as part of this distribution. The terms
13# are also available at https://curl.se/docs/copyright.html.
14#
15# You may opt to use, copy, modify, merge, publish, distribute and/or sell
16# copies of the Software, and permit persons to whom the Software is
17# furnished to do so, under the terms of the COPYING file.
18#
19# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20# KIND, either express or implied.
21#
22# SPDX-License-Identifier: curl
23#
24###########################################################################
25#
26# This script grew out of help from Przemyslaw Iskra and Balint Szilakszi
27# a late evening in the #curl IRC channel.
28#
30use strict;
31use warnings;
32use vars qw($Cpreprocessor);
34#
35# configurehelp perl module is generated by configure script
36#
37my $rc = eval {
38 require configurehelp;
39 configurehelp->import(qw(
40 $Cpreprocessor
41 ));
42 1;
43};
44# Set default values if configure has not generated a configurehelp.pm file.
45# This is the case with cmake.
46if(!$rc) {
47 $Cpreprocessor = 'cpp';
48}
50my $verbose = 0;
52# verbose mode when -v is the first argument
53if($ARGV[0] eq "-v") {
54 $verbose = 1;
55 shift;
56}
58# we may get the directory root pointed out
59my $root = $ARGV[0] || ".";
61# need an include directory when building out-of-tree
62my $i = ($ARGV[1]) ? "-I$ARGV[1] " : '';
64my $incdir = "$root/include/curl";
66my $summary = 0;
67my $misses = 0;
69my @syms;
71sub scanenums {
72 my ($file) = @_;
73 my $skipit = 0;
74 local $ENV{'MSYS2_ARG_CONV_EXCL'} = '/D';
76 open(H_IN, "-|", "$Cpreprocessor -DCURL_DISABLE_DEPRECATION $i$file") or
77 die "Cannot preprocess $file";
78 while(<H_IN>) {
79 my ($line, $linenum) = ($_, $.);
80 if(/^#(line|) (\d+) \"(.*)\"/) {
81 # if the included file is not in our incdir, then we skip this section
82 # until next #line
83 #
84 if($3 !~ /^$incdir/) {
85 $skipit = 1;
86 next;
87 }
88 # parse this!
89 $skipit = 0;
90 next;
91 }
92 if($skipit) {
93 next;
94 }
95 if(/^#/) {
96 next;
97 }
98 if(/enum\s+(\S+\s+)?{/ .. /}/) {
99 s/^\s+//;
100 chomp;
101 s/[,\s].*//;
102 if(($_ !~ /\}(;|)/) &&
103 ($_ ne "typedef") &&
104 ($_ ne "enum") &&
105 ($_ ne "=") &&
106 ($_ !~ /^\d+$/) &&
107 ($_ !~ /^[ \t]*$/)) {
108 if($verbose) {
109 print "Source: $Cpreprocessor $i$file\n";
110 print "Symbol: $_\n";
111 print "Line #$linenum: $line\n\n";
112 }
113 push @syms, $_;
114 }
115 }
116 }
117 close H_IN or die "Error preprocessing $file";
118}
120sub scanheader {
121 my ($f) = @_;
122 scanenums($f);
123 open(H, '<', $f);
124 while(<H>) {
125 my ($line, $linenum) = ($_, $.);
126 if(/^ *# *define +([^ \n]*)/) {
127 if($verbose) {
128 print "Source: $f\n";
129 print "Symbol: $1\n";
130 print "Line #$linenum: $line\n\n";
131 }
132 push @syms, $1;
133 }
134 }
135 close H;
136}
138opendir(my $dh, $incdir) or die "Cannot opendir $incdir: $!";
139my @hfiles = grep { /\.h$/ } readdir($dh);
140closedir $dh;
142for(@hfiles) {
143 scanheader("$incdir/$_");
144}
146my $errors = 0;
147for my $s (@syms) {
148 if($s !~ /^(lib|)curl/i) {
149 print "Bad symbols in public header files:\n" if(!$errors);
150 $errors++;
151 print " $s\n";
152 }
153}
154if($errors) {
155 exit 1;
156}
157printf "%d fine symbols found\n", scalar(@syms);
Diagnostics4 git calls · 37 ms
CallStatusSizeTime037 ms
discover200152 B3 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch 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 · hit4 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=30 git.response.bytes=293470 git.response.cache=HIT git.response.duration_ms=4 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=86Open pack map
fetch2001.8 KiB · hit30 ms
git.upload-pack fetch http.response.status_code=200 git.response.bytes=1819 git.response.cache=HIT git.response.duration_ms=30 git.fetch.wants=db4fa1c373186a478492c6f1e86f002646e6b162 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=1819 git.pkt.payload.max=1798 git.sideband.band1.bytes=1797 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
- a5e2dd7f5e4dc125
- Request
- 98b887fe…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format