diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 252b72a5e59ef17fc477dc7cc87eb7b8dbac7699..6635fcd11ca558e1831d331a500474c8908a58d1 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -42,7 +42,7 @@ int perf_sample_size(u64 sample_type)
 	int i;
 
 	for (i = 0; i < 64; i++) {
-		if (mask & (1UL << i))
+		if (mask & (1ULL << i))
 			size++;
 	}