lkml.org 
[lkml]   [2014]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 13/41] perf tools: Add machine__kernel_ip()
On Mon, Jul 14, 2014 at 01:02:37PM +0300, Adrian Hunter wrote:

SNIP

> +
> +int machine__get_kernel_start(struct machine *machine)
> +{
> + struct map *map = machine__kernel_map(machine, MAP__FUNCTION);
> + int err = 0;
> +
> + /*
> + * The only addresses above 2^63 are kernel addresses of a 64-bit
> + * kernel. Note that addresses are unsigned so that on a 32-bit system
> + * all addresses including kernel addresses are less than 2^32. In
> + * that case (32-bit system), if the kernel mapping is unknown, all
> + * addresses will be assumed to be in user space - see
> + * machine__kernel_ip().
> + */
> + machine->kernel_start = 1ULL << 63;
> + if (map) {
> + err = map__load(map, machine->symbol_filter);
> + if (map->start)
> + machine->kernel_start = map->start;
> + }
> + return err;
> +}

we just recently got machine__get_kernel_start_addr function,
I think we want just one function for this

jirka


\
 
 \ /
  Last update: 2014-07-16 17:01    [W:0.697 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site