This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]