collectorAPI.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* Copyright (C) 2021-2022 Free Software Foundation, Inc.
  2. Contributed by Oracle.
  3. This file is part of GNU Binutils.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3, or (at your option)
  7. any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, 51 Franklin Street - Fifth Floor, Boston,
  15. MA 02110-1301, USA. */
  16. #ifndef _COLLECTORAPI_H
  17. #define _COLLECTORAPI_H
  18. /* This file contains function prototypes for the user-callable API
  19. routines in libcollector. */
  20. #include <pthread.h>
  21. #ifdef __cplusplus
  22. extern "C"
  23. {
  24. #endif
  25. /* Routine to record a sample in the experiment. */
  26. extern void collector_sample (const char *name);
  27. /* Routine to suspend data collection during an experiment. */
  28. extern void collector_pause (void);
  29. /* Routine to resume data collection during an experiment. */
  30. extern void collector_resume (void);
  31. /* Routine to suspend per-thread data collection during an experiment. */
  32. extern void collector_thread_pause (pthread_t tid);
  33. /* Routine to resume per-thread data collection during an experiment. */
  34. extern void collector_thread_resume (pthread_t tid);
  35. /* Routine to close the experiment, and stop all data collection. */
  36. extern void collector_terminate_expt (void);
  37. typedef struct
  38. {
  39. unsigned int offset;
  40. unsigned int lineno;
  41. } Lineno;
  42. /* Routines to let libcollector know about dynamically loaded functions. */
  43. extern void collector_func_load (const char *name, const char *alias,
  44. const char *sourcename, void *vaddr,
  45. int size, int lntsize, Lineno *lntable);
  46. extern void collector_func_unload (void *vaddr);
  47. #ifdef NEED_COLLECTOR_MODULE
  48. extern void collector_module_load (const char *modulename, void *vaddr);
  49. extern void collector_module_unload (void *vaddr);
  50. #endif
  51. #ifdef __cplusplus
  52. }
  53. #endif
  54. #endif /* _COLLECTORAPI_H */