All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Milan Tripkovic <Milan.Tripkovic@rt-rk.com>
Cc: oe-kbuild-all@lists.linux.dev, 0day robot <lkp@intel.com>
Subject: lib/tests/string_kunit.c:971:35: error: implicit declaration of function 'STRING_BENCH'; did you mean 'STRING_BENCH_BUF'?
Date: Sat, 16 May 2026 04:57:51 +0200	[thread overview]
Message-ID: <202605160457.GWCx3Syv-lkp@intel.com> (raw)

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

                 reply	other threads:[~2026-05-16  2:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202605160457.GWCx3Syv-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Milan.Tripkovic@rt-rk.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.