]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - tools/perf/builtin-stat.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs...
[karo-tx-linux.git] / tools / perf / builtin-stat.c
index 02b2d8013a61e537bf80e5d110d6c2f2c3f6b150..0ff11d9b13be9cb5bfc9f86259dbd972be148d2e 100644 (file)
@@ -316,6 +316,8 @@ static int run_perf_stat(int argc __used, const char **argv)
                                      "\t Consider tweaking"
                                      " /proc/sys/kernel/perf_event_paranoid or running as root.",
                                      system_wide ? "system-wide " : "");
+                       } else if (errno == ENOENT) {
+                               error("%s event is not supported. ", event_name(counter));
                        } else {
                                error("open_counter returned with %d (%s). "
                                      "/bin/dmesg may provide additional information.\n",
@@ -683,8 +685,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix __used)
                nr_counters = ARRAY_SIZE(default_attrs);
 
                for (c = 0; c < ARRAY_SIZE(default_attrs); ++c) {
-                       pos = perf_evsel__new(default_attrs[c].type,
-                                             default_attrs[c].config,
+                       pos = perf_evsel__new(&default_attrs[c],
                                              nr_counters);
                        if (pos == NULL)
                                goto out;
@@ -742,6 +743,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix __used)
 out_free_fd:
        list_for_each_entry(pos, &evsel_list, node)
                perf_evsel__free_stat_priv(pos);
+       perf_evsel_list__delete();
 out:
        thread_map__delete(threads);
        threads = NULL;