@@ -341,6 +341,7 @@ static int test_kallsyms_basic_function(void)
341
341
ret = lookup_symbol_name (addr , namebuf );
342
342
if (unlikely (ret )) {
343
343
namebuf [0 ] = 0 ;
344
+ pr_info ("%d: lookup_symbol_name(%lx) failed\n" , i , addr );
344
345
goto failed ;
345
346
}
346
347
@@ -388,8 +389,11 @@ static int test_kallsyms_basic_function(void)
388
389
if (stat -> addr != stat2 -> addr ||
389
390
stat -> real_cnt != stat2 -> real_cnt ||
390
391
memcmp (stat -> addrs , stat2 -> addrs ,
391
- stat -> save_cnt * sizeof (stat -> addrs [0 ])))
392
+ stat -> save_cnt * sizeof (stat -> addrs [0 ]))) {
393
+ pr_info ("%s: mismatch between kallsyms_on_each_symbol() and kallsyms_on_each_match_symbol()\n" ,
394
+ namebuf );
392
395
goto failed ;
396
+ }
393
397
394
398
/*
395
399
* The average of random increments is 128, that is, one of
@@ -400,15 +404,23 @@ static int test_kallsyms_basic_function(void)
400
404
}
401
405
402
406
/* Need to be found at least once */
403
- if (!stat -> real_cnt )
407
+ if (!stat -> real_cnt ) {
408
+ pr_info ("%s: Never found\n" , namebuf );
404
409
goto failed ;
410
+ }
405
411
406
412
/*
407
413
* kallsyms_lookup_name() returns the address of the first
408
414
* symbol found and cannot be NULL.
409
415
*/
410
- if (!lookup_addr || lookup_addr != stat -> addrs [0 ])
416
+ if (!lookup_addr ) {
417
+ pr_info ("%s: NULL lookup_addr?!\n" , namebuf );
418
+ goto failed ;
419
+ }
420
+ if (lookup_addr != stat -> addrs [0 ]) {
421
+ pr_info ("%s: lookup_addr != stat->addrs[0]\n" , namebuf );
411
422
goto failed ;
423
+ }
412
424
413
425
/*
414
426
* If the addresses of all matching symbols are recorded, the
@@ -420,8 +432,10 @@ static int test_kallsyms_basic_function(void)
420
432
break ;
421
433
}
422
434
423
- if (j == stat -> save_cnt )
435
+ if (j == stat -> save_cnt ) {
436
+ pr_info ("%s: j == save_cnt?!\n" , namebuf );
424
437
goto failed ;
438
+ }
425
439
}
426
440
}
427
441
0 commit comments