All of lore.kernel.org
 help / color / mirror / Atom feed
* lib/tests/string_kunit.c:971:35: error: implicit declaration of function 'STRING_BENCH'; did you mean 'STRING_BENCH_BUF'?
@ 2026-05-16  2:57 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-05-16  2:57 UTC (permalink / raw)
  To: Milan Tripkovic; +Cc: oe-kbuild-all, 0day robot

tree:   https://github.com/intel-lab-lkp/linux/commits/Milan-Tripkovic/riscv-lib-add-memcmp-implementation/20260515-232425
head:   cc47ab1edeaa33a740769c02047c4c601941ae9c
commit: cc47ab1edeaa33a740769c02047c4c601941ae9c lib/string_kunit: extend benchmarks and unit test to memcmp()
date:   12 hours ago
config: x86_64-rhel-9.4-kunit (https://download.01.org/0day-ci/archive/20260516/202605160457.GWCx3Syv-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260516/202605160457.GWCx3Syv-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605160457.GWCx3Syv-lkp@intel.com/

All errors (new ones prefixed by >>):

   lib/tests/string_kunit.c: In function 'do_string_bench_memcmp':
>> lib/tests/string_kunit.c:971:35: error: implicit declaration of function 'STRING_BENCH'; did you mean 'STRING_BENCH_BUF'? [-Wimplicit-function-declaration]
     971 |                         elapsed = STRING_BENCH(iterations, memcmp, p1, p2, len);
         |                                   ^~~~~~~~~~~~
         |                                   STRING_BENCH_BUF


vim +971 lib/tests/string_kunit.c

   922	
   923	static void do_string_bench_memcmp(struct kunit *test)
   924	{
   925		char *buf1 = NULL;
   926		char *buf2 = NULL;
   927		const u64 lengths[] = { 1, 7, 8, 16, 32, 64, 128, 512, 1024, 4096 };
   928		const int offsets[] = { 0, 1, 3, 7 };
   929		const u64 max_len = 4096 + 64;
   930		unsigned int w, o, i;
   931		unsigned int off;
   932		u64 len;
   933		char *p1;
   934		char *p2;
   935		u64 iterations;
   936		u64 elapsed;
   937		u64 ns_per_call;
   938		u64 mbps;
   939		u64 j;
   940	
   941		buf1 = vmalloc(max_len);
   942		buf2 = vmalloc(max_len);
   943	
   944		if (!buf1 || !buf2) {
   945			vfree(buf1);
   946			vfree(buf2);
   947			kunit_err(test, "vmalloc failed\n");
   948			return;
   949		}
   950	
   951		memset(buf1, 'A', max_len);
   952		memset(buf2, 'A', max_len);
   953	
   954		for (w = 0; w < 100000U; w++)
   955			(void)memcmp(buf1, buf2, 4096);
   956	
   957		for (o = 0; o < ARRAY_SIZE(offsets); o++) {
   958			off = offsets[o];
   959	
   960			for (i = 0; i < ARRAY_SIZE(lengths); i++) {
   961				len = lengths[i];
   962				p1 = buf1;
   963				p2 = buf2 + off;
   964				iterations = (len < 512) ? 100000ULL : 10000ULL;
   965	
   966				for (j = 0; j < iterations; j++) {
   967					(void)memcmp(p1, p2, len);
   968					barrier();
   969				}
   970	
 > 971				elapsed = STRING_BENCH(iterations, memcmp, p1, p2, len);
   972				ns_per_call = div_u64(elapsed, iterations);
   973				mbps = len ? div_u64(iterations * len * (NSEC_PER_SEC / MEGA), elapsed) : 0;
   974	
   975				if (off == 0) {
   976					kunit_info(test, "bench_memcmp_aligned: len=%-4llu: %llu MB/s (%llu ns/call)\n",
   977						   len, mbps, ns_per_call);
   978				} else {
   979					kunit_info(test, "bench_memcmp_unaligned(off=%u): len=%-4llu: %llu MB/s (%llu ns/call)\n",
   980						   off, len, mbps, ns_per_call);
   981				}
   982			}
   983		}
   984	
   985		vfree(buf1);
   986		vfree(buf2);
   987	}
   988	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-16  2:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-16  2:57 lib/tests/string_kunit.c:971:35: error: implicit declaration of function 'STRING_BENCH'; did you mean 'STRING_BENCH_BUF'? kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.