Esempio n. 1
0
void show_perf(char *name, int tsize, int iters, struct timespec *start,
               struct timespec *end, int xfers_per_iter)
{
    static int header = 1;
    char str[FT_STR_LEN];
    int64_t elapsed = get_elapsed(start, end, MICRO);
    long long bytes = (long long) iters * tsize * xfers_per_iter;

    if (header) {
        printf("%-10s%-8s%-8s%-8s%8s %10s%13s\n",
               "name", "bytes", "iters", "total", "time", "Gb/sec", "usec/xfer");
        header = 0;
    }

    printf("%-10s", name);

    printf("%-8s", size_str(str, tsize));

    printf("%-8s", cnt_str(str, iters));

    printf("%-8s", size_str(str, bytes));

    printf("%8.2fs%10.2f%11.2f\n",
           elapsed / 1000000.0, (bytes * 8) / (1000.0 * elapsed),
           ((float)elapsed / iters / xfers_per_iter));
}
Esempio n. 2
0
static void show_perf(void)
{
	char str[32];
	float usec;
	long long bytes;

	usec = (end.tv_sec - start.tv_sec) * 1000000 + (end.tv_usec - start.tv_usec);
	bytes = (long long) iterations * transfer_count * transfer_size * 2;

	/* name size transfers iterations bytes seconds Gb/sec usec/xfer */
	printf("%-10s", test_name);
	size_str(str, sizeof str, transfer_size);
	printf("%-8s", str);
	cnt_str(str, sizeof str, transfer_count);
	printf("%-8s", str);
	cnt_str(str, sizeof str, iterations);
	printf("%-8s", str);
	size_str(str, sizeof str, bytes);
	printf("%-8s", str);
	printf("%8.2fs%10.2f%11.2f\n",
		usec / 1000000., (bytes * 8) / (1000. * usec),
		(usec / iterations) / (transfer_count * 2));
}