Skip to contentSkip to conversation

tracing: Hide get_vm_area() from MMUless builds

PATCH New Steven Rostedt 1 participant 1 message Apr 7, 2025 Tracing

lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

PATCH 1/1 tracing: Hide get_vm_area() from MMUless builds

From: Steven Rostedt <[email protected]>

The function get_vm_area() is not defined for non-MMU builds and causes a build error if it is used. Hide the map_pages() function around a:

#ifdef CONFIG_MMU

to keep it from being compiled when CONFIG_MMU is not set.

Fixes 394f3f02de531 ("tracing: Use vmap_page_range() to map memmap ring buffer")
---
 kernel/trace/trace.c | 7 +++++++
 1 file changed, 7 insertions(+)
kernel/trace/trace.c +7 -0
index b581e388a9d9..8ddf6b17215c 100644
@@ -9806,6 +9806,7 @@ static int instance_mkdir(const char *name)
 	return ret;
 }
 
+#ifdef CONFIG_MMU
 static u64 map_pages(unsigned long start, unsigned long size)
 {
 	unsigned long vmap_start, vmap_end;
@@ -9828,6 +9829,12 @@ static u64 map_pages(unsigned long start, unsigned long size)
 
 	return (u64)vmap_start;
 }
+#else
+static inline u64 map_pages(unsigned long start, unsigned long size)
+{
+	return 0;
+}
+#endif
 
 /**
  * trace_array_get_by_name - Create/Lookup a trace array, given its name.
Signature · 1 line
2.47.2