builtin-test.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * builtin-test.c
  4. *
  5. * Builtin regression testing command: ever growing number of sanity tests
  6. */
  7. #include <fcntl.h>
  8. #include <errno.h>
  9. #include <unistd.h>
  10. #include <string.h>
  11. #include <stdlib.h>
  12. #include <sys/types.h>
  13. #include <dirent.h>
  14. #include <sys/wait.h>
  15. #include <sys/stat.h>
  16. #include "builtin.h"
  17. #include "hist.h"
  18. #include "intlist.h"
  19. #include "tests.h"
  20. #include "debug.h"
  21. #include "color.h"
  22. #include <subcmd/parse-options.h>
  23. #include "string2.h"
  24. #include "symbol.h"
  25. #include "util/rlimit.h"
  26. #include <linux/kernel.h>
  27. #include <linux/string.h>
  28. #include <subcmd/exec-cmd.h>
  29. static bool dont_fork;
  30. struct test __weak arch_tests[] = {
  31. {
  32. .func = NULL,
  33. },
  34. };
  35. static struct test generic_tests[] = {
  36. {
  37. .desc = "vmlinux symtab matches kallsyms",
  38. .func = test__vmlinux_matches_kallsyms,
  39. },
  40. {
  41. .desc = "Detect openat syscall event",
  42. .func = test__openat_syscall_event,
  43. },
  44. {
  45. .desc = "Detect openat syscall event on all cpus",
  46. .func = test__openat_syscall_event_on_all_cpus,
  47. },
  48. {
  49. .desc = "Read samples using the mmap interface",
  50. .func = test__basic_mmap,
  51. },
  52. {
  53. .desc = "Test data source output",
  54. .func = test__mem,
  55. },
  56. {
  57. .desc = "Parse event definition strings",
  58. .func = test__parse_events,
  59. },
  60. {
  61. .desc = "Simple expression parser",
  62. .func = test__expr,
  63. },
  64. {
  65. .desc = "PERF_RECORD_* events & perf_sample fields",
  66. .func = test__PERF_RECORD,
  67. },
  68. {
  69. .desc = "Parse perf pmu format",
  70. .func = test__pmu,
  71. },
  72. {
  73. .desc = "PMU events",
  74. .func = test__pmu_events,
  75. .subtest = {
  76. .skip_if_fail = false,
  77. .get_nr = test__pmu_events_subtest_get_nr,
  78. .get_desc = test__pmu_events_subtest_get_desc,
  79. .skip_reason = test__pmu_events_subtest_skip_reason,
  80. },
  81. },
  82. {
  83. .desc = "DSO data read",
  84. .func = test__dso_data,
  85. },
  86. {
  87. .desc = "DSO data cache",
  88. .func = test__dso_data_cache,
  89. },
  90. {
  91. .desc = "DSO data reopen",
  92. .func = test__dso_data_reopen,
  93. },
  94. {
  95. .desc = "Roundtrip evsel->name",
  96. .func = test__perf_evsel__roundtrip_name_test,
  97. },
  98. {
  99. .desc = "Parse sched tracepoints fields",
  100. .func = test__perf_evsel__tp_sched_test,
  101. },
  102. {
  103. .desc = "syscalls:sys_enter_openat event fields",
  104. .func = test__syscall_openat_tp_fields,
  105. },
  106. {
  107. .desc = "Setup struct perf_event_attr",
  108. .func = test__attr,
  109. },
  110. {
  111. .desc = "Match and link multiple hists",
  112. .func = test__hists_link,
  113. },
  114. {
  115. .desc = "'import perf' in python",
  116. .func = test__python_use,
  117. },
  118. {
  119. .desc = "Breakpoint overflow signal handler",
  120. .func = test__bp_signal,
  121. .is_supported = test__bp_signal_is_supported,
  122. },
  123. {
  124. .desc = "Breakpoint overflow sampling",
  125. .func = test__bp_signal_overflow,
  126. .is_supported = test__bp_signal_is_supported,
  127. },
  128. {
  129. .desc = "Breakpoint accounting",
  130. .func = test__bp_accounting,
  131. .is_supported = test__bp_account_is_supported,
  132. },
  133. {
  134. .desc = "Watchpoint",
  135. .func = test__wp,
  136. .is_supported = test__wp_is_supported,
  137. .subtest = {
  138. .skip_if_fail = false,
  139. .get_nr = test__wp_subtest_get_nr,
  140. .get_desc = test__wp_subtest_get_desc,
  141. },
  142. },
  143. {
  144. .desc = "Number of exit events of a simple workload",
  145. .func = test__task_exit,
  146. },
  147. {
  148. .desc = "Software clock events period values",
  149. .func = test__sw_clock_freq,
  150. },
  151. {
  152. .desc = "Object code reading",
  153. .func = test__code_reading,
  154. },
  155. {
  156. .desc = "Sample parsing",
  157. .func = test__sample_parsing,
  158. },
  159. {
  160. .desc = "Use a dummy software event to keep tracking",
  161. .func = test__keep_tracking,
  162. },
  163. {
  164. .desc = "Parse with no sample_id_all bit set",
  165. .func = test__parse_no_sample_id_all,
  166. },
  167. {
  168. .desc = "Filter hist entries",
  169. .func = test__hists_filter,
  170. },
  171. {
  172. .desc = "Lookup mmap thread",
  173. .func = test__mmap_thread_lookup,
  174. },
  175. {
  176. .desc = "Share thread maps",
  177. .func = test__thread_maps_share,
  178. },
  179. {
  180. .desc = "Sort output of hist entries",
  181. .func = test__hists_output,
  182. },
  183. {
  184. .desc = "Cumulate child hist entries",
  185. .func = test__hists_cumulate,
  186. },
  187. {
  188. .desc = "Track with sched_switch",
  189. .func = test__switch_tracking,
  190. },
  191. {
  192. .desc = "Filter fds with revents mask in a fdarray",
  193. .func = test__fdarray__filter,
  194. },
  195. {
  196. .desc = "Add fd to a fdarray, making it autogrow",
  197. .func = test__fdarray__add,
  198. },
  199. {
  200. .desc = "kmod_path__parse",
  201. .func = test__kmod_path__parse,
  202. },
  203. {
  204. .desc = "Thread map",
  205. .func = test__thread_map,
  206. },
  207. {
  208. .desc = "LLVM search and compile",
  209. .func = test__llvm,
  210. .subtest = {
  211. .skip_if_fail = true,
  212. .get_nr = test__llvm_subtest_get_nr,
  213. .get_desc = test__llvm_subtest_get_desc,
  214. },
  215. },
  216. {
  217. .desc = "Session topology",
  218. .func = test__session_topology,
  219. },
  220. {
  221. .desc = "BPF filter",
  222. .func = test__bpf,
  223. .subtest = {
  224. .skip_if_fail = true,
  225. .get_nr = test__bpf_subtest_get_nr,
  226. .get_desc = test__bpf_subtest_get_desc,
  227. },
  228. },
  229. {
  230. .desc = "Synthesize thread map",
  231. .func = test__thread_map_synthesize,
  232. },
  233. {
  234. .desc = "Remove thread map",
  235. .func = test__thread_map_remove,
  236. },
  237. {
  238. .desc = "Synthesize cpu map",
  239. .func = test__cpu_map_synthesize,
  240. },
  241. {
  242. .desc = "Synthesize stat config",
  243. .func = test__synthesize_stat_config,
  244. },
  245. {
  246. .desc = "Synthesize stat",
  247. .func = test__synthesize_stat,
  248. },
  249. {
  250. .desc = "Synthesize stat round",
  251. .func = test__synthesize_stat_round,
  252. },
  253. {
  254. .desc = "Synthesize attr update",
  255. .func = test__event_update,
  256. },
  257. {
  258. .desc = "Event times",
  259. .func = test__event_times,
  260. },
  261. {
  262. .desc = "Read backward ring buffer",
  263. .func = test__backward_ring_buffer,
  264. },
  265. {
  266. .desc = "Print cpu map",
  267. .func = test__cpu_map_print,
  268. },
  269. {
  270. .desc = "Merge cpu map",
  271. .func = test__cpu_map_merge,
  272. },
  273. {
  274. .desc = "Probe SDT events",
  275. .func = test__sdt_event,
  276. },
  277. {
  278. .desc = "is_printable_array",
  279. .func = test__is_printable_array,
  280. },
  281. {
  282. .desc = "Print bitmap",
  283. .func = test__bitmap_print,
  284. },
  285. {
  286. .desc = "perf hooks",
  287. .func = test__perf_hooks,
  288. },
  289. {
  290. .desc = "builtin clang support",
  291. .func = test__clang,
  292. .subtest = {
  293. .skip_if_fail = true,
  294. .get_nr = test__clang_subtest_get_nr,
  295. .get_desc = test__clang_subtest_get_desc,
  296. }
  297. },
  298. {
  299. .desc = "unit_number__scnprintf",
  300. .func = test__unit_number__scnprint,
  301. },
  302. {
  303. .desc = "mem2node",
  304. .func = test__mem2node,
  305. },
  306. {
  307. .desc = "time utils",
  308. .func = test__time_utils,
  309. },
  310. {
  311. .desc = "Test jit_write_elf",
  312. .func = test__jit_write_elf,
  313. },
  314. {
  315. .desc = "Test libpfm4 support",
  316. .func = test__pfm,
  317. .subtest = {
  318. .skip_if_fail = true,
  319. .get_nr = test__pfm_subtest_get_nr,
  320. .get_desc = test__pfm_subtest_get_desc,
  321. }
  322. },
  323. {
  324. .desc = "Test api io",
  325. .func = test__api_io,
  326. },
  327. {
  328. .desc = "maps__merge_in",
  329. .func = test__maps__merge_in,
  330. },
  331. {
  332. .desc = "Demangle Java",
  333. .func = test__demangle_java,
  334. },
  335. {
  336. .desc = "Parse and process metrics",
  337. .func = test__parse_metric,
  338. },
  339. {
  340. .desc = "PE file support",
  341. .func = test__pe_file_parsing,
  342. },
  343. {
  344. .desc = "Event expansion for cgroups",
  345. .func = test__expand_cgroup_events,
  346. },
  347. {
  348. .func = NULL,
  349. },
  350. };
  351. static struct test *tests[] = {
  352. generic_tests,
  353. arch_tests,
  354. };
  355. static bool perf_test__matches(const char *desc, int curr, int argc, const char *argv[])
  356. {
  357. int i;
  358. if (argc == 0)
  359. return true;
  360. for (i = 0; i < argc; ++i) {
  361. char *end;
  362. long nr = strtoul(argv[i], &end, 10);
  363. if (*end == '\0') {
  364. if (nr == curr + 1)
  365. return true;
  366. continue;
  367. }
  368. if (strcasestr(desc, argv[i]))
  369. return true;
  370. }
  371. return false;
  372. }
  373. static int run_test(struct test *test, int subtest)
  374. {
  375. int status, err = -1, child = dont_fork ? 0 : fork();
  376. char sbuf[STRERR_BUFSIZE];
  377. if (child < 0) {
  378. pr_err("failed to fork test: %s\n",
  379. str_error_r(errno, sbuf, sizeof(sbuf)));
  380. return -1;
  381. }
  382. if (!child) {
  383. if (!dont_fork) {
  384. pr_debug("test child forked, pid %d\n", getpid());
  385. if (verbose <= 0) {
  386. int nullfd = open("/dev/null", O_WRONLY);
  387. if (nullfd >= 0) {
  388. close(STDERR_FILENO);
  389. close(STDOUT_FILENO);
  390. dup2(nullfd, STDOUT_FILENO);
  391. dup2(STDOUT_FILENO, STDERR_FILENO);
  392. close(nullfd);
  393. }
  394. } else {
  395. signal(SIGSEGV, sighandler_dump_stack);
  396. signal(SIGFPE, sighandler_dump_stack);
  397. }
  398. }
  399. err = test->func(test, subtest);
  400. if (!dont_fork)
  401. exit(err);
  402. }
  403. if (!dont_fork) {
  404. wait(&status);
  405. if (WIFEXITED(status)) {
  406. err = (signed char)WEXITSTATUS(status);
  407. pr_debug("test child finished with %d\n", err);
  408. } else if (WIFSIGNALED(status)) {
  409. err = -1;
  410. pr_debug("test child interrupted\n");
  411. }
  412. }
  413. return err;
  414. }
  415. #define for_each_test(j, t) \
  416. for (j = 0; j < ARRAY_SIZE(tests); j++) \
  417. for (t = &tests[j][0]; t->func; t++)
  418. static int test_and_print(struct test *t, bool force_skip, int subtest)
  419. {
  420. int err;
  421. if (!force_skip) {
  422. pr_debug("\n--- start ---\n");
  423. err = run_test(t, subtest);
  424. pr_debug("---- end ----\n");
  425. } else {
  426. pr_debug("\n--- force skipped ---\n");
  427. err = TEST_SKIP;
  428. }
  429. if (!t->subtest.get_nr)
  430. pr_debug("%s:", t->desc);
  431. else
  432. pr_debug("%s subtest %d:", t->desc, subtest + 1);
  433. switch (err) {
  434. case TEST_OK:
  435. pr_info(" Ok\n");
  436. break;
  437. case TEST_SKIP: {
  438. const char *skip_reason = NULL;
  439. if (t->subtest.skip_reason)
  440. skip_reason = t->subtest.skip_reason(subtest);
  441. if (skip_reason)
  442. color_fprintf(stderr, PERF_COLOR_YELLOW, " Skip (%s)\n", skip_reason);
  443. else
  444. color_fprintf(stderr, PERF_COLOR_YELLOW, " Skip\n");
  445. }
  446. break;
  447. case TEST_FAIL:
  448. default:
  449. color_fprintf(stderr, PERF_COLOR_RED, " FAILED!\n");
  450. break;
  451. }
  452. return err;
  453. }
  454. static const char *shell_test__description(char *description, size_t size,
  455. const char *path, const char *name)
  456. {
  457. FILE *fp;
  458. char filename[PATH_MAX];
  459. path__join(filename, sizeof(filename), path, name);
  460. fp = fopen(filename, "r");
  461. if (!fp)
  462. return NULL;
  463. /* Skip shebang */
  464. while (fgetc(fp) != '\n');
  465. description = fgets(description, size, fp);
  466. fclose(fp);
  467. return description ? strim(description + 1) : NULL;
  468. }
  469. #define for_each_shell_test(dir, base, ent) \
  470. while ((ent = readdir(dir)) != NULL) \
  471. if (!is_directory(base, ent) && ent->d_name[0] != '.')
  472. static const char *shell_tests__dir(char *path, size_t size)
  473. {
  474. const char *devel_dirs[] = { "./tools/perf/tests", "./tests", };
  475. char *exec_path;
  476. unsigned int i;
  477. for (i = 0; i < ARRAY_SIZE(devel_dirs); ++i) {
  478. struct stat st;
  479. if (!lstat(devel_dirs[i], &st)) {
  480. scnprintf(path, size, "%s/shell", devel_dirs[i]);
  481. if (!lstat(devel_dirs[i], &st))
  482. return path;
  483. }
  484. }
  485. /* Then installed path. */
  486. exec_path = get_argv_exec_path();
  487. scnprintf(path, size, "%s/tests/shell", exec_path);
  488. free(exec_path);
  489. return path;
  490. }
  491. static int shell_tests__max_desc_width(void)
  492. {
  493. DIR *dir;
  494. struct dirent *ent;
  495. char path_dir[PATH_MAX];
  496. const char *path = shell_tests__dir(path_dir, sizeof(path_dir));
  497. int width = 0;
  498. if (path == NULL)
  499. return -1;
  500. dir = opendir(path);
  501. if (!dir)
  502. return -1;
  503. for_each_shell_test(dir, path, ent) {
  504. char bf[256];
  505. const char *desc = shell_test__description(bf, sizeof(bf), path, ent->d_name);
  506. if (desc) {
  507. int len = strlen(desc);
  508. if (width < len)
  509. width = len;
  510. }
  511. }
  512. closedir(dir);
  513. return width;
  514. }
  515. struct shell_test {
  516. const char *dir;
  517. const char *file;
  518. };
  519. static int shell_test__run(struct test *test, int subdir __maybe_unused)
  520. {
  521. int err;
  522. char script[PATH_MAX];
  523. struct shell_test *st = test->priv;
  524. path__join(script, sizeof(script), st->dir, st->file);
  525. err = system(script);
  526. if (!err)
  527. return TEST_OK;
  528. return WEXITSTATUS(err) == 2 ? TEST_SKIP : TEST_FAIL;
  529. }
  530. static int run_shell_tests(int argc, const char *argv[], int i, int width)
  531. {
  532. DIR *dir;
  533. struct dirent *ent;
  534. char path_dir[PATH_MAX];
  535. struct shell_test st = {
  536. .dir = shell_tests__dir(path_dir, sizeof(path_dir)),
  537. };
  538. if (st.dir == NULL)
  539. return -1;
  540. dir = opendir(st.dir);
  541. if (!dir) {
  542. pr_err("failed to open shell test directory: %s\n",
  543. st.dir);
  544. return -1;
  545. }
  546. for_each_shell_test(dir, st.dir, ent) {
  547. int curr = i++;
  548. char desc[256];
  549. struct test test = {
  550. .desc = shell_test__description(desc, sizeof(desc), st.dir, ent->d_name),
  551. .func = shell_test__run,
  552. .priv = &st,
  553. };
  554. if (!perf_test__matches(test.desc, curr, argc, argv))
  555. continue;
  556. st.file = ent->d_name;
  557. pr_info("%2d: %-*s:", i, width, test.desc);
  558. test_and_print(&test, false, -1);
  559. }
  560. closedir(dir);
  561. return 0;
  562. }
  563. static int __cmd_test(int argc, const char *argv[], struct intlist *skiplist)
  564. {
  565. struct test *t;
  566. unsigned int j;
  567. int i = 0;
  568. int width = shell_tests__max_desc_width();
  569. for_each_test(j, t) {
  570. int len = strlen(t->desc);
  571. if (width < len)
  572. width = len;
  573. }
  574. for_each_test(j, t) {
  575. int curr = i++, err;
  576. int subi;
  577. if (!perf_test__matches(t->desc, curr, argc, argv)) {
  578. bool skip = true;
  579. int subn;
  580. if (!t->subtest.get_nr)
  581. continue;
  582. subn = t->subtest.get_nr();
  583. for (subi = 0; subi < subn; subi++) {
  584. if (perf_test__matches(t->subtest.get_desc(subi), curr, argc, argv))
  585. skip = false;
  586. }
  587. if (skip)
  588. continue;
  589. }
  590. if (t->is_supported && !t->is_supported()) {
  591. pr_debug("%2d: %-*s: Disabled\n", i, width, t->desc);
  592. continue;
  593. }
  594. pr_info("%2d: %-*s:", i, width, t->desc);
  595. if (intlist__find(skiplist, i)) {
  596. color_fprintf(stderr, PERF_COLOR_YELLOW, " Skip (user override)\n");
  597. continue;
  598. }
  599. if (!t->subtest.get_nr) {
  600. test_and_print(t, false, -1);
  601. } else {
  602. int subn = t->subtest.get_nr();
  603. /*
  604. * minus 2 to align with normal testcases.
  605. * For subtest we print additional '.x' in number.
  606. * for example:
  607. *
  608. * 35: Test LLVM searching and compiling :
  609. * 35.1: Basic BPF llvm compiling test : Ok
  610. */
  611. int subw = width > 2 ? width - 2 : width;
  612. bool skip = false;
  613. if (subn <= 0) {
  614. color_fprintf(stderr, PERF_COLOR_YELLOW,
  615. " Skip (not compiled in)\n");
  616. continue;
  617. }
  618. pr_info("\n");
  619. for (subi = 0; subi < subn; subi++) {
  620. int len = strlen(t->subtest.get_desc(subi));
  621. if (subw < len)
  622. subw = len;
  623. }
  624. for (subi = 0; subi < subn; subi++) {
  625. if (!perf_test__matches(t->subtest.get_desc(subi), curr, argc, argv))
  626. continue;
  627. pr_info("%2d.%1d: %-*s:", i, subi + 1, subw,
  628. t->subtest.get_desc(subi));
  629. err = test_and_print(t, skip, subi);
  630. if (err != TEST_OK && t->subtest.skip_if_fail)
  631. skip = true;
  632. }
  633. }
  634. }
  635. return run_shell_tests(argc, argv, i, width);
  636. }
  637. static int perf_test__list_shell(int argc, const char **argv, int i)
  638. {
  639. DIR *dir;
  640. struct dirent *ent;
  641. char path_dir[PATH_MAX];
  642. const char *path = shell_tests__dir(path_dir, sizeof(path_dir));
  643. if (path == NULL)
  644. return -1;
  645. dir = opendir(path);
  646. if (!dir)
  647. return -1;
  648. for_each_shell_test(dir, path, ent) {
  649. int curr = i++;
  650. char bf[256];
  651. struct test t = {
  652. .desc = shell_test__description(bf, sizeof(bf), path, ent->d_name),
  653. };
  654. if (!perf_test__matches(t.desc, curr, argc, argv))
  655. continue;
  656. pr_info("%2d: %s\n", i, t.desc);
  657. }
  658. closedir(dir);
  659. return 0;
  660. }
  661. static int perf_test__list(int argc, const char **argv)
  662. {
  663. unsigned int j;
  664. struct test *t;
  665. int i = 0;
  666. for_each_test(j, t) {
  667. int curr = i++;
  668. if (!perf_test__matches(t->desc, curr, argc, argv) ||
  669. (t->is_supported && !t->is_supported()))
  670. continue;
  671. pr_info("%2d: %s\n", i, t->desc);
  672. if (t->subtest.get_nr) {
  673. int subn = t->subtest.get_nr();
  674. int subi;
  675. for (subi = 0; subi < subn; subi++)
  676. pr_info("%2d:%1d: %s\n", i, subi + 1,
  677. t->subtest.get_desc(subi));
  678. }
  679. }
  680. perf_test__list_shell(argc, argv, i);
  681. return 0;
  682. }
  683. int cmd_test(int argc, const char **argv)
  684. {
  685. const char *test_usage[] = {
  686. "perf test [<options>] [{list <test-name-fragment>|[<test-name-fragments>|<test-numbers>]}]",
  687. NULL,
  688. };
  689. const char *skip = NULL;
  690. const struct option test_options[] = {
  691. OPT_STRING('s', "skip", &skip, "tests", "tests to skip"),
  692. OPT_INCR('v', "verbose", &verbose,
  693. "be more verbose (show symbol address, etc)"),
  694. OPT_BOOLEAN('F', "dont-fork", &dont_fork,
  695. "Do not fork for testcase"),
  696. OPT_END()
  697. };
  698. const char * const test_subcommands[] = { "list", NULL };
  699. struct intlist *skiplist = NULL;
  700. int ret = hists__init();
  701. if (ret < 0)
  702. return ret;
  703. argc = parse_options_subcommand(argc, argv, test_options, test_subcommands, test_usage, 0);
  704. if (argc >= 1 && !strcmp(argv[0], "list"))
  705. return perf_test__list(argc - 1, argv + 1);
  706. symbol_conf.priv_size = sizeof(int);
  707. symbol_conf.sort_by_name = true;
  708. symbol_conf.try_vmlinux_path = true;
  709. if (symbol__init(NULL) < 0)
  710. return -1;
  711. if (skip != NULL)
  712. skiplist = intlist__new(skip);
  713. /*
  714. * Tests that create BPF maps, for instance, need more than the 64K
  715. * default:
  716. */
  717. rlimit__bump_memlock();
  718. return __cmd_test(argc, argv, skiplist);
  719. }