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:	Wed, 25 Nov 2009 08:00:37 -0500
From:	Masami Hiramatsu <mhiramat@...hat.com>
To:	Lai Jiangshan <laijs@...fujitsu.com>
CC:	Ingo Molnar <mingo@...e.hu>, Steven Rostedt <rostedt@...dmis.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/3] trace_kprobes: don't output zero offset

Hi Lai,

Lai Jiangshan wrote:
> 
> "symbol_name+0" is not so friendly.
> It makes the output longer.

Hmm, I've added +0 just for convenience of parser programs.
But anyway, skipping it is not so costly option for them :-)

Acked-by: Masami Hiramatsu <mhiramat@...hat.com>

> 
> Signed-off-by: Lai Jiangshan <laijs@...fujitsu.com>
> ---
> diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
> index 9e42f2a..e82bea3 100644
> --- a/kernel/trace/trace_kprobe.c
> +++ b/kernel/trace/trace_kprobe.c
> @@ -243,7 +243,11 @@ static int probe_arg_string(char *buf, size_t n, struct fetch_func *ff)
>  		ret = snprintf(buf, n, "@0x%p", ff->data);
>  	else if (ff->func == fetch_symbol) {
>  		struct symbol_cache *sc = ff->data;
> -		ret = snprintf(buf, n, "@%s%+ld", sc->symbol, sc->offset);
> +		if (sc->offset)
> +			ret = snprintf(buf, n, "@%s%+ld", sc->symbol,
> +					sc->offset);
> +		else
> +			ret = snprintf(buf, n, "@%s", sc->symbol);
>  	} else if (ff->func == fetch_retvalue)
>  		ret = snprintf(buf, n, "$retval");
>  	else if (ff->func == fetch_stack_address)
> @@ -760,10 +764,12 @@ static int probes_seq_show(struct seq_file *m, void *v)
>  	seq_printf(m, "%c", probe_is_return(tp) ? 'r' : 'p');
>  	seq_printf(m, ":%s/%s", tp->call.system, tp->call.name);
>  
> -	if (tp->symbol)
> +	if (!tp->symbol)
> +		seq_printf(m, " 0x%p", tp->rp.kp.addr);
> +	else if (tp->rp.kp.offset)
>  		seq_printf(m, " %s+%u", probe_symbol(tp), tp->rp.kp.offset);
>  	else
> -		seq_printf(m, " 0x%p", tp->rp.kp.addr);
> +		seq_printf(m, " %s", probe_symbol(tp));
>  
>  	for (i = 0; i < tp->nr_args; i++) {
>  		ret = probe_arg_string(buf, MAX_ARGSTR_LEN, &tp->args[i].fetch);
> 
> 

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@...hat.com

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