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]
Message-ID: <alpine.DEB.1.10.0901160925480.22303@gandalf.stny.rr.com>
Date:	Fri, 16 Jan 2009 09:28:35 -0500 (EST)
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Frédéric Weisbecker <fweisbec@...il.com>
cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Chris Mason <chris.mason@...cle.com>,
	Steven Rostedt <srostedt@...hat.com>
Subject: Re: [PATCH 2/2] ftrace: add stack trace to function tracer



On Fri, 16 Jan 2009, Fr?d?ric Weisbecker wrote:

> Hi Steven,
> 
> 2009/1/16 Steven Rostedt <rostedt@...dmis.org>:
> > +static struct tracer_flags func_flags = {
> > +       .val = 0, /* By default: all flags disabled */
> > +       .opts = func_opts
> > +};
> > +
> > +static int func_set_flag(u32 old_flags, u32 bit, int set)
> > +{
> > +       if (bit == TRACE_FUNC_OPT_STACK) {
> > +               /* do nothing if already set */
> > +               if (!!set == !!(func_flags.val & TRACE_FUNC_OPT_STACK))
> > +                       return 0;
> 
> 
> This is just a small thing but set will always be 1 or 0. And if you want
> the current val of your options, you can take old_flags :-)

I never assume something is set to 0 or 1 ;-)

But I did overlook the "old_flags". Yeah that would be better to use.

> 
> Would you prefer I send a patch to not call the set_flag callback
> when the option set/unset by the user is already set/unset ?

Hmm, good question. That's the way I do it, but would that make sense fo
others?  Probably would be a good idea. We only want to know when the
flag changes.

-- Steve

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