This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: Do not relaunch tftpd server upon second invocation of profile_on
- From: Andrew Lunn <andrew at lunn dot ch>
- To: ?yvind Harboe <oyvind dot harboe at zylin dot com>
- Cc: eCos Patches <ecos-patches at ecos dot sourceware dot org>
- Date: Mon, 3 Nov 2008 15:25:40 +0100
- Subject: Re: Do not relaunch tftpd server upon second invocation of profile_on
- References: <c09652430810140440p1b13ccf5qe211a4566462c1ab@mail.gmail.com> <20081029204215.GB5431@lunn.ch> <c09652430810300751n7f8bf34avd7aa888225e354fc@mail.gmail.com>
On Thu, Oct 30, 2008 at 03:51:25PM +0100, ?yvind Harboe wrote:
> Fixed comment.
Thanks. I reworded the comment a bit as well.
Andrew
Index: services/profile/gprof/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/services/profile/gprof/current/ChangeLog,v
retrieving revision 1.10
diff -u -r1.10 ChangeLog
--- services/profile/gprof/current/ChangeLog 18 Aug 2008 13:34:29 -0000 1.10
+++ services/profile/gprof/current/ChangeLog 3 Nov 2008 14:24:39 -0000
@@ -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
Index: services/profile/gprof/current/src/profile.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/services/profile/gprof/current/src/profile.c,v
retrieving revision 1.6
diff -u -r1.6 profile.c
--- services/profile/gprof/current/src/profile.c 21 Dec 2007 16:47:15 -0000 1.6
+++ services/profile/gprof/current/src/profile.c 3 Nov 2008 14:24:40 -0000
@@ -577,11 +577,16 @@
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