This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 5/6] Refactor hp-timing rtld usage
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, nd <nd at arm dot com>
- Date: Thu, 14 Feb 2019 19:30:18 +0000
- Subject: Re: [PATCH 5/6] Refactor hp-timing rtld usage
- References: <20190208183343.29914-1-adhemerval.zanella@linaro.org>,<20190208183343.29914-5-adhemerval.zanella@linaro.org>
Hi Adhemerval,
This looks like a good cleanup. Given you change all the timing macros,
I wonder whether we can do the timing a more concise way to make the
code even cleaner. For example consider the typical case of a time
measurement that is accumulated:
+ RLTD_TIMING_DECLARE (load_time,);
+ RLTD_TIMING_DECLARE (start,);
+ RLTD_TIMING_DECLARE (stop,);
+ RLTD_TIMING_DECLARE (diff,);
+ RTLD_TIMING_NOW (start);
+ RTLD_TIMING_NOW (stop);
+ RTLD_TIMING_DIFF (diff, start, stop);
+ RTLD_TIMING_ACCUM_NT (load_time, diff);
We could replace all that with just:
RTLD_TIMING_VAR (load_time)
RTLD_TIMING_START (load_time)
RTLD_TIMING_STOP (load_time)
The first would declare and initialize the accumulator to zero, while start/stop
accumulate directly into it without requiring extra temporaries and explicit diff
and accumulate steps. What do you think?
Cheers,
Wilco