gcov.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* GCOV interface routines.
  2. Copyright (C) 2017-2022 Free Software Foundation, Inc.
  3. This file is part of GCC.
  4. GCC is free software; you can redistribute it and/or modify it under
  5. the terms of the GNU General Public License as published by the Free
  6. Software Foundation; either version 3, or (at your option) any later
  7. version.
  8. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  9. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  11. for more details.
  12. Under Section 7 of GPL version 3, you are granted additional
  13. permissions described in the GCC Runtime Library Exception, version
  14. 3.1, as published by the Free Software Foundation.
  15. You should have received a copy of the GNU General Public License and
  16. a copy of the GCC Runtime Library Exception along with this program;
  17. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  18. <http://www.gnu.org/licenses/>. */
  19. #ifndef GCC_GCOV_H
  20. #define GCC_GCOV_H
  21. struct gcov_info;
  22. /* Set all counters to zero. */
  23. extern void __gcov_reset (void);
  24. /* Write profile information to a file. */
  25. extern void __gcov_dump (void);
  26. /* Convert the gcov information referenced by INFO to a gcda data stream.
  27. The FILENAME_FN callback is called exactly once with the filename associated
  28. with the gcov information. The filename may be NULL. Afterwards, the
  29. DUMP_FN callback is subsequently called with chunks (the begin and length of
  30. the chunk are passed as the first two callback parameters) of the gcda data
  31. stream. The ALLOCATE_FN callback shall allocate memory with a size in
  32. characters specified by the first callback parameter. The ARG parameter is
  33. a user-provided argument passed as the last argument to the callback
  34. functions. */
  35. extern void
  36. __gcov_info_to_gcda (const struct gcov_info *__info,
  37. void (*__filename_fn) (const char *, void *),
  38. void (*__dump_fn) (const void *, unsigned, void *),
  39. void *(*__allocate_fn) (unsigned, void *),
  40. void *__arg);
  41. #endif /* GCC_GCOV_H */