perf tools: Remove hists from evsel
[cascardo/linux.git] / tools / perf / builtin-top.c
index 8ab9716..0aa7747 100644 (file)
@@ -1047,7 +1047,6 @@ parse_percent_limit(const struct option *opt, const char *arg,
 
 int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
 {
-       int status = -1;
        char errbuf[BUFSIZ];
        struct perf_top top = {
                .count_filter        = 5,
@@ -1165,6 +1164,10 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
                "perf top [<options>]",
                NULL
        };
+       int status = hists__init();
+
+       if (status < 0)
+               return status;
 
        top.evlist = perf_evlist__new();
        if (top.evlist == NULL)