3 * Measure performance of various operations (Unix-specific)
5 * (c) 2004 Straylight/Edgeware
8 /*----- Licensing notice --------------------------------------------------*
10 * This file is part of Catacomb.
12 * Catacomb is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Library General Public License as
14 * published by the Free Software Foundation; either version 2 of the
15 * License, or (at your option) any later version.
17 * Catacomb is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with Catacomb; if not, write to the Free
24 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
28 /*----- Header files ------------------------------------------------------*/
30 #define _FILE_OFFSET_BITS 64
42 #include <sys/types.h>
46 #ifdef HAVE_LINUX_PERF_EVENT_H
47 # include <linux/perf_event.h>
48 # include <asm/unistd.h>
51 #include <mLib/alloc.h>
52 #include <mLib/bits.h>
53 #include <mLib/dstr.h>
54 #include <mLib/mdwopt.h>
55 #include <mLib/quis.h>
56 #include <mLib/report.h>
68 #include "mpbarrett.h"
87 /*----- Options -----------------------------------------------------------*/
90 const char *name; /* Pre-configured named thing */
91 const char *opwhat; /* What to call operations */
92 unsigned fbits; /* Field size bits */
93 unsigned gbits; /* Group size bits */
94 unsigned n; /* Number of factors */
95 unsigned i; /* Number of intervals (or zero) */
96 unsigned k; /* Main loop batch size */
97 unsigned long sc; /* Scale factor */
98 double t; /* Time for each interval (secs) */
99 mp *e; /* Public exponent */
100 unsigned f; /* Flags */
101 #define OF_NOCHECK 1u /* Don't do group checking */
104 /*----- Job switch --------------------------------------------------------*/
106 /* --- Barrett exponentiation --- */
108 typedef struct bar_ctx {
114 static void *bar_init(opts *o)
116 bar_ctx *c = CREATE(bar_ctx);
123 if (dh_parse(&qd, &gp))
124 die(1, "bad prime group: %s", qd.e);
126 if (!o->fbits) o->fbits = 1024;
127 dh_gen(&gp, o->gbits, o->fbits, 0, &rand_global, pgen_evspin, 0);
129 mpbarrett_create(&c->b, gp.p);
132 c->e = xmalloc(c->n * sizeof(group_expfactor));
133 for (i = 0; i < c->n; i++) {
134 c->e[i].base = mprand_range(MP_NEW, gp.p, &rand_global, 0);
135 c->e[i].exp = mprand_range(MP_NEW, gp.q, &rand_global, 0);
141 static void bar_run(void *cc)
144 mp *d = mpbarrett_exp(&c->b, MP_NEW, c->e[0].base, c->e[0].exp);
148 static void barsim_run(void *cc)
151 mp *d = mpbarrett_mexp(&c->b, MP_NEW, c->e, c->n);
155 /* --- Montgomery exponentiation --- */
157 typedef struct mont_ctx {
163 static void *mont_init(opts *o)
165 mont_ctx *c = CREATE(mont_ctx);
172 if (dh_parse(&qd, &gp))
173 die(1, "bad prime group: %s", qd.e);
175 if (!o->fbits) o->fbits = 1024;
176 dh_gen(&gp, o->gbits, o->fbits, 0, &rand_global, pgen_evspin, 0);
178 mpmont_create(&c->m, gp.p);
181 c->e = xmalloc(c->n * sizeof(mp_expfactor));
182 for (i = 0; i < c->n; i++) {
183 c->e[i].base = mprand_range(MP_NEW, gp.p, &rand_global, 0);
184 c->e[i].exp = mprand_range(MP_NEW, gp.q, &rand_global, 0);
190 static void mont_run(void *cc)
193 mp *d = mpmont_expr(&c->m, MP_NEW, c->e[0].base, c->e[0].exp);
197 static void montsim_run(void *cc)
200 mp *d = mpmont_mexpr(&c->m, MP_NEW, c->e, c->n);
204 /* --- Group exponentiation --- */
206 typedef struct gr_ctx {
212 static void *grp_init(opts *o)
214 gr_ctx *c = CREATE(gr_ctx);
222 if (dh_parse(&qd, &gp))
223 die(1, "bad prime group: %s", qd.e);
225 if (!o->fbits) o->fbits = 1024;
226 dh_gen(&gp, o->gbits, o->fbits, 0, &rand_global, pgen_evspin, 0);
228 c->g = group_prime(&gp);
229 if (!(o->f & OF_NOCHECK) && (e = G_CHECK(c->g, &rand_global)) != 0)
230 die(1, "bad group: %s", e);
233 c->e = xmalloc(c->n * sizeof(group_expfactor));
234 for (i = 0; i < c->n; i++) {
235 c->e[i].base = G_CREATE(c->g);
236 G_FROMINT(c->g, c->e[i].base,
237 mprand_range(MP_NEW, gp.p, &rand_global, 0));
238 c->e[i].exp = mprand_range(MP_NEW, gp.q, &rand_global, 0);
244 static void *grec_init(opts *o)
246 gr_ctx *c = CREATE(gr_ctx);
253 die(1, "can't generate elliptic curves");
254 if ((e = ec_getinfo(&ei, o->name)) != 0)
255 die(1, "bad curve: %s", e);
256 c->g = group_ec(&ei);
257 if (!(o->f & OF_NOCHECK) && (e = G_CHECK(c->g, &rand_global)) != 0)
258 die(1, "bad group: %s", e);
261 c->e = xmalloc(c->n * sizeof(group_expfactor));
262 for (i = 0; i < c->n; i++) {
263 c->e[i].base = G_CREATE(c->g);
264 ec_rand(ei.c, &p, &rand_global);
265 G_FROMEC(c->g, c->e[i].base, &p);
266 c->e[i].exp = mprand_range(MP_NEW, ei.r, &rand_global, 0);
272 static void gr_run(void *cc)
275 ge *x = G_CREATE(c->g);
276 G_EXP(c->g, x, c->e[0].base, c->e[0].exp);
280 static void grsim_run(void *cc)
283 ge *x = G_CREATE(c->g);
284 G_MEXP(c->g, x, c->e, c->n);
290 typedef struct x25519_jobctx {
291 octet k[X25519_KEYSZ];
292 octet p[X25519_PUBSZ];
295 static void *x25519_jobinit(opts *o)
297 x25519_jobctx *c = CREATE(x25519_jobctx);
298 rand_get(RAND_GLOBAL, c->k, sizeof(c->k));
299 rand_get(RAND_GLOBAL, c->p, sizeof(c->p));
303 static void x25519_jobrun(void *cc)
304 { x25519_jobctx *c = cc; octet z[X25519_OUTSZ]; x25519(z, c->k, c->p); }
308 typedef struct x448_jobctx {
313 static void *x448_jobinit(opts *o)
315 x448_jobctx *c = CREATE(x448_jobctx);
316 rand_get(RAND_GLOBAL, c->k, sizeof(c->k));
317 rand_get(RAND_GLOBAL, c->p, sizeof(c->p));
321 static void x448_jobrun(void *cc)
322 { x448_jobctx *c = cc; octet z[X448_OUTSZ]; x448(z, c->k, c->p); }
324 /* --- Ed25519 --- */
326 typedef struct ed25519_signctx {
327 octet k[ED25519_KEYSZ];
328 octet K[ED25519_PUBSZ];
332 typedef struct ed25519_vrfctx {
333 octet K[ED25519_PUBSZ];
335 octet sig[ED25519_SIGSZ];
338 static void *ed25519_signinit(opts *o)
340 ed25519_signctx *c = CREATE(ed25519_signctx);
342 rand_get(RAND_GLOBAL, c->k, sizeof(c->k));
343 rand_get(RAND_GLOBAL, c->m, sizeof(c->m));
344 ed25519_pubkey(c->K, c->k, sizeof(c->k));
348 static void ed25519_signrun(void *cc)
350 ed25519_signctx *c = cc;
351 octet sig[ED25519_SIGSZ];
353 ed25519_sign(sig, c->k, sizeof(c->k), c->K, c->m, sizeof(c->m));
356 static void *ed25519_vrfinit(opts *o)
358 octet k[ED25519_KEYSZ];
359 ed25519_vrfctx *c = CREATE(ed25519_vrfctx);
361 rand_get(RAND_GLOBAL, k, sizeof(k));
362 rand_get(RAND_GLOBAL, c->m, sizeof(c->m));
363 ed25519_pubkey(c->K, k, sizeof(k));
364 ed25519_sign(c->sig, k, sizeof(k), c->K, c->m, sizeof(c->m));
368 static void ed25519_vrfrun(void *cc)
370 ed25519_vrfctx *c = cc;
371 ed25519_verify(c->K, c->m, sizeof(c->m), c->sig);
376 typedef struct ed448_signctx {
377 octet k[ED448_KEYSZ];
378 octet K[ED448_PUBSZ];
382 typedef struct ed448_vrfctx {
383 octet K[ED448_PUBSZ];
385 octet sig[ED448_SIGSZ];
388 static void *ed448_signinit(opts *o)
390 ed448_signctx *c = CREATE(ed448_signctx);
392 rand_get(RAND_GLOBAL, c->k, sizeof(c->k));
393 rand_get(RAND_GLOBAL, c->m, sizeof(c->m));
394 ed448_pubkey(c->K, c->k, sizeof(c->k));
398 static void ed448_signrun(void *cc)
400 ed448_signctx *c = cc;
401 octet sig[ED448_SIGSZ];
403 ed448_sign(sig, c->k, sizeof(c->k), c->K, 0, 0, 0, c->m, sizeof(c->m));
406 static void *ed448_vrfinit(opts *o)
408 octet k[ED448_KEYSZ];
409 ed448_vrfctx *c = CREATE(ed448_vrfctx);
411 rand_get(RAND_GLOBAL, k, sizeof(k));
412 rand_get(RAND_GLOBAL, c->m, sizeof(c->m));
413 ed448_pubkey(c->K, k, sizeof(k));
414 ed448_sign(c->sig, k, sizeof(k), c->K, 0, 0, 0, c->m, sizeof(c->m));
418 static void ed448_vrfrun(void *cc)
420 ed448_vrfctx *c = cc;
421 ed448_verify(c->K, 0, 0, 0, c->m, sizeof(c->m), c->sig);
426 typedef struct rsapriv_ctx {
432 static void *rsapriv_init(opts *o)
434 rsapriv_ctx *c = CREATE(rsapriv_ctx);
436 if (!o->fbits) o->fbits = 1024;
437 if (!o->e) o->e = mp_fromulong(MP_NEW, 65537);
438 rsa_gen_e(&c->rp, o->fbits, o->e, &rand_global, 0, pgen_evspin, 0);
439 rsa_privcreate(&c->rpc, &c->rp, 0);
440 c->m = mprand_range(MP_NEW, c->rp.n, &rand_global, 0);
444 static void *rsaprivblind_init(opts *o)
446 rsapriv_ctx *c = CREATE(rsapriv_ctx);
448 if (!o->fbits) o->fbits = 1024;
449 if (!o->e) o->e = mp_fromulong(MP_NEW, 65537);
450 rsa_gen_e(&c->rp, o->fbits, o->e, &rand_global, 0, pgen_evspin, 0);
451 rsa_privcreate(&c->rpc, &c->rp, fibrand_create(0));
452 c->m = mprand_range(MP_NEW, c->rp.n, &rand_global, 0);
456 static void rsapriv_run(void *cc)
459 mp *d = rsa_privop(&c->rpc, MP_NEW, c->m);
463 typedef struct rsapub_ctx {
469 static void *rsapub_init(opts *o)
471 rsapub_ctx *c = CREATE(rsapub_ctx);
474 if (!o->fbits) o->fbits = 1024;
475 if (!o->e) o->e = mp_fromulong(MP_NEW, 65537);
476 rsa_gen_e(&rp, o->fbits, o->e, &rand_global, 0, pgen_evspin, 0);
477 c->rp.n = MP_COPY(rp.n);
478 c->rp.e = MP_COPY(rp.e);
480 rsa_pubcreate(&c->rpc, &c->rp);
481 c->m = mprand_range(MP_NEW, c->rp.n, &rand_global, 0);
485 static void rsapub_run(void *cc)
488 mp *d = rsa_pubop(&c->rpc, MP_NEW, c->m);
492 /* --- Symmetric encryption --- */
494 typedef struct ksched_ctx {
500 static void *ksched_init(opts *o)
502 ksched_ctx *c = CREATE(ksched_ctx);
504 die(1, "must specify encryption scheme name");
505 if ((c->c = gcipher_byname(o->name)) == 0)
506 die(1, "encryption scheme `%s' not known", o->name);
507 c->ksz = keysz(o->fbits/8, c->c->keysz);
508 if (o->fbits%8 || (o->fbits && c->ksz != o->fbits/8))
509 die(1, "bad key size %u for %s", o->fbits, o->name);
510 c->k = xmalloc(c->ksz);
511 rand_get(RAND_GLOBAL, c->k, c->ksz);
515 static void ksched_run(void *cc)
518 gcipher *gc = GC_INIT(c->c, c->k, c->ksz);
522 typedef struct enc_ctx {
529 static void *enc_init(opts *o)
531 enc_ctx *c = CREATE(enc_ctx);
536 die(1, "must specify encryption scheme name");
537 if ((cc = gcipher_byname(o->name)) == 0)
538 die(1, "encryption scheme `%s' not known", o->name);
539 ksz = keysz(o->fbits/8, cc->keysz);
540 if (o->fbits%8 || (o->fbits && ksz != o->fbits/8))
541 die(1, "bad key size %u for %s", o->fbits, o->name);
543 rand_get(RAND_GLOBAL, k, ksz);
544 c->c = GC_INIT(cc, k, ksz);
546 c->sz = o->gbits ? o->gbits : 65536;
547 c->n = o->n ? o->n : 16;
548 o->opwhat = "byte"; o->sc = c->n*c->sz;
549 c->m = xmalloc(c->sz);
553 static void enc_run(void *cc)
557 for (i = 0; i < c->n; i++)
558 GC_ENCRYPT(c->c, c->m, c->m, c->sz);
561 /* --- Hashing --- */
563 typedef struct hash_ctx {
570 static void *hash_init(opts *o)
572 hash_ctx *c = CREATE(hash_ctx);
574 die(1, "must specify hash function name");
575 if ((c->h = ghash_byname(o->name)) == 0)
576 die(1, "hash function `%s' not known", o->name);
577 c->sz = o->gbits ? o->gbits : 65536;
578 c->n = o->n ? o->n : 16;
579 o->opwhat = "byte"; o->sc = c->n*c->sz;
580 c->m = xmalloc(c->sz);
584 static void hash_run(void *cc)
588 ghash *h = GH_INIT(c->h);
589 for (i = 0; i < c->n; i++)
590 GH_HASH(h, c->m, c->sz);
595 /* --- Poly1305 --- */
597 typedef struct poly1305_jobctx {
599 octet s[POLY1305_MASKSZ];
605 static void *poly1305_jobinit(opts *o)
607 octet k[POLY1305_KEYSZ];
608 poly1305_jobctx *c = CREATE(poly1305_jobctx);
609 rand_get(RAND_GLOBAL, k, sizeof(k));
610 poly1305_keyinit(&c->k, k, sizeof(k));
611 rand_get(RAND_GLOBAL, c->s, sizeof(c->s));
612 c->sz = o->gbits ? o->gbits : 65536;
613 c->n = o->n ? o->n : 16;
614 o->opwhat = "byte"; o->sc = c->n*c->sz;
615 c->m = xmalloc(c->sz);
619 static void poly1305_jobrun(void *cc)
621 poly1305_jobctx *c = cc;
623 octet t[POLY1305_TAGSZ];
625 poly1305_macinit(&ctx, &c->k, c->s);
626 for (i = 0; i < c->n; i++) poly1305_hash(&ctx, c->m, c->sz);
627 poly1305_done(&ctx, t);
630 /* --- Job table --- */
632 typedef struct jobops {
634 void *(*init)(opts *);
638 static const jobops jobtab[] = {
639 { "g-prime-exp", grp_init, gr_run },
640 { "g-ec-mul", grec_init, gr_run },
641 { "g-prime-exp-sim", grp_init, grsim_run },
642 { "g-ec-mul-sim", grec_init, grsim_run },
643 { "barrett-exp", bar_init, bar_run },
644 { "barrett-exp-sim", bar_init, barsim_run },
645 { "mont-exp", mont_init, mont_run },
646 { "mont-exp-sim", mont_init, montsim_run },
647 { "rsa-priv", rsapriv_init, rsapriv_run },
648 { "rsa-priv-blind", rsaprivblind_init, rsapriv_run },
649 { "rsa-pub", rsapub_init, rsapub_run },
650 { "x25519", x25519_jobinit, x25519_jobrun },
651 { "x448", x448_jobinit, x448_jobrun },
652 { "ed25519-sign", ed25519_signinit, ed25519_signrun },
653 { "ed25519-vrf", ed25519_vrfinit, ed25519_vrfrun },
654 { "ed448-sign", ed448_signinit, ed448_signrun },
655 { "ed448-vrf", ed448_vrfinit, ed448_vrfrun },
656 { "ksched", ksched_init, ksched_run },
657 { "enc", enc_init, enc_run },
658 { "hash", hash_init, hash_run },
659 { "poly1305", poly1305_jobinit, poly1305_jobrun },
663 /*----- Cycle counting ----------------------------------------------------*/
665 typedef kludge64 cycles;
666 static int cyclecount_active_p = 0;
668 #if defined(__GNUC__) && (CPUFAM_X86 || CPUFAM_AMD64)
670 static void init_cyclecount(void) { cyclecount_active_p = 1; }
672 static cycles cyclecount(void)
677 __asm__("rdtsc" : "=a"(lo), "=d"(hi));
682 #elif defined(HAVE_LINUX_PERF_EVENT_H) && defined(HAVE_UINT64)
684 static int perf_fd = -1;
686 static void init_cyclecount(void)
688 struct perf_event_attr attr = { 0 };
690 attr.type = PERF_TYPE_HARDWARE;
691 attr.size = sizeof(attr);
692 attr.config = PERF_COUNT_HW_CPU_CYCLES;
694 attr.exclude_kernel = 1;
697 if ((perf_fd = syscall(__NR_perf_event_open, &attr, 0, -1, -1, 0)) < 0)
698 moan("failed to open perf event: %s", strerror(errno));
700 cyclecount_active_p = 1;
703 static cycles cyclecount(void)
708 if (!cyclecount_active_p)
710 else if ((n = read(perf_fd, &cy.i, sizeof(cy.i))) != sizeof(cy.i)) {
711 if (n < 0) moan("error reading perf event: %s", strerror(errno));
712 else moan("unexpected short read from perf event");
713 cyclecount_active_p = 0; close(perf_fd); perf_fd = -1;
725 static void init_cyclecount(void) { cyclecount_active_p = 0; }
726 static cycles cyclecount(void) { kludge64 cy; SET64(cy, 0, 0); return (cy); }
730 /*----- Main code ---------------------------------------------------------*/
732 void version(FILE *fp)
734 pquis(fp, "$, Catacomb " VERSION "\n");
737 static void usage(FILE *fp)
739 pquis(fp, "Usage: $ [-options] job\n");
742 static void help(FILE *fp)
748 Various performance tests.\n\
752 -h, --help Show this help text.\n\
753 -v, --version Show program version number.\n\
754 -u, --usage Show terse usage message.\n\
755 -l, --list [ITEM...] List all the various names of things.\n\
757 -C, --name=NAME Select curve/DH-group/enc/hash name.\n\
758 -b, --field-bits Field size for g-prime and rsa;\n\
759 key bits for ksched and enc.\n\
760 -q, --no-check Don't check field/group for validity.\n\
761 -B, --group-bits Group size for g-prime; data size for enc and hash.\n\
762 -n, --factors=COUNT Number of factors for {exp,mul}-sim;\n\
763 inner iterations for enc and hash.\n\
764 -i, --intervals=COUNT Number of intervals to run for. [0; forever]\n\
765 -k, --batch=COUNT Number of operations to batch between timer checks.\n\
766 -t, --time=TIME Length of an interval in seconds. [1]\n\
772 listtab[i].name, listtab[i].name) \
774 jobtab[i].name, jobtab[i].name) \
775 LI("Elliptic curves", ec, \
776 ectab[i].name, ectab[i].name) \
777 LI("Diffie-Hellman groups", dh, \
778 ptab[i].name, ptab[i].name) \
779 LI("Encryption algorithms", cipher, \
780 gciphertab[i], gciphertab[i]->name) \
781 LI("Hash functions", hash, \
782 ghashtab[i], ghashtab[i]->name)
784 MAKELISTTAB(listtab, LISTS)
786 static unsigned uarg(const char *what, const char *p)
791 u = strtoul(p, &q, 0);
792 if (*q || u > UINT_MAX || q == p || errno)
793 die(1, "bad %s `%s'", what, p);
797 static mp *mparg(const char *what, const char *p)
800 mp *x = mp_readstring(MP_NEW, p, &q, 0);
801 if (!x || *q) die(1, "bad %s `%s'", what, p);
805 static double farg(const char *what, const char *p)
811 if (*q || q == p || errno)
812 die(1, "bad %s `%s'", what, p);
816 int main(int argc, char *argv[])
821 struct timeval tv_next, tv_now;
822 double t, ttot, cy, cytot;
826 kludge64 cy0, cy1, cydiff;
831 o.t = 1; o.k = 1; o.sc = 1; o.opwhat = "op";
833 static const struct option opts[] = {
834 { "help", 0, 0, 'h' },
835 { "version", 0, 0, 'v' },
836 { "usage", 0, 0, 'u' },
837 { "list", 0, 0, 'l' },
838 { "name", OPTF_ARGREQ, 0, 'C' },
839 { "field-bits", OPTF_ARGREQ, 0, 'b' },
840 { "group-bits", OPTF_ARGREQ, 0, 'B' },
841 { "factors", OPTF_ARGREQ, 0, 'n' },
842 { "intervals", OPTF_ARGREQ, 0, 'i' },
843 { "batch", OPTF_ARGREQ, 0, 'k' },
844 { "public-exponent", OPTF_ARGREQ, 0, 'e' },
845 { "time", OPTF_ARGREQ, 0, 't' },
846 { "no-check", 0, 0, 'q' },
850 i = mdwopt(argc, argv, "hvulC:b:B:n:i:k:e:t:q", opts, 0, 0, 0);
853 case 'h': help(stdout); exit(0);
854 case 'v': version(stdout); exit(0);
855 case 'u': usage(stdout); exit(0);
856 case 'l': exit(displaylists(listtab, argv + optind));
857 case 'C': o.name = optarg; break;
858 case 'b': o.fbits = uarg("field bits", optarg); break;
859 case 'B': o.gbits = uarg("subgroup bits", optarg); break;
860 case 'n': o.n = uarg("factor count", optarg); break;
862 mp_drop(o.e); o.e = mparg("public exponent", optarg);
863 if (MP_CMP(o.e, <, MP_THREE) || MP_EVENP(o.e))
864 die(1, "invalid public exponent");
866 case 'i': o.i = uarg("interval count", optarg); break;
867 case 't': o.t = farg("interval length", optarg); break;
868 case 'k': o.k = uarg("batch size", optarg); break;
869 case 'q': o.f |= OF_NOCHECK; break;
870 default: usage(stderr); exit(1);
873 if (optind + 1 != argc) { usage(stderr); exit(1); }
875 for (j = jobtab; j->name; j++)
876 if (strcmp(j->name, argv[optind]) == 0) break;
877 if (!j->name) die(1, "unknown job type `%s'", argv[optind]);
881 ttot = itot = 0; cytot = 0; init_cyclecount();
882 gettimeofday(&tv_now, 0);
884 tv_addl(&tv_next, &tv_now, o.t, fmod(o.t * MILLION, MILLION));
886 c0 = clock(); cy0 = cyclecount();
888 for (k = 0; k < o.k; k++) { j->run(p); }
890 gettimeofday(&tv_now, 0);
891 } while (TV_CMP(&tv_now, <, &tv_next));
892 cy1 = cyclecount(); c1 = clock();
893 t = (double)(c1 - c0)/CLOCKS_PER_SEC;
894 itot += ii; ttot += t;
895 printf("%5u: did = %5lu; /sec = %5f; avg /sec = %5f",
896 n, ii, ii/t, itot/ttot);
897 if (cyclecount_active_p) {
898 SUB64(cydiff, cy1, cy0); cy = LO64(cydiff) + ldexp(HI64(cydiff), 32);
900 printf(" (cy/%s = %3f; avg cy/%s = %3f)",
901 o.opwhat, cy/ii/o.sc, o.opwhat, cytot/itot/o.sc);
906 } while (!o.i || n < o.i);
911 /*----- That's all, folks -------------------------------------------------*/