mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-01 09:13:37 +00:00
tracing: Use _text and the kernel offset in last_boot_info
Instead of using kaslr_offset() just record the location of "_text". This makes it possible for user space to use either the System.map or /proc/kallsyms as what to map all addresses to functions with. Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Link: https://lore.kernel.org/20250326220304.38dbedcd@gandalf.local.home Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
This commit is contained in:
parent
35a380ddbc
commit
028a58ec15
1 changed files with 6 additions and 12 deletions
|
|
@ -51,7 +51,7 @@
|
||||||
#include <linux/workqueue.h>
|
#include <linux/workqueue.h>
|
||||||
#include <linux/sort.h>
|
#include <linux/sort.h>
|
||||||
|
|
||||||
#include <asm/setup.h> /* COMMAND_LINE_SIZE and kaslr_offset() */
|
#include <asm/setup.h> /* COMMAND_LINE_SIZE */
|
||||||
|
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
#include "trace_output.h"
|
#include "trace_output.h"
|
||||||
|
|
@ -5995,7 +5995,7 @@ struct trace_mod_entry {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct trace_scratch {
|
struct trace_scratch {
|
||||||
unsigned long kaslr_addr;
|
unsigned long text_addr;
|
||||||
unsigned long nr_entries;
|
unsigned long nr_entries;
|
||||||
struct trace_mod_entry entries[];
|
struct trace_mod_entry entries[];
|
||||||
};
|
};
|
||||||
|
|
@ -6133,11 +6133,7 @@ static void update_last_data(struct trace_array *tr)
|
||||||
kfree_rcu(module_delta, rcu);
|
kfree_rcu(module_delta, rcu);
|
||||||
|
|
||||||
/* Set the persistent ring buffer meta data to this address */
|
/* Set the persistent ring buffer meta data to this address */
|
||||||
#ifdef CONFIG_RANDOMIZE_BASE
|
tscratch->text_addr = (unsigned long)_text;
|
||||||
tscratch->kaslr_addr = kaslr_offset();
|
|
||||||
#else
|
|
||||||
tscratch->kaslr_addr = 0;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -6996,7 +6992,7 @@ static void show_last_boot_header(struct seq_file *m, struct trace_array *tr)
|
||||||
* should not be the same as the current boot.
|
* should not be the same as the current boot.
|
||||||
*/
|
*/
|
||||||
if (tscratch && (tr->flags & TRACE_ARRAY_FL_LAST_BOOT))
|
if (tscratch && (tr->flags & TRACE_ARRAY_FL_LAST_BOOT))
|
||||||
seq_printf(m, "%lx\t[kernel]\n", tscratch->kaslr_addr);
|
seq_printf(m, "%lx\t[kernel]\n", tscratch->text_addr);
|
||||||
else
|
else
|
||||||
seq_puts(m, "# Current\n");
|
seq_puts(m, "# Current\n");
|
||||||
}
|
}
|
||||||
|
|
@ -9465,10 +9461,8 @@ static void setup_trace_scratch(struct trace_array *tr,
|
||||||
tr->scratch = tscratch;
|
tr->scratch = tscratch;
|
||||||
tr->scratch_size = size;
|
tr->scratch_size = size;
|
||||||
|
|
||||||
#ifdef CONFIG_RANDOMIZE_BASE
|
if (tscratch->text_addr)
|
||||||
if (tscratch->kaslr_addr)
|
tr->text_delta = (unsigned long)_text - tscratch->text_addr;
|
||||||
tr->text_delta = kaslr_offset() - tscratch->kaslr_addr;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (struct_size(tscratch, entries, tscratch->nr_entries) > size)
|
if (struct_size(tscratch, entries, tscratch->nr_entries) > size)
|
||||||
goto reset;
|
goto reset;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue