changeset 2579:23e894d966a8

* src/profile.c: do not relaunch tftpd thread upon second invocation of profile_on
author asl
date Mon, 03 Nov 2008 14:25:00 +0000
parents 96280a58fefb
children 07fc475e1c28
files packages/services/profile/gprof/current/ChangeLog packages/services/profile/gprof/current/src/profile.c
diffstat 2 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/packages/services/profile/gprof/current/ChangeLog
+++ b/packages/services/profile/gprof/current/ChangeLog
@@ -1,3 +1,8 @@
+2007-10-14  Oyvind Harboe  <oyvind.harboe@zylin.com>
+
+	* src/profile.c: do not relaunch tftpd thread upon second invocation
+	of profile_on
+
 2008-08-18  Bart Veer  <bartv@ecoscentric.com>
 
 	* host/Makefile.am: update host-side configury
--- a/packages/services/profile/gprof/current/src/profile.c
+++ b/packages/services/profile/gprof/current/src/profile.c
@@ -577,11 +577,16 @@ profile_on(void *_start, void *_end, int
 
     profile_enabled = 1;
 
-#ifdef CYGPKG_PROFILE_TFTP    
-    // Create a TFTP server to provide the data
-    // invoking this a second time is harmless
-    (void) tftpd_start(CYGNUM_PROFILE_TFTP_PORT, &profile_tftp_fileops);
-#endif    
+#ifdef CYGPKG_PROFILE_TFTP
+    static int profile_tftp_is_started        = 0;
+    if (!profile_tftp_is_started)
+    {
+    	profile_tftp_is_started = 1;
+        // Create a TFTP server the first time we start profiling to
+        // provide access to the data via the network.
+        (void) tftpd_start(CYGNUM_PROFILE_TFTP_PORT, &profile_tftp_fileops);
+    }
+#endif
 }
 
 // EOF profile.c