Date: Fri, 28 May 2021 15:31:39 GMT From: Lutz Donnerhacke <donner@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 5434ebd256a0 - main - tests/libalias: Measure cleanup time separatly Message-ID: <202105281531.14SFVd94092584@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by donner: URL: https://cgit.FreeBSD.org/src/commit/?id=5434ebd256a08e452dec376c1488abdf7ff02af8 commit 5434ebd256a08e452dec376c1488abdf7ff02af8 Author: Lutz Donnerhacke <donner@FreeBSD.org> AuthorDate: 2021-05-28 15:29:10 +0000 Commit: Lutz Donnerhacke <donner@FreeBSD.org> 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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105281531.14SFVd94092584>