# HG changeset patch # User asl # Date 1225722300 0 # Node ID 23e894d966a87e97e270bad94fbbf794d69a2842 # Parent 96280a58fefb43d47031091820c3987646012b67 * src/profile.c: do not relaunch tftpd thread upon second invocation of profile_on diff --git a/packages/services/profile/gprof/current/ChangeLog b/packages/services/profile/gprof/current/ChangeLog --- a/packages/services/profile/gprof/current/ChangeLog +++ b/packages/services/profile/gprof/current/ChangeLog @@ -1,3 +1,8 @@ +2007-10-14 Oyvind Harboe + + * src/profile.c: do not relaunch tftpd thread upon second invocation + of profile_on + 2008-08-18 Bart Veer * host/Makefile.am: update host-side configury diff --git a/packages/services/profile/gprof/current/src/profile.c b/packages/services/profile/gprof/current/src/profile.c --- 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