Lines Matching +full:step +full:- +full:size
1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
4 * Copyright (c) 2003 Poul-Henning Kamp
61 fprintf(stderr, "usage: diskinfo [-ciStvw] disk ...\n" in usage()
62 " diskinfo [-l] -p disk ...\n" in usage()
63 " diskinfo [-l] -s disk ...\n" in usage()
94 while ((ch = getopt(argc, argv, "cilpsStvw")) != -1) { in main()
131 argc -= optind; in main()
138 warnx("-p or -s cannot be used with other options"); in main()
143 warnx("-S require also -w"); in main()
174 warnx("-p and -s only operate on physical devices: %s", argv[i]); in main()
242 printf("\t%-12u\t# sectorsize\n", sectorsize); in main()
243 printf("\t%-12jd\t# mediasize in bytes (%s)\n", in main()
245 printf("\t%-12jd\t# mediasize in sectors\n", in main()
247 printf("\t%-12jd\t# stripesize\n", stripesize); in main()
248 printf("\t%-12jd\t# stripeoffset\n", stripeoffset); in main()
250 printf("\t%-12jd\t# Cylinders according to firmware.\n", (intmax_t)mediasize / in main()
252 printf("\t%-12u\t# Heads according to firmware.\n", fwheads); in main()
253 printf("\t%-12u\t# Sectors according to firmware.\n", fwsectors); in main()
258 printf("\t%-12s\t# Disk descr.\n", arg.value.str); in main()
260 printf("\t%-12s\t# Disk ident.\n", ident); in main()
264 printf("\t%-12s\t# Attachment\n", arg.value.str); in main()
266 printf("\t%-12s\t# Physical path\n", physpath); in main()
267 printf("\t%-12s\t# TRIM/UNMAP support\n", in main()
270 printf("\t%-12s\t# Rotation rate in RPM\n", rrate); in main()
272 printf("\t%-12s\t# Zone Mode\n", zone_desc); in main()
328 if (lseek(fd, (off_t)blockno * sectorsize, SEEK_SET) == -1) in rdsect()
331 if (error == -1) in rdsect()
343 if (error == -1) in rdmega()
369 dt = (tv2.tv_usec - tv1.tv_usec) / 1e6; in delta_t()
370 dt += (tv2.tv_sec - tv1.tv_sec); in delta_t()
406 TS(u_int size, int count) in TS() argument
412 dt * 1000000.0 / count, (double)size * count / dt / (1024 * 1024)); in TS()
419 off_t b0, b1, sectorcount, step; in speeddisk() local
430 step = 1ULL << (flsll(sectorcount / (4 * 200)) - 1); in speeddisk()
431 if (step > 16384) in speeddisk()
432 step = 16384; in speeddisk()
440 b1 = sectorcount - step; in speeddisk()
444 b0 += step; in speeddisk()
446 b1 -= step; in speeddisk()
456 b0 += step; in speeddisk()
458 b1 += step; in speeddisk()
467 b0 += step; in speeddisk()
469 b1 += step; in speeddisk()
478 b0 += step; in speeddisk()
487 b0 -= step; in speeddisk()
501 b0 = sectorcount - 2048; in speeddisk()
519 b0 = sectorcount / 2 - bulk * (1024*1024 / sectorsize) / 2 - 1; in speeddisk()
528 b0 = sectorcount - bulk * (1024*1024 / sectorsize) - 1; in speeddisk()
565 (dtsector - dtmega)*100/2048); in commandtime()
583 aiop->aio_buf = malloc(sectorsize); in iops()
584 if (aiop->aio_buf == NULL) in iops()
592 aiop->aio_fildes = fd; in iops()
593 aiop->aio_offset = (random() % (sectorcount)) * sectorsize; in iops()
594 aiop->aio_nbytes = sectorsize; in iops()
614 aiop->aio_fildes = fd; in iops()
615 aiop->aio_offset = (random() % (sectorcount)) * sectorsize; in iops()
616 aiop->aio_nbytes = sectorsize; in iops()
660 parwrite(int fd, size_t size, off_t off) in parwrite() argument
667 // if size > MAXIO, use AIO to write n - 1 pieces in parallel in parwrite()
668 for (n = 0, o = 0; size > MAXIO; n++, size -= MAXIO, o += MAXIO) { in parwrite()
671 aiop->aio_buf = &buf[o]; in parwrite()
672 aiop->aio_fildes = fd; in parwrite()
673 aiop->aio_offset = off + o; in parwrite()
674 aiop->aio_nbytes = MAXIO; in parwrite()
679 // Use synchronous writes for the runt of size <= MAXIO in parwrite()
680 error = pwrite(fd, &buf[o], size, off + o); in parwrite()
683 for (; n > 0; n--) { in parwrite()
694 u_int size; in slogbench() local
698 for (size = sectorsize; size <= MAXTX; size *= 2) { in slogbench()
699 printf("\t%4.4g kbytes: ", (double)size / 1024); in slogbench()
704 off = random() % (mediasize / size); in slogbench()
705 parwrite(fd, size, off * size); in slogbench()
721 TS(size, N); in slogbench()