Jan Kiszka wrote:
 > Gilles Chanteperdrix wrote:
 > > Jan Kiszka wrote:
 > >  > In order to allow further optimizations of xnlock, I started with
 > >  > refactoring the related system.h. This improves the readability
 > >  > significantly, IMHO. It also happen to reduce the text size of
 > >  > __xnlock_get a bit by avoid redundant rthal_processor_id read-outs.
 > >  > 
 > >  > Another quirk I happen to remove: xnlock debugging depends on
 > >  > XENO_OPT_DEBUG_NUCLEUS, but needlessly we used to pick the debug version
 > >  > of xnlock_t already with XENO_OPT_DEBUG.
 > > 
 > > There is a lot of whitespace change in this patch, which make it hard to
 > > read.
 > Well, this patch is mostly about whitespace and formatting fixes (among
 > which ifdef reduction falls for me as well). But I can split it up if
 > desired.
 > > 
 > > Anyway, there are a few things I do not like in this patch:
 > > - macro which make reference to symbols defined elsewhere
 > Granted, not nice but so far the most compact approach I found. My goal
 > was to keep the lock implementations as pure as possible (you can easily
 > ignore the debug stuff now when reading xnlock_get/put).
 > > - functions arguments as macro, I find more readable the #ifdef with the
 > >   different function prototypes, the code can be read without having to
 > >   look at a different place.
 > I'm open to learn a third way to achieve what we need. I'm just
 > convinced that the old way was far worse.

I do not see a third approach. Maybe passing all the arguments to
the function, and count on the optimizer to remove useless arguments
when inlining ? 

 > Please consider for a better suggestion that the number of variants
 > increase with my ticket lock. That's why I tried to stuff things in
 > macros. Hmm, maybe we should simply get rid of the file/line/function
 > stuff completely and switch to IP + ksyms. What do you think?

I find the file line approach more precise. print_symbol gives you an
offset, you have to disassemble to understand what it means, and
it does not see inline functions.


                                            Gilles Chanteperdrix.

Xenomai-core mailing list

Reply via email to