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] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 3 Jul 2009 12:54:56 +0300
From:	Eduard - Gabriel Munteanu <eduard.munteanu@...ux360.ro>
To:	Li Zefan <lizf@...fujitsu.com>
Cc:	Ingo Molnar <mingo@...e.hu>, Steven Rostedt <rostedt@...dmis.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Pekka Enberg <penberg@...helsinki.fi>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] kmemtrace: print binary output only if 'bin' option
	is set

On Fri, Jul 03, 2009 at 05:34:24PM +0800, Li Zefan wrote:
> Currently by default the output of kmemtrace is binary format instead
> of human-readable output.
> 
> This patch makes the following changes:
>   - We'll see human-readable output by default
>   - We'll see binary output if 'bin' option is set
> 
> Note: you may probably need to explicitly disable context-info binary
>       output:
> 
> 	# echo 0 > options/context-info
> 	# echo 1 > options/bin
> 	# cat trace_pipe
> 
> v2:
> - use %pF to print call_site
> 
> Signed-off-by: Li Zefan <lizf@...fujitsu.com>
> Acked-by: Pekka Enberg <penberg@...helsinki.fi>
> Acked-by: Eduard - Gabriel Munteanu <eduard.munteanu@...ux360.ro>
> ---
>  kernel/trace/kmemtrace.c |  120 ++++++++++++++++++++++++++++++++++-----------
>  1 files changed, 90 insertions(+), 30 deletions(-)
> 
> diff --git a/kernel/trace/kmemtrace.c b/kernel/trace/kmemtrace.c
> index 1edaa95..74903b6 100644
> --- a/kernel/trace/kmemtrace.c
> +++ b/kernel/trace/kmemtrace.c
> @@ -239,12 +239,52 @@ struct kmemtrace_user_event_alloc {
>  };
>  
>  static enum print_line_t
> -kmemtrace_print_alloc_user(struct trace_iterator *iter,
> -			   struct kmemtrace_alloc_entry *entry)
> +kmemtrace_print_alloc_user(struct trace_iterator *iter, int flags)
> +{
> +	struct trace_seq *s = &iter->seq;
> +	struct kmemtrace_alloc_entry *entry;
> +	int ret;
> +
> +	trace_assign_type(entry, iter->ent);
> +
> +	ret = trace_seq_printf(s, "type_id %d call_site %pF ptr %lu "
> +	    "bytes_req %lu bytes_alloc %lu gfp_flags %lu node %d\n",
> +	    entry->type_id, (void *)entry->call_site, (unsigned long)entry->ptr,
> +	    (unsigned long)entry->bytes_req, (unsigned long)entry->bytes_alloc,
> +	    (unsigned long)entry->gfp_flags, entry->node);
> +
> +	if (!ret)
> +		return TRACE_TYPE_PARTIAL_LINE;
> +	return TRACE_TYPE_HANDLED;
> +}

[snip]

kmemtrace_print_alloc_user() is meant for kmemtrace-user, that's what the
naming is meant to convey. Also, kmemtrace_print_alloc_user_bin is kinda
long. Could you leave the former as it was and come up with another name
for the non-binary variant?


	Eduard

--
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