changeset 430:7a421b1fb2e4

Improve documentation. Replace gmon_out.h with non-GPL version.
author gthomas
date Fri, 15 Nov 2002 18:36:26 +0000
parents 63d0c56d82e8
children 010c4eef5042
files packages/services/profile/gprof/current/ChangeLog packages/services/profile/gprof/current/doc/profile.sgml packages/services/profile/gprof/current/include/gmon_out.h
diffstat 3 files changed, 51 insertions(+), 60 deletions(-) [+]
line wrap: on
line diff
--- a/packages/services/profile/gprof/current/ChangeLog
+++ b/packages/services/profile/gprof/current/ChangeLog
@@ -1,5 +1,10 @@
 2002-11-15  Gary Thomas  <gthomas@ecoscentric.com>
 
+	* include/gmon_out.h: Import non-GPL version from OpenBSD.
+
+	* doc/profile.sgml: Improve description of host/client and
+	target/server roles.
+
 	* src/profile.c: 
 	* cdl/profile_gprof.cdl: Allow TFTP port number to be configured.
 
--- a/packages/services/profile/gprof/current/doc/profile.sgml
+++ b/packages/services/profile/gprof/current/doc/profile.sgml
@@ -4,21 +4,35 @@
 <PARA>
 The profile_gprof package provides a mechanism to measure the
 runtime performance of an application.  This is done by gathering
-an execution histogram, which can then be uploaded to a host
-and analyzed using the 
-<function>gprof</function>
-utility program.
+an execution histogram.
 </PARA>
 <para>
-Since the collected histogram data is volatile, some mechanism 
-must be used to export the data from the target.  
-Currently, this process is done using
-<emphasis>TFTP</emphasis>.
 When profiling is started on the target device, a 
-<emphasis>TFTP</emphasis>
+<function>TFTP</function> 
 server will be started
 which exports the single file
 <filename>PROFILE.DAT</filename>
+This analysis data can then be fetched
+by connecting to the target with a <function>TFTP</function> 
+client program
+and then be processed by the 
+<function>gprof</function>
+utility program.
+<note><title>NOTE</title>
+<para>
+Be sure and specify binary mode transfers for this data file,
+which may not be the default with on some <function>TFTP</function>
+client programs.
+</para>
+</note>
+<note><title>NOTE</title>
+<para>
+The port used for this <function>TFTP</function> server is
+configurable.  The default will be the IETF standard port
+of 69/UDP, but it may be changed to any UDP port via the
+<literal>CYGNUM_PROFILE_TFTP_PORT</literal> CDL option.
+</para>
+</note>
 </para>
 </PARTINTRO>
 <CHAPTER id="profile-functions">
--- a/packages/services/profile/gprof/current/include/gmon_out.h
+++ b/packages/services/profile/gprof/current/include/gmon_out.h
@@ -1,49 +1,24 @@
-// Slightly adapted for eCos environment
-
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by David Mosberger <davidm@cs.arizona.edu>.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+// Slightly adapted from OpenBSD "/src/gnu/usr.bin/binutils/gprof/gmon_out.h"
+// for eCos environment
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-/* This file specifies the format of gmon.out files.  It should have
-   as few external dependencies as possible as it is going to be included
-   in many different programs.  That is, minimize the number of #include's.
-
-   A gmon.out file consists of a header (defined by gmon_hdr) followed by
-   a sequence of records.  Each record starts with a one-byte tag
-   identifying the type of records, followed by records specific data. */
-
-#ifndef _SYS_GMON_OUT_H
-#define _SYS_GMON_OUT_H	1
-
-//#include <features.h>
+/*
+ * This file specifies the format of gmon.out files.  It should have
+ * as few external dependencies as possible as it is going to be
+ * included in many different programs.  That is, minimize the
+ * number of #include's.
+ *
+ * A gmon.out file consists of a header (defined by gmon_hdr) followed
+ * by a sequence of records.  Each record starts with a one-byte tag
+ * identifying the type of records, followed by records specific data.
+ */
+#ifndef gmon_out_h
+#define gmon_out_h
 
 #define	GMON_MAGIC	"gmon"	/* magic cookie */
 #define GMON_VERSION	1	/* version number */
 
-/* For profiling shared object we need a new format.  */
-#define GMON_SHOBJ_VERSION	0x1ffff
-
-//__BEGIN_DECLS
-
 /*
- * Raw header as it appears on file (without padding).  This header
- * always comes first in gmon.out and is then followed by a series
- * records defined below.
+ * Raw header as it appears on file (without padding):
  */
 struct gmon_hdr
   {
@@ -55,15 +30,14 @@ struct gmon_hdr
 /* types of records in this file: */
 typedef enum
   {
-    GMON_TAG_TIME_HIST = 0,
-    GMON_TAG_CG_ARC = 1,
-    GMON_TAG_BB_COUNT = 2
-  } GMON_Record_Tag;
+    GMON_TAG_TIME_HIST = 0, GMON_TAG_CG_ARC = 1, GMON_TAG_BB_COUNT = 2
+  }
+GMON_Record_Tag;
 
 struct gmon_hist_hdr
   {
-    char low_pc[sizeof (char *)];	/* base pc address of sample buffer */
-    char high_pc[sizeof (char *)];	/* max pc address of sampled buffer */
+    char low_pc[sizeof (char*)];	/* base pc address of sample buffer */
+    char high_pc[sizeof (char*)];	/* max pc address of sampled buffer */
     char hist_size[4];			/* size of sample buffer */
     char prof_rate[4];			/* profiling clock rate */
     char dimen[15];			/* phys. dim., usually "seconds" */
@@ -72,11 +46,9 @@ struct gmon_hist_hdr
 
 struct gmon_cg_arc_record
   {
-    char from_pc[sizeof (char *)];	/* address within caller's body */
-    char self_pc[sizeof (char *)];	/* address within callee's body */
+    char from_pc[sizeof (char*)];	/* address within caller's body */
+    char self_pc[sizeof (char*)];	/* address within callee's body */
     char count[4];			/* number of arc traversals */
   };
 
-//__END_DECLS
-
-#endif /* sys/gmon_out.h */
+#endif /* gmon_out_h */