]> Git Repo - linux.git/blobdiff - tools/perf/builtin-annotate.c
selinux: Remove security_ops extern
[linux.git] / tools / perf / builtin-annotate.c
index 4087ab19823c2f843c50e18d7b8e5042a079032f..1ec429fef2be9354d79400efe074e707229bef2f 100644 (file)
@@ -46,7 +46,7 @@ struct perf_annotate {
 };
 
 static int perf_evsel__add_sample(struct perf_evsel *evsel,
-                                 struct perf_sample *sample,
+                                 struct perf_sample *sample __maybe_unused,
                                  struct addr_location *al,
                                  struct perf_annotate *ann)
 {
@@ -65,21 +65,13 @@ static int perf_evsel__add_sample(struct perf_evsel *evsel,
                return 0;
        }
 
-       he = __hists__add_entry(&evsel->hists, al, NULL, NULL, NULL, 1, 1, 0);
+       he = __hists__add_entry(&evsel->hists, al, NULL, NULL, NULL, 1, 1, 0,
+                               true);
        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);
-       }
-
-       evsel->hists.stats.total_period += sample->period;
-       hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE);
+       ret = hist_entry__inc_addr_samples(he, evsel->idx, al->addr);
+       hists__inc_nr_samples(&evsel->hists, true);
        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];
 
@@ -373,7 +364,7 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
 
        if (argc) {
                /*
-                * Special case: if there's an argument left then assume tha
+                * Special case: if there's an argument left then assume that
                 * it's a symbol filter:
                 */
                if (argc > 1)
This page took 0.034318 seconds and 4 git commands to generate.