[PATCH 5/6] Refactor hp-timing rtld usage

Wilco Dijkstra Wilco.Dijkstra@arm.com
Thu Feb 14 19:30:00 GMT 2019


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



More information about the Libc-alpha mailing list