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:	Tue, 26 Nov 2013 18:23:13 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc:	Steven Rostedt <rostedt@...dmis.org>,
	Namhyung Kim <namhyung.kim@....com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...hat.com>, Jiri Olsa <jolsa@...hat.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] tracing: Add $cpu and $current probe-vars

On 11/26, Masami Hiramatsu wrote:
>
> (2013/11/26 4:29), Oleg Nesterov wrote:
> > +#define PSEUDO_REG_OFFSET	4096	/* arbitrary value > MAX_REG_OFFSET */
> > +
> > +static unsigned long probe_get_register(struct pt_regs *regs, unsigned long offset)
> > +{
> > +	if (offset < PSEUDO_REG_OFFSET)
> > +		return regs_get_register(regs, offset);
> > +
> > +	return pseudo_reg_table[offset - PSEUDO_REG_OFFSET].fetch();
> > +}
>
>
> Hmm, I don't like this, since fetch_reg is the most frequently
> used fetch method, and it actually uses the offset in different
> way.

Sure, this overloads the usage of FETCH_MTD_reg/offset.

And btw, yes, the naming is ugly (I mean pseudo_*). But why this
is bad? This is cheap and simple.

And,

> Why don't you make another fetch function for vars?

This is what I tried to avoid ;) I do not want to add another
FETCH_MTD_. To me, this looks like unnecessary complication and
bloat (but see below).

> Perhaps, you can make fetch_retval more generic.

Please look at 2/2. It kills fetch_retval because we make
fetch_reg more generic (this patch), and this saves 300 bytes.

However. I understand that this is subjective, so please ignore.

Thanks,

Oleg.

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