This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
rtld_total_time change is bogus...
- From: "Alfred M. Szmidt" <ams at kemisten dot nu>
- To: libc-alpha at sources dot redhat dot com
- Date: Fri, 16 Jan 2004 03:31:55 +0100 (MET)
- Subject: rtld_total_time change is bogus...
The following change is bogus, rtld_total_time is defined if and only
if HP_TIMING_NONAVAIL is not define, but it tries to use it even if it
is not defined. Patch attached that reverts the behaviour as it was
before.
2004-01-14 Ulrich Drepper <drepper@redhat.com>
[...snip...]
* elf/rtld.c: Add attribute_relro to _dl_argc, _dl_argv, _dl_skip_args,
load_time, start_time, library_path, preloadlist, version_info,
any_debug.
Remove rtld_total_time. Make it a local variable. Pass pointer to
it to print_statistics. Change print_statistics accordingly.
2004-01-16 Alfred M. Szmidt <ams@kemisten.nu>
* elf/rtld.c (rtld_total_time) [!HP_TIMING_NONAVAIL]: New
variable.
(print_statistics): Don't take pointer as a argument. All callers
changed accordingly. Use rtld_total_time instead of a pointer.
Index: elf/rtld.c
===================================================================
RCS file: /cvs/glibc/libc/elf/rtld.c,v
retrieving revision 1.308
diff -u -r1.308 rtld.c
--- elf/rtld.c 15 Jan 2004 18:03:25 -0000 1.308
+++ elf/rtld.c 16 Jan 2004 02:07:55 -0000
@@ -57,7 +57,7 @@
const char *errsting);
/* Print the various times we collected. */
-static void print_statistics (hp_timing_t *total_timep);
+static void print_statistics (void);
/* This is a list of all the modes the dynamic loader can be in. */
enum mode { normal, list, verify, trace };
@@ -127,6 +127,7 @@
/* Variable for statistics. */
#ifndef HP_TIMING_NONAVAIL
+static hp_timing_t rtld_total_time;
static hp_timing_t relocate_time;
static hp_timing_t load_time attribute_relro;
static hp_timing_t start_time attribute_relro;
@@ -263,7 +264,6 @@
start_addr = _dl_sysdep_start (arg, &dl_main);
#ifndef HP_TIMING_NONAVAIL
hp_timing_t rtld_total_time;
if (HP_TIMING_AVAIL)
{
hp_timing_t end_time;
@@ -277,7 +277,7 @@
#endif
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_STATISTICS, 0))
- print_statistics (&rtld_total_time);
+ print_statistics ();
return start_addr;
}
@@ -2130,7 +2130,7 @@
/* Print the various times we collected. */
static void
-print_statistics (hp_timing_t *rtld_total_timep)
+print_statistics (void)
{
#ifndef HP_TIMING_NONAVAIL
char buf[200];
@@ -2140,7 +2140,7 @@
/* Total time rtld used. */
if (HP_TIMING_AVAIL)
{
- HP_TIMING_PRINT (buf, sizeof (buf), *rtld_total_timep);
+ HP_TIMING_PRINT (buf, sizeof (buf), rtld_total_time);
INTUSE(_dl_debug_printf) ("\nruntime linker statistics:\n"
" total startup time in dynamic loader: %s\n",
buf);
@@ -2148,7 +2148,7 @@
/* Print relocation statistics. */
char pbuf[30];
HP_TIMING_PRINT (buf, sizeof (buf), relocate_time);
- cp = _itoa ((1000ULL * relocate_time) / *rtld_total_timep,
+ cp = _itoa ((1000ULL * relocate_time) / rtld_total_time,
pbuf + sizeof (pbuf), 10, 0);
wp = pbuf;
switch (pbuf + sizeof (pbuf) - cp)
@@ -2198,7 +2198,7 @@
{
char pbuf[30];
HP_TIMING_PRINT (buf, sizeof (buf), load_time);
- cp = _itoa ((1000ULL * load_time) / *rtld_total_timep,
+ cp = _itoa ((1000ULL * load_time) / rtld_total_time,
pbuf + sizeof (pbuf), 10, 0);
wp = pbuf;
switch (pbuf + sizeof (pbuf) - cp)