about summary refs log tree commit diff
path: root/elf/dl-profile.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-11-07 06:32:27 +0000
committerUlrich Drepper <drepper@redhat.com>2001-11-07 06:32:27 +0000
commit7982ecfe469a67ce5b249da9d6b24a8d6103fc6f (patch)
tree51d1f20c44a778f1b029c758fb8dd805f0865182 /elf/dl-profile.c
parent39b3385dde64babd316ffd97dd79f9236e487ccb (diff)
downloadglibc-7982ecfe469a67ce5b249da9d6b24a8d6103fc6f.tar.gz
glibc-7982ecfe469a67ce5b249da9d6b24a8d6103fc6f.tar.xz
glibc-7982ecfe469a67ce5b249da9d6b24a8d6103fc6f.zip
Update.
	* elf/dl-profile.c: Replace state variable with simple flag named
	running.  Remove commented-out code.

	* elf/dl-reloc.c (_dl_relocate_object): Likewise.
Diffstat (limited to 'elf/dl-profile.c')
-rw-r--r--elf/dl-profile.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/elf/dl-profile.c b/elf/dl-profile.c
index 3165517914..9f16a9359e 100644
--- a/elf/dl-profile.c
+++ b/elf/dl-profile.c
@@ -134,6 +134,9 @@ struct here_cg_arc_record
 
 static struct here_cg_arc_record *data;
 
+/* Nonzero if profiling is under way.  */
+static int running;
+
 /* This is the number of entry which have been incorporated in the toset.  */
 static uint32_t narcs;
 /* This is a pointer to the object representing the number of entries
@@ -142,9 +145,6 @@ static uint32_t narcs;
    lists.  */
 static volatile uint32_t *narcsp;
 
-/* Description of the currently profiled object.  */
-static long int state = GMON_PROF_OFF;
-
 static volatile uint16_t *kcount;
 static size_t kcountsize;
 
@@ -208,7 +208,7 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
 
   /* Now we can compute the size of the profiling data.  This is done
      with the same formulars as in `monstartup' (see gmon.c).  */
-  state = GMON_PROF_OFF;
+  running = 0;
   lowpc = ROUNDDOWN (mapstart + map->l_addr,
 		     HISTFRACTION * sizeof (HISTCOUNTER));
   highpc = ROUNDUP (mapend + map->l_addr,
@@ -424,7 +424,7 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
   __profil ((void *) kcount, kcountsize, lowpc, s_scale);
 
   /* Turn on profiling.  */
-  state = GMON_PROF_ON;
+  running = 1;
 }
 
 
@@ -435,14 +435,8 @@ _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc)
   size_t i, fromindex;
   struct here_fromstruct *fromp;
 
-#if 0
-  /* XXX I think this is now not necessary anymore.  */
-  if (! compare_and_swap (&state, GMON_PROF_ON, GMON_PROF_BUSY))
-    return;
-#else
-  if (state != GMON_PROF_ON)
+  if (! running)
     return;
-#endif
 
   /* Compute relative addresses.  The shared object can be loaded at
      any address.  The value of frompc could be anything.  We cannot
@@ -538,10 +532,5 @@ _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc)
   atomic_add (&fromp->here->count, 1);
 
  done:
-#if 0
-  /* XXX See above,  Shouldn't be necessary anymore.  */
-  state = GMON_PROF_ON;
-#else
   ;
-#endif
 }