mm/migrate: correct failure handling if !hugepage_migration_support()
[firefly-linux-kernel-4.4.55.git] / tools / perf / builtin-annotate.c
index 6fd52c8fa6824b8ba068a520de4824400a545473..0da603b79b617f6e11699cc133a35e01614edc9d 100644 (file)
@@ -69,15 +69,7 @@ static int perf_evsel__add_sample(struct perf_evsel *evsel,
        if (he == NULL)
                return -ENOMEM;
 
-       ret = 0;
-       if (he->ms.sym != NULL) {
-               struct annotation *notes = symbol__annotation(he->ms.sym);
-               if (notes->src == NULL && symbol__alloc_hist(he->ms.sym) < 0)
-                       return -ENOMEM;
-
-               ret = hist_entry__inc_addr_samples(he, evsel->idx, al->addr);
-       }
-
+       ret = hist_entry__inc_addr_samples(he, evsel->idx, al->addr);
        evsel->hists.stats.total_period += sample->period;
        hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE);
        return ret;
@@ -188,8 +180,7 @@ find_next:
                         * symbol, free he->ms.sym->src to signal we already
                         * processed this symbol.
                         */
-                       free(notes->src);
-                       notes->src = NULL;
+                       zfree(&notes->src);
                }
        }
 }
@@ -241,7 +232,7 @@ static int __cmd_annotate(struct perf_annotate *ann)
                perf_session__fprintf_dsos(session, stdout);
 
        total_nr_samples = 0;
-       list_for_each_entry(pos, &session->evlist->entries, node) {
+       evlist__for_each(session->evlist, pos) {
                struct hists *hists = &pos->hists;
                u32 nr_samples = hists->stats.nr_events[PERF_RECORD_SAMPLE];