1 // SPDX-License-Identifier: BSD-3-Clause
3 * Loopback test application
5 * Copyright 2015 Google Inc.
6 * Copyright 2015 Linaro Ltd.
15 #include <sys/types.h>
21 #define MAX_NUM_DEVICES 10
22 #define MAX_SYSFS_PREFIX 0x80
23 #define MAX_SYSFS_PATH 0x200
24 #define CSV_MAX_LINE 0x1000
25 #define SYSFS_MAX_INT 0x20
26 #define MAX_STR_LEN 255
27 #define DEFAULT_ASYNC_TIMEOUT 200000
34 static struct dict dict[] = {
38 {NULL,} /* list termination */
41 struct loopback_results {
45 uint32_t latency_jitter;
50 uint32_t request_jitter;
53 uint32_t throughput_max;
54 uint32_t throughput_min;
55 uint32_t throughput_jitter;
57 float apbridge_unipro_latency_avg;
58 uint32_t apbridge_unipro_latency_max;
59 uint32_t apbridge_unipro_latency_min;
60 uint32_t apbridge_unipro_latency_jitter;
62 float gbphy_firmware_latency_avg;
63 uint32_t gbphy_firmware_latency_max;
64 uint32_t gbphy_firmware_latency_min;
65 uint32_t gbphy_firmware_latency_jitter;
70 struct loopback_device {
71 char name[MAX_STR_LEN];
72 char sysfs_entry[MAX_SYSFS_PATH];
73 char debugfs_entry[MAX_SYSFS_PATH];
74 struct loopback_results results;
77 struct loopback_test {
91 int async_outstanding_operations;
96 char test_name[MAX_STR_LEN];
97 char sysfs_prefix[MAX_SYSFS_PREFIX];
98 char debugfs_prefix[MAX_SYSFS_PREFIX];
99 struct timespec poll_timeout;
100 struct loopback_device devices[MAX_NUM_DEVICES];
101 struct loopback_results aggregate_results;
102 struct pollfd fds[MAX_NUM_DEVICES];
105 struct loopback_test t;
107 /* Helper macros to calculate the aggregate results for all devices */
108 static inline int device_enabled(struct loopback_test *t, int dev_idx);
110 #define GET_MAX(field) \
111 static int get_##field##_aggregate(struct loopback_test *t) \
115 for (i = 0; i < t->device_count; i++) { \
116 if (!device_enabled(t, i)) \
118 if (t->devices[i].results.field > max) \
119 max = t->devices[i].results.field; \
124 #define GET_MIN(field) \
125 static int get_##field##_aggregate(struct loopback_test *t) \
129 for (i = 0; i < t->device_count; i++) { \
130 if (!device_enabled(t, i)) \
132 if (t->devices[i].results.field < min) \
133 min = t->devices[i].results.field; \
138 #define GET_AVG(field) \
139 static int get_##field##_aggregate(struct loopback_test *t) \
142 uint32_t count = 0; \
144 for (i = 0; i < t->device_count; i++) { \
145 if (!device_enabled(t, i)) \
148 val += t->devices[i].results.field; \
155 GET_MAX(throughput_max);
156 GET_MAX(request_max);
157 GET_MAX(latency_max);
158 GET_MAX(apbridge_unipro_latency_max);
159 GET_MAX(gbphy_firmware_latency_max);
160 GET_MIN(throughput_min);
161 GET_MIN(request_min);
162 GET_MIN(latency_min);
163 GET_MIN(apbridge_unipro_latency_min);
164 GET_MIN(gbphy_firmware_latency_min);
165 GET_AVG(throughput_avg);
166 GET_AVG(request_avg);
167 GET_AVG(latency_avg);
168 GET_AVG(apbridge_unipro_latency_avg);
169 GET_AVG(gbphy_firmware_latency_avg);
178 fprintf(stderr, "Usage: loopback_test TEST [SIZE] ITERATIONS [SYSPATH] [DBGPATH]\n\n"
179 " Run TEST for a number of ITERATIONS with operation data SIZE bytes\n"
180 " TEST may be \'ping\' \'transfer\' or \'sink\'\n"
181 " SIZE indicates the size of transfer <= greybus max payload bytes\n"
182 " ITERATIONS indicates the number of times to execute TEST at SIZE bytes\n"
183 " Note if ITERATIONS is set to zero then this utility will\n"
184 " initiate an infinite (non terminating) test and exit\n"
185 " without logging any metrics data\n"
186 " SYSPATH indicates the sysfs path for the loopback greybus entries e.g.\n"
187 " /sys/bus/greybus/devices\n"
188 " DBGPATH indicates the debugfs path for the loopback greybus entries e.g.\n"
189 " /sys/kernel/debug/gb_loopback/\n"
190 " Mandatory arguments\n"
191 " -t must be one of the test names - sink, transfer or ping\n"
192 " -i iteration count - the number of iterations to run the test over\n"
193 " Optional arguments\n"
194 " -S sysfs location - location for greybus 'endo' entries default /sys/bus/greybus/devices/\n"
195 " -D debugfs location - location for loopback debugfs entries default /sys/kernel/debug/gb_loopback/\n"
196 " -s size of data packet to send during test - defaults to zero\n"
197 " -m mask - a bit mask of connections to include example: -m 8 = 4th connection -m 9 = 1st and 4th connection etc\n"
198 " default is zero which means broadcast to all connections\n"
199 " -v verbose output\n"
201 " -r raw data output - when specified the full list of latency values are included in the output CSV\n"
202 " -p porcelain - when specified printout is in a user-friendly non-CSV format. This option suppresses writing to CSV file\n"
203 " -a aggregate - show aggregation of all enabled devices\n"
204 " -l list found loopback devices and exit\n"
205 " -x Async - Enable async transfers\n"
206 " -o Async Timeout - Timeout in uSec for async operations\n"
207 " -O Poll loop time out in seconds(max time a test is expected to last, default: 30sec)\n"
208 " -c Max number of outstanding operations for async operations\n"
209 " -w Wait in uSec between operations\n"
210 " -z Enable output to a CSV file (incompatible with -p)\n"
211 " -f When starting new loopback test, stop currently running tests on all devices\n"
213 " Send 10000 transfers with a packet size of 128 bytes to all active connections\n"
214 " loopback_test -t transfer -s 128 -i 10000 -S /sys/bus/greybus/devices/ -D /sys/kernel/debug/gb_loopback/\n"
215 " loopback_test -t transfer -s 128 -i 10000 -m 0\n"
216 " Send 10000 transfers with a packet size of 128 bytes to connection 1 and 4\n"
217 " loopback_test -t transfer -s 128 -i 10000 -m 9\n"
218 " loopback_test -t ping -s 0 128 -i -S /sys/bus/greybus/devices/ -D /sys/kernel/debug/gb_loopback/\n"
219 " loopback_test -t sink -s 2030 -i 32768 -S /sys/bus/greybus/devices/ -D /sys/kernel/debug/gb_loopback/\n");
223 static inline int device_enabled(struct loopback_test *t, int dev_idx)
225 if (!t->mask || (t->mask & (1 << dev_idx)))
231 static void show_loopback_devices(struct loopback_test *t)
235 if (t->device_count == 0) {
236 printf("No loopback devices.\n");
240 for (i = 0; i < t->device_count; i++)
241 printf("device[%d] = %s\n", i, t->devices[i].name);
245 int open_sysfs(const char *sys_pfx, const char *node, int flags)
248 char path[MAX_SYSFS_PATH];
250 snprintf(path, sizeof(path), "%s%s", sys_pfx, node);
251 fd = open(path, flags);
253 fprintf(stderr, "unable to open %s\n", path);
259 int read_sysfs_int_fd(int fd, const char *sys_pfx, const char *node)
261 char buf[SYSFS_MAX_INT];
263 if (read(fd, buf, sizeof(buf)) < 0) {
264 fprintf(stderr, "unable to read from %s%s %s\n", sys_pfx, node,
272 float read_sysfs_float_fd(int fd, const char *sys_pfx, const char *node)
274 char buf[SYSFS_MAX_INT];
276 if (read(fd, buf, sizeof(buf)) < 0) {
278 fprintf(stderr, "unable to read from %s%s %s\n", sys_pfx, node,
286 int read_sysfs_int(const char *sys_pfx, const char *node)
290 fd = open_sysfs(sys_pfx, node, O_RDONLY);
291 val = read_sysfs_int_fd(fd, sys_pfx, node);
296 float read_sysfs_float(const char *sys_pfx, const char *node)
301 fd = open_sysfs(sys_pfx, node, O_RDONLY);
302 val = read_sysfs_float_fd(fd, sys_pfx, node);
307 void write_sysfs_val(const char *sys_pfx, const char *node, int val)
310 char buf[SYSFS_MAX_INT];
312 fd = open_sysfs(sys_pfx, node, O_RDWR);
313 len = snprintf(buf, sizeof(buf), "%d", val);
314 if (write(fd, buf, len) < 0) {
315 fprintf(stderr, "unable to write to %s%s %s\n", sys_pfx, node,
323 static int get_results(struct loopback_test *t)
325 struct loopback_device *d;
326 struct loopback_results *r;
329 for (i = 0; i < t->device_count; i++) {
330 if (!device_enabled(t, i))
336 r->error = read_sysfs_int(d->sysfs_entry, "error");
337 r->request_min = read_sysfs_int(d->sysfs_entry, "requests_per_second_min");
338 r->request_max = read_sysfs_int(d->sysfs_entry, "requests_per_second_max");
339 r->request_avg = read_sysfs_float(d->sysfs_entry, "requests_per_second_avg");
341 r->latency_min = read_sysfs_int(d->sysfs_entry, "latency_min");
342 r->latency_max = read_sysfs_int(d->sysfs_entry, "latency_max");
343 r->latency_avg = read_sysfs_float(d->sysfs_entry, "latency_avg");
345 r->throughput_min = read_sysfs_int(d->sysfs_entry, "throughput_min");
346 r->throughput_max = read_sysfs_int(d->sysfs_entry, "throughput_max");
347 r->throughput_avg = read_sysfs_float(d->sysfs_entry, "throughput_avg");
349 r->apbridge_unipro_latency_min =
350 read_sysfs_int(d->sysfs_entry, "apbridge_unipro_latency_min");
351 r->apbridge_unipro_latency_max =
352 read_sysfs_int(d->sysfs_entry, "apbridge_unipro_latency_max");
353 r->apbridge_unipro_latency_avg =
354 read_sysfs_float(d->sysfs_entry, "apbridge_unipro_latency_avg");
356 r->gbphy_firmware_latency_min =
357 read_sysfs_int(d->sysfs_entry, "gbphy_firmware_latency_min");
358 r->gbphy_firmware_latency_max =
359 read_sysfs_int(d->sysfs_entry, "gbphy_firmware_latency_max");
360 r->gbphy_firmware_latency_avg =
361 read_sysfs_float(d->sysfs_entry, "gbphy_firmware_latency_avg");
363 r->request_jitter = r->request_max - r->request_min;
364 r->latency_jitter = r->latency_max - r->latency_min;
365 r->throughput_jitter = r->throughput_max - r->throughput_min;
366 r->apbridge_unipro_latency_jitter =
367 r->apbridge_unipro_latency_max - r->apbridge_unipro_latency_min;
368 r->gbphy_firmware_latency_jitter =
369 r->gbphy_firmware_latency_max - r->gbphy_firmware_latency_min;
373 /*calculate the aggregate results of all enabled devices */
374 if (t->aggregate_output) {
375 r = &t->aggregate_results;
377 r->request_min = get_request_min_aggregate(t);
378 r->request_max = get_request_max_aggregate(t);
379 r->request_avg = get_request_avg_aggregate(t);
381 r->latency_min = get_latency_min_aggregate(t);
382 r->latency_max = get_latency_max_aggregate(t);
383 r->latency_avg = get_latency_avg_aggregate(t);
385 r->throughput_min = get_throughput_min_aggregate(t);
386 r->throughput_max = get_throughput_max_aggregate(t);
387 r->throughput_avg = get_throughput_avg_aggregate(t);
389 r->apbridge_unipro_latency_min =
390 get_apbridge_unipro_latency_min_aggregate(t);
391 r->apbridge_unipro_latency_max =
392 get_apbridge_unipro_latency_max_aggregate(t);
393 r->apbridge_unipro_latency_avg =
394 get_apbridge_unipro_latency_avg_aggregate(t);
396 r->gbphy_firmware_latency_min =
397 get_gbphy_firmware_latency_min_aggregate(t);
398 r->gbphy_firmware_latency_max =
399 get_gbphy_firmware_latency_max_aggregate(t);
400 r->gbphy_firmware_latency_avg =
401 get_gbphy_firmware_latency_avg_aggregate(t);
403 r->request_jitter = r->request_max - r->request_min;
404 r->latency_jitter = r->latency_max - r->latency_min;
405 r->throughput_jitter = r->throughput_max - r->throughput_min;
406 r->apbridge_unipro_latency_jitter =
407 r->apbridge_unipro_latency_max - r->apbridge_unipro_latency_min;
408 r->gbphy_firmware_latency_jitter =
409 r->gbphy_firmware_latency_max - r->gbphy_firmware_latency_min;
416 int format_output(struct loopback_test *t,
417 struct loopback_results *r,
418 const char *dev_name,
419 char *buf, int buf_len,
424 memset(buf, 0x00, buf_len);
425 len = snprintf(buf, buf_len, "%u-%u-%u %u:%u:%u",
426 tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
427 tm->tm_hour, tm->tm_min, tm->tm_sec);
430 len += snprintf(&buf[len], buf_len - len,
431 "\n test:\t\t\t%s\n path:\t\t\t%s\n size:\t\t\t%u\n iterations:\t\t%u\n errors:\t\t%u\n async:\t\t\t%s\n",
437 t->use_async ? "Enabled" : "Disabled");
439 len += snprintf(&buf[len], buf_len - len,
440 " requests per-sec:\tmin=%u, max=%u, average=%f, jitter=%u\n",
446 len += snprintf(&buf[len], buf_len - len,
447 " ap-throughput B/s:\tmin=%u max=%u average=%f jitter=%u\n",
451 r->throughput_jitter);
452 len += snprintf(&buf[len], buf_len - len,
453 " ap-latency usec:\tmin=%u max=%u average=%f jitter=%u\n",
458 len += snprintf(&buf[len], buf_len - len,
459 " apbridge-latency usec:\tmin=%u max=%u average=%f jitter=%u\n",
460 r->apbridge_unipro_latency_min,
461 r->apbridge_unipro_latency_max,
462 r->apbridge_unipro_latency_avg,
463 r->apbridge_unipro_latency_jitter);
465 len += snprintf(&buf[len], buf_len - len,
466 " gbphy-latency usec:\tmin=%u max=%u average=%f jitter=%u\n",
467 r->gbphy_firmware_latency_min,
468 r->gbphy_firmware_latency_max,
469 r->gbphy_firmware_latency_avg,
470 r->gbphy_firmware_latency_jitter);
473 len += snprintf(&buf[len], buf_len - len, ",%s,%s,%u,%u,%u",
474 t->test_name, dev_name, t->size, t->iteration_max,
477 len += snprintf(&buf[len], buf_len - len, ",%u,%u,%f,%u",
483 len += snprintf(&buf[len], buf_len - len, ",%u,%u,%f,%u",
489 len += snprintf(&buf[len], buf_len - len, ",%u,%u,%f,%u",
493 r->throughput_jitter);
495 len += snprintf(&buf[len], buf_len - len, ",%u,%u,%f,%u",
496 r->apbridge_unipro_latency_min,
497 r->apbridge_unipro_latency_max,
498 r->apbridge_unipro_latency_avg,
499 r->apbridge_unipro_latency_jitter);
501 len += snprintf(&buf[len], buf_len - len, ",%u,%u,%f,%u",
502 r->gbphy_firmware_latency_min,
503 r->gbphy_firmware_latency_max,
504 r->gbphy_firmware_latency_avg,
505 r->gbphy_firmware_latency_jitter);
508 printf("\n%s\n", buf);
513 static int log_results(struct loopback_test *t)
518 char file_name[MAX_SYSFS_PATH];
519 char data[CSV_MAX_LINE];
521 local_time = time(NULL);
522 tm = *localtime(&local_time);
525 * file name will test_name_size_iteration_max.csv
526 * every time the same test with the same parameters is run we will then
527 * append to the same CSV with datestamp - representing each test
530 if (t->file_output && !t->porcelain) {
531 snprintf(file_name, sizeof(file_name), "%s_%d_%d.csv",
532 t->test_name, t->size, t->iteration_max);
534 fd = open(file_name, O_WRONLY | O_CREAT | O_APPEND, 0644);
536 fprintf(stderr, "unable to open %s for appendation\n", file_name);
541 for (i = 0; i < t->device_count; i++) {
542 if (!device_enabled(t, i))
545 len = format_output(t, &t->devices[i].results,
547 data, sizeof(data), &tm);
548 if (t->file_output && !t->porcelain) {
549 ret = write(fd, data, len);
551 fprintf(stderr, "unable to write %d bytes to csv.\n", len);
557 if (t->aggregate_output) {
558 len = format_output(t, &t->aggregate_results, "aggregate",
559 data, sizeof(data), &tm);
560 if (t->file_output && !t->porcelain) {
561 ret = write(fd, data, len);
563 fprintf(stderr, "unable to write %d bytes to csv.\n", len);
567 if (t->file_output && !t->porcelain)
573 int is_loopback_device(const char *path, const char *node)
575 char file[MAX_SYSFS_PATH];
577 snprintf(file, MAX_SYSFS_PATH, "%s%s/iteration_count", path, node);
578 if (access(file, F_OK) == 0)
583 int find_loopback_devices(struct loopback_test *t)
585 struct dirent **namelist;
588 struct loopback_device *d;
590 n = scandir(t->sysfs_prefix, &namelist, NULL, alphasort);
597 /* Don't include '.' and '..' */
603 for (i = 0; i < n; i++) {
604 ret = sscanf(namelist[i]->d_name, "gb_loopback%u", &dev_id);
608 if (!is_loopback_device(t->sysfs_prefix, namelist[i]->d_name))
611 if (t->device_count == MAX_NUM_DEVICES) {
612 fprintf(stderr, "max number of devices reached!\n");
616 d = &t->devices[t->device_count++];
617 snprintf(d->name, MAX_STR_LEN, "gb_loopback%u", dev_id);
619 snprintf(d->sysfs_entry, MAX_SYSFS_PATH, "%s%s/",
620 t->sysfs_prefix, d->name);
622 snprintf(d->debugfs_entry, MAX_SYSFS_PATH, "%sraw_latency_%s",
623 t->debugfs_prefix, d->name);
626 printf("add %s %s\n", d->sysfs_entry, d->debugfs_entry);
631 for (i = 0; i < n; i++)
638 static int open_poll_files(struct loopback_test *t)
640 struct loopback_device *dev;
641 char buf[MAX_SYSFS_PATH + MAX_STR_LEN];
646 for (i = 0; i < t->device_count; i++) {
647 dev = &t->devices[i];
649 if (!device_enabled(t, i))
652 snprintf(buf, sizeof(buf), "%s%s", dev->sysfs_entry, "iteration_count");
653 t->fds[fds_idx].fd = open(buf, O_RDONLY);
654 if (t->fds[fds_idx].fd < 0) {
655 fprintf(stderr, "Error opening poll file!\n");
658 read(t->fds[fds_idx].fd, &dummy, 1);
659 t->fds[fds_idx].events = POLLERR | POLLPRI;
660 t->fds[fds_idx].revents = 0;
664 t->poll_count = fds_idx;
669 for (i = 0; i < fds_idx; i++)
675 static int close_poll_files(struct loopback_test *t)
678 for (i = 0; i < t->poll_count; i++)
683 static int is_complete(struct loopback_test *t)
688 for (i = 0; i < t->device_count; i++) {
689 if (!device_enabled(t, i))
692 iteration_count = read_sysfs_int(t->devices[i].sysfs_entry,
695 /* at least one device did not finish yet */
696 if (iteration_count != t->iteration_max)
703 static void stop_tests(struct loopback_test *t)
707 for (i = 0; i < t->device_count; i++) {
708 if (!device_enabled(t, i))
710 write_sysfs_val(t->devices[i].sysfs_entry, "type", 0);
714 static void handler(int sig) { /* do nothing */ }
716 static int wait_for_complete(struct loopback_test *t)
718 int number_of_events = 0;
722 struct timespec *ts = NULL;
724 sigset_t mask_old, mask;
727 sigemptyset(&mask_old);
728 sigaddset(&mask, SIGINT);
729 sigprocmask(SIG_BLOCK, &mask, &mask_old);
731 sa.sa_handler = handler;
733 sigemptyset(&sa.sa_mask);
734 if (sigaction(SIGINT, &sa, NULL) == -1) {
735 fprintf(stderr, "sigaction error\n");
739 if (t->poll_timeout.tv_sec != 0)
740 ts = &t->poll_timeout;
744 ret = ppoll(t->fds, t->poll_count, ts, &mask_old);
747 fprintf(stderr, "Poll exit with errno %d\n", errno);
751 for (i = 0; i < t->poll_count; i++) {
752 if (t->fds[i].revents & POLLPRI) {
753 /* Dummy read to clear the event */
754 read(t->fds[i].fd, &dummy, 1);
759 if (number_of_events == t->poll_count)
763 if (!is_complete(t)) {
764 fprintf(stderr, "Iteration count did not finish!\n");
771 static void prepare_devices(struct loopback_test *t)
776 * Cancel any running tests on enabled devices. If
777 * stop_all option is given, stop test on all devices.
779 for (i = 0; i < t->device_count; i++)
780 if (t->stop_all || device_enabled(t, i))
781 write_sysfs_val(t->devices[i].sysfs_entry, "type", 0);
784 for (i = 0; i < t->device_count; i++) {
785 if (!device_enabled(t, i))
788 write_sysfs_val(t->devices[i].sysfs_entry, "us_wait",
791 /* Set operation size */
792 write_sysfs_val(t->devices[i].sysfs_entry, "size", t->size);
795 write_sysfs_val(t->devices[i].sysfs_entry, "iteration_max",
799 write_sysfs_val(t->devices[i].sysfs_entry, "async", 1);
800 write_sysfs_val(t->devices[i].sysfs_entry,
801 "timeout", t->async_timeout);
802 write_sysfs_val(t->devices[i].sysfs_entry,
803 "outstanding_operations_max",
804 t->async_outstanding_operations);
806 write_sysfs_val(t->devices[i].sysfs_entry, "async", 0);
811 static int start(struct loopback_test *t)
815 /* the test starts by writing test_id to the type file. */
816 for (i = 0; i < t->device_count; i++) {
817 if (!device_enabled(t, i))
820 write_sysfs_val(t->devices[i].sysfs_entry, "type", t->test_id);
827 void loopback_run(struct loopback_test *t)
832 for (i = 0; dict[i].name != NULL; i++) {
833 if (strstr(dict[i].name, t->test_name))
834 t->test_id = dict[i].type;
837 fprintf(stderr, "invalid test %s\n", t->test_name);
844 ret = open_poll_files(t);
850 ret = wait_for_complete(t);
863 printf("Error running test\n");
867 static int sanity_check(struct loopback_test *t)
871 if (t->device_count == 0) {
872 fprintf(stderr, "No loopback devices found\n");
876 for (i = 0; i < MAX_NUM_DEVICES; i++) {
877 if (!device_enabled(t, i))
880 if (t->mask && !strcmp(t->devices[i].name, "")) {
881 fprintf(stderr, "Bad device mask %x\n", (1 << i));
891 int main(int argc, char *argv[])
894 char *sysfs_prefix = "/sys/class/gb_loopback/";
895 char *debugfs_prefix = "/sys/kernel/debug/gb_loopback/";
897 memset(&t, 0, sizeof(t));
899 while ((o = getopt(argc, argv,
900 "t:s:i:S:D:m:v::d::r::p::a::l::x::o:O:c:w:z::f::")) != -1) {
903 snprintf(t.test_name, MAX_STR_LEN, "%s", optarg);
906 t.size = atoi(optarg);
909 t.iteration_max = atoi(optarg);
912 snprintf(t.sysfs_prefix, MAX_SYSFS_PREFIX, "%s", optarg);
915 snprintf(t.debugfs_prefix, MAX_SYSFS_PREFIX, "%s", optarg);
918 t.mask = atol(optarg);
933 t.aggregate_output = 1;
942 t.async_timeout = atoi(optarg);
945 t.poll_timeout.tv_sec = atoi(optarg);
948 t.async_outstanding_operations = atoi(optarg);
951 t.us_wait = atoi(optarg);
965 if (!strcmp(t.sysfs_prefix, ""))
966 snprintf(t.sysfs_prefix, MAX_SYSFS_PREFIX, "%s", sysfs_prefix);
968 if (!strcmp(t.debugfs_prefix, ""))
969 snprintf(t.debugfs_prefix, MAX_SYSFS_PREFIX, "%s", debugfs_prefix);
971 ret = find_loopback_devices(&t);
974 ret = sanity_check(&t);
978 if (t.list_devices) {
979 show_loopback_devices(&t);
983 if (t.test_name[0] == '\0' || t.iteration_max == 0)
986 if (t.async_timeout == 0)
987 t.async_timeout = DEFAULT_ASYNC_TIMEOUT;