From: tixy@yxit.co.uk (Tixy)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/10] ARM: kprobes: Add config option for selecting the ARM kprobes tests
Date: Thu, 01 Sep 2011 08:15:46 +0100 [thread overview]
Message-ID: <1314861346.20321.40.camel@computer2> (raw)
In-Reply-To: <alpine.LFD.2.00.1108311836240.20358@xanadu.home>
On Wed, 2011-08-31 at 18:47 -0400, Nicolas Pitre wrote:
> On Tue, 30 Aug 2011, Tixy wrote:
[...]
> > When ARM_KPROBES_TEST_MODULE is configured for a stand-alone module,
> > rather than built-in, then
> >
> > #ifdef CONFIG_ARM_KPROBES_TEST_MODULE
> >
> > is false.
>
> OK... It seems that, when you have a tristate config symbol FOOBAR, if
> CONFIG_FOOBAR=y then the CONFIG_FOOBAR preprocessor symbol is defined.
> If you have CONFIG_FOOBAR=m then the CONFIG_FOOBAR_MODULE preprocessor
> symbol is defined.
That's useful to know.
> In your example above you would end up with
> CONFIG_ARM_KPROBES_TEST_MODULE_MODULE being defined.
>
> > I found other examples where people seemed to have gotten around this
> > by selecting a second config symbol and copied that. E.g.
> > FTRACE_STARTUP_TEST selects FTRACE_SELFTEST which is then used in
> > #ifdef statements.
> >
> > Is there a better way? If not, I should explain this anyway in the
> > changelog.
>
> What I'd suggest is that you have:
>
> config ARM_KPROBES_TEST
> tristate ...
>
> And then you may use this in the code:
>
> #ifdef CONFIG_ARM_KPROBES_TEST_MODULE
> EXPORT_SYMBOL_GPL(...);
> #endif
>
> so those symbols are only exported when necessary.
Yep, that works and is a lot cleaner, thanks.
I've also made the extern declarations for these exported symbols
unconditional in kprobes-test.h. It didn't seem worth trying to #ifdef
them to only exist when the test code is configured (like I was trying
to do in "[PATCH 06/10] ARM: kprobes: Add exports for test code").
--
Tixy
next prev parent reply other threads:[~2011-09-01 7:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-29 12:33 [PATCH 00/10] ARM: kprobes: Test code Tixy
2011-08-29 12:34 ` [PATCH 01/10] ARM: kprobes: Add config option for selecting the ARM kprobes tests Tixy
2011-08-29 18:44 ` Nicolas Pitre
2011-08-30 7:16 ` Tixy
2011-08-31 22:47 ` Nicolas Pitre
2011-09-01 7:15 ` Tixy [this message]
2011-08-29 12:34 ` [PATCH 02/10] ARM: kprobes: Add basic API tests Tixy
2011-08-29 12:34 ` [PATCH 03/10] ARM: kprobes: Framework for instruction set test cases Tixy
2011-08-29 12:34 ` [PATCH 04/10] ARM: kprobes: Add Thumb instruction simulation " Tixy
2011-08-29 12:34 ` [PATCH 05/10] ARM: kprobes: Add ARM " Tixy
2011-08-29 12:34 ` [PATCH 06/10] ARM: kprobes: Add exports for test code Tixy
2011-08-29 12:34 ` [PATCH 07/10] ARM: kprobes: Add decoding table self-consistency tests Tixy
2011-08-29 12:34 ` [PATCH 08/10] ARM: kprobes: Add decoding table test coverage analysis Tixy
2011-08-29 12:34 ` [PATCH 09/10] ARM: kprobes: Add some benchmarking to test module Tixy
2011-08-29 12:34 ` [PATCH 10/10] ARM: kprobes: Add introductory comment to test code Tixy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1314861346.20321.40.camel@computer2 \
--to=tixy@yxit.co.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).