From owner-dev-commits-src-main@freebsd.org Fri May 28 15:31:39 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70F42655805; Fri, 28 May 2021 15:31:39 +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 4Fs7vb2jCBz3j3F; Fri, 28 May 2021 15:31:39 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 445B119A24; Fri, 28 May 2021 15:31:39 +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 14SFVdIr092585; Fri, 28 May 2021 15:31:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14SFVd94092584; Fri, 28 May 2021 15:31:39 GMT (envelope-from git) Date: Fri, 28 May 2021 15:31:39 GMT Message-Id: <202105281531.14SFVd94092584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lutz Donnerhacke Subject: git: 5434ebd256a0 - main - tests/libalias: Measure cleanup time separatly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: donner X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5434ebd256a08e452dec376c1488abdf7ff02af8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2021 15:31:39 -0000 The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=5434ebd256a08e452dec376c1488abdf7ff02af8 commit 5434ebd256a08e452dec376c1488abdf7ff02af8 Author: Lutz Donnerhacke AuthorDate: 2021-05-28 15:29:10 +0000 Commit: Lutz Donnerhacke CommitDate: 2021-05-28 15:29:10 +0000 tests/libalias: Measure cleanup time separatly After long test runs, a lot of ressouces can be allocated. Freeing them takes a considerable amount of time. --- tests/sys/netinet/libalias/perf.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/sys/netinet/libalias/perf.c b/tests/sys/netinet/libalias/perf.c index 3c0b0d593f4c..f238846bdb16 100644 --- a/tests/sys/netinet/libalias/perf.c +++ b/tests/sys/netinet/libalias/perf.c @@ -66,7 +66,7 @@ usage(void) { int main(int argc, char ** argv) { struct libalias *la; - struct timeval timeout; + struct timeval timeout, now, start; struct ip *p; struct udphdr *u; struct { @@ -141,7 +141,6 @@ int main(int argc, char ** argv) printf("RND SECOND newNAT RANDOM ATTACK useNAT\n"); for (round = 0; ; round++) { int res, cnt; - struct timeval now, start; printf("%3d ", round+1); @@ -279,7 +278,6 @@ out: printf("\n\n"); free(batch); free(p); - LibAliasUninit(la); printf("Results\n"); printf(" Rounds : %9u\n", round); @@ -300,5 +298,11 @@ out: usenat.ok + usenat.fail + random.ok + random.fail + attack.ok + attack.fail); + + gettimeofday(&start, NULL); + printf("\n Cleanup : "); + LibAliasUninit(la); + gettimeofday(&now, NULL); + printf("%.2fs\n", timevaldiff(now, start)/1000000l); return (0); }