All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC] New init sequence processing without init_sequence array
Date: Wed, 24 Aug 2011 08:48:18 +0200	[thread overview]
Message-ID: <20110824064819.0529D11F9E76@gemini.denx.de> (raw)
In-Reply-To: <CALButCLX42Q=u33gCOKA+LoZZ+RZO1Y-SXNhE8MK66DfrU9YPA@mail.gmail.com>

Dear Graeme Russ,

In message <CALButCLX42Q=u33gCOKA+LoZZ+RZO1Y-SXNhE8MK66DfrU9YPA@mail.gmail.com> you wrote:
> 
> > But frankly: do you consider this list above _readable_?
...
> grep is your friend - All you need to to is grep for GLOBAL (actually I
> think COMMON is a better name) and the ARCH, SOC, and BOARD keywords in
> the namespace for your board and voila - You have a sorted list of the
> init sequence for you board

Yes, this is exactly what I mean.  I will need additional tools to
be able to read the code.  I cannot - for example - print a few pages
of source code and check the lines that worked, or similar.

> > It would be trivial to enable printing the names from the loop; we
> > can't do it because we don't have the needed prerequisites yet in most
> > cases.
> 
> How so? I cannot see how you could create a macro which when used in the
> static array initialiser would send the function pointers to one array and
> the string names (or pointers to) to another array.

See the example in the CPP info pages: cpp.info, Node: Concatenation:

	#define COMMAND(NAME)  { #NAME, NAME ## _command }

> How does debugging in that case work now? There is no difference between
> the two implementations - the only thing I am changing is:

Right.  So we cannot say that the initcall code is any improvment here.

> > The difference is that I have a source file for reference.
> 
> Huh? You still do in the initcall case

Agreed.  I should have written: I have a _readable_ source file that
can be parsed without additional tools.

> > With the init.h as above I have no such reference.
> 
> No reference to what? - the static array of function pointers? This is of
> little use anyway as all your debug stepping will do is pick up the next
> value from the array

But I can _see_ what the next entry will be.

> No, it becomes a clean linear list of the init sequence from which you
> can easily grep out the noise. This list will never have an init step
> defined out-of-order. If INIT_YOUR_BOARD_ETHERNET occurs after
> INIT_YOUR_ARCH_PCI in the list then you know your board initialises its
> Ehternet after the arch has initialised PCI

If I see some INIT_YOUR_ARCH_FOO in this list - how can I see if this
is actually being executed on my specific board?  This might depend on
a number of feature selections, so it is run on one board but not on
another.

Yes, you remove the #ifdef's - but here in this case this is exactly
the information that would be needed one way or another.


I bet that rather sooner than later you will end up with some toold
that parses either the ELF file or the linker map or the symbol table
to generate a readable list for the current build.  I bet a case of
beer that you will need such a tool.  We don't need it now.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If there are self-made purgatories, then we all have to live in them.
	-- Spock, "This Side of Paradise", stardate 3417.7

  reply	other threads:[~2011-08-24  6:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-17 13:22 [U-Boot] [RFC] New init sequence processing without init_sequence array Graeme Russ
2011-08-22 20:10 ` Wolfgang Denk
2011-08-22 23:20   ` Graeme Russ
2011-08-23 11:49     ` Wolfgang Denk
2011-08-23 23:20       ` Graeme Russ
2011-08-24  5:38         ` Wolfgang Denk
2011-08-24  5:57           ` Graeme Russ
2011-08-24  6:48             ` Wolfgang Denk [this message]
2011-08-24  7:06               ` Graeme Russ
2011-08-24 12:49                 ` Wolfgang Denk
2011-08-24 12:56                   ` Graeme Russ
2011-08-24 13:24                     ` Wolfgang Denk
2011-08-24 13:58                       ` Graeme Russ
2011-08-24 23:00                         ` Graeme Russ
2011-08-24 23:41                           ` Simon Glass
2011-08-25  2:45                             ` Graeme Russ
2011-08-24 13:46               ` Detlev Zundel
2011-08-23  0:17   ` Graeme Russ
2011-08-23  1:00   ` Mike Frysinger
2011-08-23  1:10     ` Graeme Russ
2011-08-23 11:52     ` Wolfgang Denk

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=20110824064819.0529D11F9E76@gemini.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.