Re: [PATCH 1/3] x86: record relocation offset

From: Arnaldo Carvalho de Melo
Date: Wed Dec 30 2009 - 08:15:36 EST


Em Wed, Dec 30, 2009 at 11:16:57AM +0800, Xiao Guangrong escreveu:
> Record relocation offset, perf tools will use it
> to adjust kernel symbol address
> Signed-off-by: Xiao Guangrong <xiaoguangrong@xxxxxxxxxxxxxx>

> arch/x86/boot/compressed/head_32.S | 2 ++
> arch/x86/boot/compressed/head_64.S | 3 +++
> arch/x86/include/asm/bootparam.h | 3 ++-
> arch/x86/kernel/asm-offsets_32.c | 1 +
> arch/x86/kernel/asm-offsets_64.c | 1 +
> arch/x86/kernel/cpu/perf_event.c | 4 ++++
<SNIP>
> --- a/arch/x86/kernel/cpu/perf_event.c
> +++ b/arch/x86/kernel/cpu/perf_event.c
> @@ -26,8 +26,10 @@
> #include <asm/nmi.h>
> +#include <asm/setup.h>
>
> static u64 perf_event_mask __read_mostly;
> +static s32 relocate_offset;
>
> @@ -2173,6 +2175,8 @@ void __init init_hw_perf_events(void)
> pr_info("Performance Events: ");
>
> + relocate_offset = boot_params.relocate_offset;
> switch (boot_cpu_data.x86_vendor) {
> case X86_VENDOR_INTEL:

I'm no expert on the intricacies of boot_params, but all the other hunks
seems sensible, but can't we provide a non-perf specific way of getting
the relocate_offset? I guess other tools would also love to have it.

What about systemtap, don't they solve this in some other way? Frank?

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/