Skip to content

Commit 4808595

Browse files
committed
tracing: Hide get_vm_area() from MMUless builds
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. Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Link: https://lore.kernel.org/20250407120111.2ccc9319@gandalf.local.home Reported-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Guenter Roeck <linux@roeck-us.net> Closes: https://lore.kernel.org/all/4f8ece8b-8862-4f7c-8ede-febd28f8a9fe@roeck-us.net/ Fixes: 394f3f0 ("tracing: Use vmap_page_range() to map memmap ring buffer") Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 0af2f6b commit 4808595

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kernel/trace/trace.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9806,6 +9806,7 @@ static int instance_mkdir(const char *name)
98069806
return ret;
98079807
}
98089808

9809+
#ifdef CONFIG_MMU
98099810
static u64 map_pages(unsigned long start, unsigned long size)
98109811
{
98119812
unsigned long vmap_start, vmap_end;
@@ -9828,6 +9829,12 @@ static u64 map_pages(unsigned long start, unsigned long size)
98289829

98299830
return (u64)vmap_start;
98309831
}
9832+
#else
9833+
static inline u64 map_pages(unsigned long start, unsigned long size)
9834+
{
9835+
return 0;
9836+
}
9837+
#endif
98319838

98329839
/**
98339840
* trace_array_get_by_name - Create/Lookup a trace array, given its name.

0 commit comments

Comments
 (0)