master
 1/* Copyright (C) 2001-2025 Free Software Foundation, Inc.
 2   This file is part of the GNU C Library.
 3
 4   The GNU C Library is free software; you can redistribute it and/or
 5   modify it under the terms of the GNU Lesser General Public
 6   License as published by the Free Software Foundation; either
 7   version 2.1 of the License, or (at your option) any later version.
 8
 9   The GNU C Library is distributed in the hope that it will be useful,
10   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12   Lesser General Public License for more details.
13
14   You should have received a copy of the GNU Lesser General Public
15   License along with the GNU C Library; if not, see
16   <https://www.gnu.org/licenses/>.  */
17
18#ifndef _PROFIL_H
19#define _PROFIL_H	1
20
21#include <features.h>
22
23#include <sys/time.h>
24#include <sys/types.h>
25
26/* This interface is intended to follow the sprofil() system calls as
27   described by the sprofil(2) man page of Irix v6.5, except that:
28
29	- there is no a priori limit on number of text sections
30	- pr_scale is declared as unsigned long (instead of "unsigned int")
31	- pr_size is declared as size_t (instead of "unsigned int")
32	- pr_off is declared as void * (instead of "__psunsigned_t")
33	- the overflow bin (pr_base==0, pr_scale==2) can appear anywhere
34	  in the profp array
35	- PROF_FAST has no effect  */
36
37struct prof
38  {
39    void *pr_base;		/* buffer base */
40    size_t pr_size;		/* buffer size */
41    size_t pr_off;		/* pc offset */
42    unsigned long int pr_scale;	/* pc scaling (fixed-point number) */
43  };
44
45enum
46  {
47    PROF_USHORT	= 0,		/* use 16-bit counters (default) */
48    PROF_UINT	= 1 << 0,	/* use 32-bit counters */
49    PROF_FAST   = 1 << 1	/* profile faster than usual */
50  };
51
52
53__BEGIN_DECLS
54
55extern int sprofil (struct prof *__profp, int __profcnt,
56		    struct timeval *__tvp, unsigned int __flags) __THROW;
57
58__END_DECLS
59
60#endif /* profil.h */