]> sourceware.org Git - glibc.git/commitdiff
hurd: fix profiling short-living processes
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 18 Apr 2016 22:54:24 +0000 (00:54 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 18 Apr 2016 22:54:24 +0000 (00:54 +0200)
* sysdeps/mach/hurd/profil.c (update_waiter): Initialize
profil_reply_port.
(profile_waiter): Do not initialize profil_reply_port.

ChangeLog
sysdeps/mach/hurd/profil.c

index 200cfcb4fc41ec78c4e97a8b18488ecb8892852d..04f5693376b7ed51eabf5636cd30166a6ed6538c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-04-19  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+       * sysdeps/mach/hurd/profil.c (update_waiter): Initialize
+       profil_reply_port.
+       (profile_waiter): Do not initialize profil_reply_port.
+
 2016-04-18  Wilco Dijkstra  <wdijkstr@arm.com>
 
        [BZ #18712]
index dd77cd3d53483a4cde239bf872bb6da8eae06c0c..be249bbbe39dc8a29a765725eb58fc7aad3d68fd 100644 (file)
@@ -40,7 +40,7 @@ static mach_msg_timeout_t collector_timeout; /* ms between collections.  */
 static int profile_tick;
 
 /* Reply port used by profiler thread */
-static mach_port_t profil_reply_port;
+static mach_port_t profil_reply_port = MACH_PORT_NULL;
 
 /* Forwards */
 static kern_return_t profil_task_get_sampled_pcs (mach_port_t,
@@ -63,6 +63,8 @@ update_waiter (u_short *sample_buffer, size_t size, size_t offset, u_int scale)
 
   if (profile_thread == MACH_PORT_NULL)
     {
+      if (profil_reply_port == MACH_PORT_NULL)
+       profil_reply_port = __mach_reply_port ();
       /* Set up the profiling collector thread.  */
       err = __thread_create (__mach_task_self (), &profile_thread);
       if (! err)
@@ -182,7 +184,6 @@ profile_waiter (void)
   mach_msg_header_t msg;
   mach_port_t timeout_reply_port;
 
-  profil_reply_port = __mach_reply_port ();
   timeout_reply_port = __mach_reply_port ();
 
   while (1)
This page took 0.152662 seconds and 5 git commands to generate.