This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Profile - improve doc & include file
- From: Gary Thomas <gthomas at ecoscentric dot com>
- To: eCos patches <ecos-patches at sources dot redhat dot com>
- Date: 15 Nov 2002 11:36:51 -0700
- Subject: Profile - improve doc & include file
Index: services/profile/gprof/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/services/profile/gprof/current/ChangeLog,v
retrieving revision 1.3
diff -u -5 -p -r1.3 ChangeLog
--- services/profile/gprof/current/ChangeLog 15 Nov 2002 15:03:49 -0000 1.3
+++ services/profile/gprof/current/ChangeLog 15 Nov 2002 18:35:55 -0000
@@ -1,7 +1,12 @@
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.
* src/profile.c:
* include/profile.h: Add proper C++ protections. Change timer
Index: services/profile/gprof/current/doc/profile.sgml
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/services/profile/gprof/current/doc/profile.sgml,v
retrieving revision 1.1
diff -u -5 -p -r1.1 profile.sgml
--- services/profile/gprof/current/doc/profile.sgml 15 Nov 2002 14:32:33 -0000 1.1
+++ services/profile/gprof/current/doc/profile.sgml 15 Nov 2002 18:34:22 -0000
@@ -2,25 +2,39 @@
<TITLE>Application profiling</TITLE>
<PARTINTRO>
<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">
<TITLE>Profiling functions</TITLE>
<SECT1 id="services-profile-api">
Index: services/profile/gprof/current/include/gmon_out.h
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/services/profile/gprof/current/include/gmon_out.h,v
retrieving revision 1.1
diff -u -5 -p -r1.1 gmon_out.h
--- services/profile/gprof/current/include/gmon_out.h 15 Nov 2002 00:27:23 -0000 1.1
+++ services/profile/gprof/current/include/gmon_out.h 15 Nov 2002 18:17:15 -0000
@@ -1,51 +1,26 @@
-// Slightly adapted for eCos environment
+// Slightly adapted from OpenBSD "/src/gnu/usr.bin/binutils/gprof/gmon_out.h"
+// 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.
-
- 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
{
char cookie[4];
char version[4];
@@ -53,30 +28,27 @@ 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" */
char dimen_abbrev; /* usually 's' for "seconds" */
};
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 */
--
------------------------------------------------------------
Gary Thomas |
eCosCentric, Ltd. |
+1 (970) 229-1963 | eCos & RedBoot experts
gthomas@ecoscentric.com |
http://www.ecoscentric.com/ |
------------------------------------------------------------