aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic/hp-timing-common.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic/hp-timing-common.h')
-rw-r--r--sysdeps/generic/hp-timing-common.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/sysdeps/generic/hp-timing-common.h b/sysdeps/generic/hp-timing-common.h
index 0ffb853444..8749d25647 100644
--- a/sysdeps/generic/hp-timing-common.h
+++ b/sysdeps/generic/hp-timing-common.h
@@ -20,8 +20,6 @@
/* In case a platform supports timers in the hardware the following macros
and types must be defined:
- - HP_TIMING_AVAIL: test for availability.
-
- HP_TIMING_INLINE: this macro is non-zero if the functionality is not
implemented using function calls but instead uses some inlined code
which might simply consist of a few assembler instructions. We have to
@@ -47,16 +45,16 @@
/* Accumulate ADD into SUM. No attempt is made to be thread-safe. */
#define HP_TIMING_ACCUM_NT(Sum, Diff) ((Sum) += (Diff))
+#define HP_TIMING_PRINT_SIZE (3 * sizeof (hp_timing_t) + 1)
+
/* Write a decimal representation of the timing value into the given string. */
#define HP_TIMING_PRINT(Dest, Len, Val) \
do { \
- char __buf[20]; \
+ char __buf[HP_TIMING_PRINT_SIZE]; \
char *__dest = (Dest); \
size_t __len = (Len); \
char *__cp = _itoa ((Val), __buf + sizeof (__buf), 10, 0); \
size_t __cp_len = MIN (__buf + sizeof (__buf) - __cp, __len); \
memcpy (__dest, __cp, __cp_len); \
- memcpy (__dest + __cp_len, " cycles", \
- MIN (__len - __cp_len, sizeof (" cycles"))); \
__dest[__len - 1] = '\0'; \
} while (0)