lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 28 Nov 2013 16:51:32 -0500
From:	Dongsheng Yang <yangds.fnst@...fujitsu.com>
To:	Dongsheng Yang <yangds.fnst@...fujitsu.com>
CC:	linux-kernel@...r.kernel.org, eranian@...gle.com,
	dsahern@...il.com, adrian.hunter@...el.com,
	acme@...stprotocols.net, mingo@...hat.com, paulus@...ba.org,
	a.p.zijlstra@...llo.nl
Subject: Re: [PATCH] perf machine: Remove condition in machine__get_kernel_start_addr.


Sorry for the error patch :(, Please ignore it.

On 11/28/2013 04:47 PM, Dongsheng Yang wrote:
> In machine__get_kernel_start_addr, the code, which is
> using machine->root_dir to build filename, works for both
> host and guests initialized from guestmount. So this patch
> remove the branch for machine__is_host.
>
> Signed-off-by: Dongsheng Yang <yangds.fnst@...fujitsu.com>
> ---
>   tools/perf/util/machine.c | 16 ++++++----------
>   1 file changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
> index 84cdb07..52d9161 100644
> --- a/tools/perf/util/machine.c
> +++ b/tools/perf/util/machine.c
> @@ -502,15 +502,11 @@ static u64 machine__get_kernel_start_addr(struct machine *machine)
>   	char path[PATH_MAX];
>   	struct process_args args;
>   
> -	if (machine__is_host(machine)) {
> -		filename = "/proc/kallsyms";
> -	} else {
> -		if (machine__is_default_guest(machine))
> -			filename = (char *)symbol_conf.default_guest_kallsyms;
> -		else {
> -			sprintf(path, "%s/proc/kallsyms", machine->root_dir);
> -			filename = path;
> -		}
> +	if (machine__is_default_guest(machine))
> +		filename = (char *)symbol_conf.default_guest_kallsyms;
> +	else {
> +		sprintf(path, "%s/proc/kallsyms", machine->root_dir);
> +		filename = path;
>   	}
>   
>   	if (symbol__restricted_filename(filename, "/proc/kallsyms"))
> @@ -589,7 +585,7 @@ int machines__create_guest_kernel_maps(struct machines *machines)
>   	if (symbol_conf.default_guest_vmlinux_name ||
>   	    symbol_conf.default_guest_modules ||
>   	    symbol_conf.default_guest_kallsyms) {
> -		machines__create_kernel_maps(machines, DEFAULT_GUEST_KERNEL_ID);
> +		machines__create_kernel_maps(machines, 20315);
>   	}
>   
>   	if (symbol_conf.guestmount) {

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ