]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - tools/perf/util/probe-event.c
perf probe: Avoid setting probes on the same address for the same event
[mirror_ubuntu-jammy-kernel.git] / tools / perf / util / probe-event.c
index df713a5d1e26a919af244e9f863620874ffbbded..4316348961c4c5a83ab8f78a907f508dfd9fc97f 100644 (file)
@@ -2968,6 +2968,16 @@ static int find_probe_trace_events_from_map(struct perf_probe_event *pev,
        for (j = 0; j < num_matched_functions; j++) {
                sym = syms[j];
 
+               /* There can be duplicated symbols in the map */
+               for (i = 0; i < j; i++)
+                       if (sym->start == syms[i]->start) {
+                               pr_debug("Found duplicated symbol %s @ %" PRIx64 "\n",
+                                        sym->name, sym->start);
+                               break;
+                       }
+               if (i != j)
+                       continue;
+
                tev = (*tevs) + ret;
                tp = &tev->point;
                if (ret == num_matched_functions) {