# HG changeset patch # User gthomas # Date 1037385386 0 # Node ID 7a421b1fb2e44d2826e1cd188d3b052a94f988a6 # Parent 63d0c56d82e847184025153f5b2e377291c9d120 Improve documentation. Replace gmon_out.h with non-GPL version. 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,5 +1,10 @@ 2002-11-15 Gary Thomas + * 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. diff --git a/packages/services/profile/gprof/current/doc/profile.sgml b/packages/services/profile/gprof/current/doc/profile.sgml --- a/packages/services/profile/gprof/current/doc/profile.sgml +++ b/packages/services/profile/gprof/current/doc/profile.sgml @@ -4,21 +4,35 @@ 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 -gprof -utility program. +an execution histogram. -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 -TFTP. When profiling is started on the target device, a -TFTP +TFTP server will be started which exports the single file PROFILE.DAT +This analysis data can then be fetched +by connecting to the target with a TFTP +client program +and then be processed by the +gprof +utility program. +NOTE + +Be sure and specify binary mode transfers for this data file, +which may not be the default with on some TFTP +client programs. + + +NOTE + +The port used for this TFTP 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 +CYGNUM_PROFILE_TFTP_PORT CDL option. + + diff --git a/packages/services/profile/gprof/current/include/gmon_out.h b/packages/services/profile/gprof/current/include/gmon_out.h --- 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 . - - 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 +/* + * 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 */