* [PATCH] Fix LD_DEBUG=statistics on x86-64
@ 2004-03-17 12:52 Jakub Jelinek
2004-03-17 17:29 ` Ulrich Drepper
0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2004-03-17 12:52 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: Glibc hackers
Hi!
17214: runtime linker statistics:
17214: total startup time in dynamic loader: 12434 clock cycles
17214: time needed for relocation: 280243 clock cycles (%)
17214: number of relocations: 98
17214: number of relocations from cache: 3
17214: number of relative relocations: 1286
17214: time needed to load objects: 0 clock cycles (.0%)
certainly doesn't look correct.
The problem is that without volatile in the rdtsc asm GCC happily merges
HP_TIMING_NOW (start);
call something
HP_TIMING_NOW (stop);
so that stop == start (rdtsc done only before the call).
17232: runtime linker statistics:
17232: total startup time in dynamic loader: 733738 clock cycles
17232: time needed for relocation: 278644 clock cycles (37.9%)
17232: number of relocations: 83
17232: number of relocations from cache: 3
17232: number of relative relocations: 1295
17232: time needed to load objects: 326662 clock cycles (44.5%)
looks better.
2004-03-17 Jakub Jelinek <jakub@redhat.com>
* sysdeps/x86_64/hp-timing.h (HP_TIMING_NOW): Make asm volatile.
--- libc/sysdeps/x86_64/hp-timing.h.jj 2002-08-31 01:09:29.000000000 +0200
+++ libc/sysdeps/x86_64/hp-timing.h 2004-03-17 13:26:02.139127766 +0100
@@ -1,5 +1,5 @@
/* High precision, low overhead timing functions. x86-64 version.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,7 +25,8 @@
/* The "=A" constraint used in 32-bit mode does not work in 64-bit mode. */
# undef HP_TIMING_NOW
# define HP_TIMING_NOW(Var) \
- ({ unsigned int _hi, _lo; asm ("rdtsc" : "=a" (_lo), "=d" (_hi)); \
+ ({ unsigned int _hi, _lo; \
+ asm volatile ("rdtsc" : "=a" (_lo), "=d" (_hi)); \
(Var) = ((unsigned long long int) _hi << 32) | _lo; })
/* The funny business for 32-bit mode is not required here. */
Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix LD_DEBUG=statistics on x86-64
2004-03-17 12:52 [PATCH] Fix LD_DEBUG=statistics on x86-64 Jakub Jelinek
@ 2004-03-17 17:29 ` Ulrich Drepper
0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2004-03-17 17:29 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: Glibc hackers
Jakub Jelinek wrote:
> * sysdeps/x86_64/hp-timing.h (HP_TIMING_NOW): Make asm volatile.
Applied.
--
⧠Ulrich Drepper ⧠Red Hat, Inc. ⧠444 Castro St ⧠Mountain View, CA â
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-03-17 17:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-17 12:52 [PATCH] Fix LD_DEBUG=statistics on x86-64 Jakub Jelinek
2004-03-17 17:29 ` Ulrich Drepper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).