perf tools: Remove hists from evsel
[cascardo/linux.git] / tools / perf / tests / builtin-test.c
index 6f8b01b..162c978 100644 (file)
@@ -6,6 +6,7 @@
 #include <unistd.h>
 #include <string.h>
 #include "builtin.h"
+#include "hist.h"
 #include "intlist.h"
 #include "tests.h"
 #include "debug.h"
@@ -153,6 +154,18 @@ static struct test {
                .desc = "Test cumulation of child hist entries",
                .func = test__hists_cumulate,
        },
+       {
+               .desc = "Test tracking with sched_switch",
+               .func = test__switch_tracking,
+       },
+       {
+               .desc = "Filter fds with revents mask in a fdarray",
+               .func = test__fdarray__filter,
+       },
+       {
+               .desc = "Add fd to a fdarray, making it autogrow",
+               .func = test__fdarray__add,
+       },
        {
                .func = NULL,
        },
@@ -185,9 +198,11 @@ static bool perf_test__matches(int curr, int argc, const char *argv[])
 static int run_test(struct test *test)
 {
        int status, err = -1, child = fork();
+       char sbuf[STRERR_BUFSIZE];
 
        if (child < 0) {
-               pr_err("failed to fork test: %s\n", strerror(errno));
+               pr_err("failed to fork test: %s\n",
+                       strerror_r(errno, sbuf, sizeof(sbuf)));
                return -1;
        }
 
@@ -288,6 +303,10 @@ int cmd_test(int argc, const char **argv, const char *prefix __maybe_unused)
        OPT_END()
        };
        struct intlist *skiplist = NULL;
+        int ret = hists__init();
+
+        if (ret < 0)
+                return ret;
 
        argc = parse_options(argc, argv, test_options, test_usage, 0);
        if (argc >= 1 && !strcmp(argv[0], "list"))
@@ -297,7 +316,7 @@ int cmd_test(int argc, const char **argv, const char *prefix __maybe_unused)
        symbol_conf.sort_by_name = true;
        symbol_conf.try_vmlinux_path = true;
 
-       if (symbol__init() < 0)
+       if (symbol__init(NULL) < 0)
                return -1;
 
        if (skip != NULL)