perftest.c
Code formats a zero-padded integerMegabyte-scale size constant in source
SHA-256d89a97dabaa3d270a290808a29f69aae779f2f54eb565a093ccfc0c2398eb078
MaleculeH₃(DbFMg)
Evidence
⋯4 lines
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must repr …
18:6… PLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE …
25:47… VISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29#include <sys/param.h>
30#include <sys/ioccom.h>
31
32#include <ctype.h>
33#include <err.h>
34#include <fcntl.h>
35#include <inttypes.h>
36#include <stdbool.h>
37#include <stddef.h>
38#include <stdio.h>
39#include <stdlib.h>
40#include <string.h>
41#include <sysexits.h>
42#include <unistd.h>
43
44#include "nvmecontrol.h"
45
46/* Tables for command line parsing */
⋯5 lines
119:4… ps = io_completed/io_test->time;
120 mbps = iops * io_test->size / (1024*1024);
121
122 printf("Threads: %2d Size: %6d %5s Time: %3d IO/s: %7ju MB/s: %4ju\n",
123 io_test->num_threads, io_test->size,
124 io_test->opc == NVME_OPC_READ ? "READ" : "WRITE",
125 …
177:25… ;
178 io_test.size = opt.size;
179 open_dev(opt.dev, &fd, 1, 1);
180 if (ioctl(fd, ioctl_cmd, &io_test) < 0)
181 err(EX_IOERR, "ioctl NVME_IO_TEST failed");
182
⋯4 lines