--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -17,6 +17,7 @@
 #include <string.h>
 #include <stdarg.h>
 #include <limits.h>
+#include <libgen.h> /* for basename */
 #include <elf.h>

 #include "build-id.h"
