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###########################################################################
26use strict;
27use warnings;
29my $autotools = $ARGV[0];
30my $cmake = $ARGV[1];
32if(!$cmake) {
33 print "Usage: cmp-config <config1> <config2.h>\n";
34 exit;
35}
37# this lists complete lines that are removed from the output if matching
38my %remove = (
39 '#define CURL_EXTERN_SYMBOL' => 1,
40 '#define CURL_OS "Linux"' => 1,
41 '#define CURL_OS "aarch64-unknown-linux-gnu"' => 1,
42 '#define CURL_OS "x86_64-pc-linux-gnu"' => 1,
43 '#define GETHOSTNAME_TYPE_ARG2 int' => 1,
44 '#define GETHOSTNAME_TYPE_ARG2 size_t' => 1,
45 '#define HAVE_BROTLI 1' => 1,
46 '#define HAVE_BROTLI_DECODE_H 1' => 1,
47 '#define HAVE_DLFCN_H 1' => 1,
48 '#define HAVE_GSSAPI_GSSAPI_GENERIC_H 1' => 1,
49 '#define HAVE_GSSAPI_GSSAPI_H 1' => 1,
50 '#define HAVE_GSSAPI_GSSAPI_KRB5_H 1' => 1,
51 '#define HAVE_INTTYPES_H 1' => 1,
52 '#define HAVE_LDAP_H 1' => 1,
53 '#define HAVE_LDAP_SSL 1' => 1,
54 '#define HAVE_LIBBROTLIDEC 1' => 1,
55 '#define HAVE_LIBPSL_H 1' => 1,
56 '#define HAVE_LIBSOCKET 1' => 1,
57 '#define HAVE_LIBSSH' => 1,
58 '#define HAVE_LIBSSH2 1' => 1,
59 '#define HAVE_LIBSSL 1' => 1,
60 '#define HAVE_LIBZSTD 1' => 1,
61 '#define HAVE_NGHTTP2_NGHTTP2_H 1' => 1,
62 '#define HAVE_NGHTTP3_NGHTTP3_H 1' => 1,
63 '#define HAVE_NGTCP2_NGTCP2_CRYPTO_H 1' => 1,
64 '#define HAVE_NGTCP2_NGTCP2_H 1' => 1,
65 '#define HAVE_OPENSSL_CRYPTO_H 1' => 1,
66 '#define HAVE_OPENSSL_ERR_H 1' => 1,
67 '#define HAVE_OPENSSL_PEM_H 1' => 1,
68 '#define HAVE_OPENSSL_RSA_H 1' => 1,
69 '#define HAVE_OPENSSL_SSL_H 1' => 1,
70 '#define HAVE_QUICHE_H 1' => 1,
71 '#define HAVE_SSL_SET_QUIC_TLS_CBS 1' => 1,
72 '#define HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT 1' => 1,
73 '#define HAVE_STDINT_H 1' => 1,
74 '#define HAVE_STDIO_H 1' => 1,
75 '#define HAVE_STDLIB_H 1' => 1,
76 '#define HAVE_STRING_H 1' => 1,
77 '#define HAVE_SYS_STAT_H 1' => 1,
78 '#define HAVE_SYS_XATTR_H 1' => 1,
79 '#define HAVE_UNICODE_UIDNA_H 1' => 1,
80 '#define HAVE_WOLFSSL_SET_QUIC_USE_LEGACY_CODEPOINT 1' => 1,
81 '#define HAVE_ZSTD 1' => 1,
82 '#define HAVE_ZSTD_H 1' => 1,
83 '#define LT_OBJDIR ".libs/"' => 1,
84 '#define NEED_LBER_H 1' => 1,
85 '#define PACKAGE "curl"' => 1,
86 '#define PACKAGE_BUGREPORT "a suitable curl mailing list: https://curl.se/mail/"' => 1,
87 '#define PACKAGE_NAME "curl"' => 1,
88 '#define PACKAGE_STRING "curl -"' => 1,
89 '#define PACKAGE_TARNAME "curl"' => 1,
90 '#define PACKAGE_URL ""' => 1,
91 '#define PACKAGE_VERSION "-"' => 1,
92 '#define STDC_HEADERS 1' => 1,
93 '#define VERSION "-"' => 1,
94 '#define _FILE_OFFSET_BITS 64' => 1,
95 );
97sub filter {
98 my ($line) = @_;
99 if(!$remove{$line}) {
100 return "$line\n";
101 }
102 $remove{$line}++;
103 return "";
104}
106sub grepit {
107 my ($input, $output) = @_;
108 my @defines;
109 # first get all the #define lines
110 open(F, "<", $input);
111 while(<F>) {
112 if($_ =~ /^#def/) {
113 chomp;
114 push @defines, $_;
115 }
116 }
117 close(F);
119 open(O, ">", $output);
121 # output the sorted list through the filter
122 foreach my $d(sort @defines) {
123 print O filter($d);
124 }
125 close(O);
126}
128grepit($autotools, "/tmp/autotools");
129grepit($cmake, "/tmp/cmake");
131foreach my $v (keys %remove) {
132 if($remove{$v} == 1) {
133 print "Ignored, never matched line: $v\n";
134 }
135}
137# return the exit code from diff
138exit system('diff', ('-u', '/tmp/autotools', '/tmp/cmake')) >> 8;
Diagnostics4 git calls · 35 ms
CallStatusSizeTime035 ms
discover200152 B3 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 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 · hit3 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=3 git.response.bytes=293470 git.response.cache=HIT git.response.duration_ms=3 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.6 KiB · hit29 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=29 git.response.bytes=1629 git.response.cache=HIT git.response.duration_ms=29 git.fetch.wants=b11cd00e13499d41313b5965bcbefecddc31f610 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=1629 git.pkt.payload.max=1608 git.sideband.band1.bytes=1607 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
- a5e14609de4a0bf5
- Request
- 48911b62…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format