]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - tools/perf/builtin-top.c
perf kmem: Fix a memory leak
[karo-tx-linux.git] / tools / perf / builtin-top.c
index 4f81eeb998755a992f184104dd5390ffbc49d7b5..8f80df89603822e5431f45f1374cf926208f23ed 100644 (file)
@@ -235,7 +235,6 @@ static struct hist_entry *perf_evsel__add_hist_entry(struct perf_evsel *evsel,
        if (he == NULL)
                return NULL;
 
-       evsel->hists.stats.total_period += sample->period;
        hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE);
        return he;
 }
@@ -889,6 +888,10 @@ try_again:
                                ui__warning("The %s event is not supported.\n",
                                            event_name(counter));
                                goto out_err;
+                       } else if (err == EMFILE) {
+                               ui__warning("Too many events are opened.\n"
+                                           "Try again after reducing the number of events\n");
+                               goto out_err;
                        }
 
                        ui__warning("The sys_perf_event_open() syscall "