X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fisa-l%2Fraid%2Fxor_gen_perf.c;h=717e0ada7ff30b48e6a7b44978edcac582f9da29;hb=f91f0fd59dc16d284d230f8953e42d49a893715d;hp=25b33cb6f9d0eb6afd52edfe578d43ba38f11b80;hpb=91f1cf44a5d7f2447155ea575d309309fbbe6f73;p=ceph.git diff --git a/ceph/src/isa-l/raid/xor_gen_perf.c b/ceph/src/isa-l/raid/xor_gen_perf.c index 25b33cb6f..717e0ada7 100644 --- a/ceph/src/isa-l/raid/xor_gen_perf.c +++ b/ceph/src/isa-l/raid/xor_gen_perf.c @@ -2,7 +2,7 @@ Copyright(c) 2011-2015 Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions + modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. @@ -37,17 +37,15 @@ //#define CACHED_TEST #ifdef CACHED_TEST -// Loop many times over same +// Loop many times over same # define TEST_SOURCES 10 # define TEST_LEN 8*1024 -# define TEST_LOOPS 2000000 # define TEST_TYPE_STR "_warm" #else // Uncached test. Pull from large mem base. # define TEST_SOURCES 10 # define GT_L3_CACHE 32*1024*1024 /* some number > last level cache */ # define TEST_LEN GT_L3_CACHE / TEST_SOURCES -# define TEST_LOOPS 1000 # define TEST_TYPE_STR "_cold" #endif @@ -58,7 +56,7 @@ int main(int argc, char *argv[]) int i, ret, fail = 0; void **buffs; void *buff; - struct perf start, stop; + struct perf start; printf("Test xor_gen_perf\n"); @@ -84,15 +82,9 @@ int main(int argc, char *argv[]) for (i = 0; i < TEST_SOURCES + 1; i++) memset(buffs[i], 0, TEST_LEN); - // Warm up - xor_gen(TEST_SOURCES + 1, TEST_LEN, buffs); - - perf_start(&start); - for (i = 0; i < TEST_LOOPS; i++) - xor_gen(TEST_SOURCES + 1, TEST_LEN, buffs); - perf_stop(&stop); + BENCHMARK(&start, BENCHMARK_TIME, xor_gen(TEST_SOURCES + 1, TEST_LEN, buffs)); printf("xor_gen" TEST_TYPE_STR ": "); - perf_print(stop, start, (long long)TEST_MEM * i); + perf_print(start, (long long)TEST_MEM); return fail; }