profil.h 1.9 KB

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