From nobody Sat Jan 29 07:14:01 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E21E11970A55; Sat, 29 Jan 2022 07:14:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jm5Cs600wz3Qg8; Sat, 29 Jan 2022 07:14:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643440441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N8T62taJVJlUAsO/9l5oNjlHZpqleJyAJK4YUSWlybc=; b=a0xU1t9IgJzBQV0HXl4MEVz/tIzLZkjnV7wH9SmUZpNzE1OAzsisQJ8tCn1GUPuh1yDxCZ zgNSXahn/YrFrOu+vmMsxHW2fzChjiG6HDpGAKC3es9fvLQALVykQz+wgJdP9M2qL9W9i8 +npTsVbM0KX/KSLXmSOXfbwnrFX1pb/U0c0LcEiwyyOqQpBeQMad0DnGppnokOpPsLyIvI LaiWUlZHeKeiifG3CnR/0odS1yA5DYCxw/WkaumbXff+N576nZx+CcmRHSDlTmndFmP64L D+TMkz+1FYLP+KcjX70rq9Pi3fjs2fJJePKMjVrM23BHCVBH29iyQ4ty0lbwwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD7CF11A9D; Sat, 29 Jan 2022 07:14:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20T7E1J6024444; Sat, 29 Jan 2022 07:14:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20T7E1SD024443; Sat, 29 Jan 2022 07:14:01 GMT (envelope-from git) Date: Sat, 29 Jan 2022 07:14:01 GMT Message-Id: <202201290714.20T7E1SD024443@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: 9146546eaee3 - main - locate statistics: show number of longest path in database List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9146546eaee3e04e0d77f42b3a4fe4cd207021c6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643440441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N8T62taJVJlUAsO/9l5oNjlHZpqleJyAJK4YUSWlybc=; b=BuXbgFOyAIincsezKxP+quUYdg1Ctuxo9tDdjocZtkZWJuVA7sN3vzLyJwnfbgi+Dy5DGp B2CxjXiA0QIoJzuaskEfwKkXQrbRH9tCoGJaGEYyeifWCwqi1qo/oGbBbEM5GDRQd0hDYC 7DBlO4CO3rESJzQkvQwtVmz7XFVCMy7MBLWKotjcepNsTMquIAxB+RLL3pt8zJUSCGJejG /GLgyk3QuZkgXsSOgqfId4R54xtYOU7RHcyzqEhgE3s61RwjEypjYiGHzHVk+yuJ4pM9ai F/xTeEIJMKpHWf4Edvz1IL2tXltAawGBBh5jWoRanfj2hP6WpebKK7S3OgavJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643440441; a=rsa-sha256; cv=none; b=SvJsm3TT16MEzNlCbFhWA5oJvCiU7ylyB9tHDW7T1OW/QLj/d+15mDTEQeUwUftHYJwqMs Gw1w0AhQ2fIf0wOgxgE/itJW1+ZKn3vAcuwBb9721NAvxdkl+4+KVeBKnK5yDtmkqcW50Q 9GOZELSJ+upbqfnGunKFsP5qzi23WRfFV0zwRBoVUBn0+jDyoOd+N4i/g2Xz9dlYp6vwR7 lwGHBQA+egeKdplBAR6Uf2OkiK3o4iuXuehab9V2yMprUXQ0s8vlbI4OAMZzY33CEXfpp/ xC11G3y5Zn/dLIpbxe6nzS9IFwEL6RaVx7z9HyuxL1KCczo0Q2FSft8iP+vv4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=9146546eaee3e04e0d77f42b3a4fe4cd207021c6 commit 9146546eaee3e04e0d77f42b3a4fe4cd207021c6 Author: Wolfram Schneider AuthorDate: 2022-01-29 07:13:28 +0000 Commit: Wolfram Schneider CommitDate: 2022-01-29 07:13:28 +0000 locate statistics: show number of longest path in database --- usr.bin/locate/locate/fastfind.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c index fdbbb1c3db18..4cae9381024d 100644 --- a/usr.bin/locate/locate/fastfind.c +++ b/usr.bin/locate/locate/fastfind.c @@ -47,7 +47,7 @@ statistic (fp, path_fcodes) long lines, chars, size, big, zwerg, umlaut; register u_char *p, *s; register int c; - int count; + int count, longest_path; int error = 0; u_char bigram1[NBG], bigram2[NBG], path[MAXPATHLEN]; @@ -56,7 +56,7 @@ statistic (fp, path_fcodes) s[c] = check_bigram_char(getc(fp)); } - lines = chars = big = zwerg = umlaut = 0; + lines = chars = big = zwerg = umlaut = longest_path = 0; size = NBG + NBG; for (c = getc(fp), count = 0; c != EOF; size++) { @@ -91,6 +91,8 @@ statistic (fp, path_fcodes) p++; lines++; chars += (p - path); + if ((p - path) > longest_path) + longest_path = p - path; } (void)printf("\nDatabase: %s\n", path_fcodes); @@ -105,6 +107,7 @@ statistic (fp, path_fcodes) (void)printf("Bigram characters: %ld, ", big); (void)printf("Integers: %ld, ", zwerg); (void)printf("8-Bit characters: %ld\n", umlaut); + printf("Longest path: %d\n", longest_path - 1); /* non zero exit on corrupt database */ if (error)