Back to index

glibc  2.9
profil.h
Go to the documentation of this file.
00001 /* Copyright (C) 2001 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 #ifndef _PROFIL_H
00020 #define _PROFIL_H    1
00021 
00022 #include <features.h>
00023 
00024 #include <sys/time.h>
00025 #include <sys/types.h>
00026 
00027 /* This interface is intended to follow the sprofil() system calls as
00028    described by the sprofil(2) man page of Irix v6.5, except that:
00029 
00030        - there is no a priori limit on number of text sections
00031        - pr_scale is declared as unsigned long (instead of "unsigned int")
00032        - pr_size is declared as size_t (instead of "unsigned int")
00033        - pr_off is declared as void * (instead of "__psunsigned_t")
00034        - the overflow bin (pr_base==0, pr_scale==2) can appear anywhere
00035          in the profp array
00036        - PROF_FAST has no effect  */
00037 
00038 struct prof
00039   {
00040     void *pr_base;          /* buffer base */
00041     size_t pr_size;         /* buffer size */
00042     size_t pr_off;          /* pc offset */
00043     unsigned long int pr_scale;    /* pc scaling (fixed-point number) */
00044   };
00045 
00046 enum
00047   {
00048     PROF_USHORT      = 0,          /* use 16-bit counters (default) */
00049     PROF_UINT = 1 << 0,     /* use 32-bit counters */
00050     PROF_FAST   = 1 << 1    /* profile faster than usual */
00051   };
00052 
00053 
00054 __BEGIN_DECLS
00055 
00056 extern int sprofil (struct prof *__profp, int __profcnt,
00057                   struct timeval *__tvp, unsigned int __flags) __THROW;
00058 
00059 __END_DECLS
00060 
00061 #endif /* profil.h */