diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index e3e5d55e39..c8d8891793 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -204,8 +204,11 @@ do_install() {
 
 do_configure[prefuncs] += "copy_perf_source_from_kernel"
 python copy_perf_source_from_kernel() {
-    sources = (d.getVar("PERF_SRC") or "").split()
+    set_kernel_staging_vars(d)
+
     src_dir = d.getVar("STAGING_KERNEL_DIR")
+    sources = (d.getVar("PERF_SRC") or "").split()
+
     dest_dir = d.getVar("S")
     bb.utils.mkdirhier(dest_dir)
     bb.utils.prunedir(dest_dir)
