1*e663ba6eSchristos /* Copyright (C) 2021-2024 Free Software Foundation, Inc. 24b169a6bSchristos Contributed by Oracle. 34b169a6bSchristos 44b169a6bSchristos This file is part of GNU Binutils. 54b169a6bSchristos 64b169a6bSchristos This program is free software; you can redistribute it and/or modify 74b169a6bSchristos it under the terms of the GNU General Public License as published by 84b169a6bSchristos the Free Software Foundation; either version 3, or (at your option) 94b169a6bSchristos any later version. 104b169a6bSchristos 114b169a6bSchristos This program is distributed in the hope that it will be useful, 124b169a6bSchristos but WITHOUT ANY WARRANTY; without even the implied warranty of 134b169a6bSchristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 144b169a6bSchristos GNU General Public License for more details. 154b169a6bSchristos 164b169a6bSchristos You should have received a copy of the GNU General Public License 174b169a6bSchristos along with this program; if not, write to the Free Software 184b169a6bSchristos Foundation, 51 Franklin Street - Fifth Floor, Boston, 194b169a6bSchristos MA 02110-1301, USA. */ 204b169a6bSchristos 214b169a6bSchristos #ifndef _COLLECTORAPI_H 224b169a6bSchristos #define _COLLECTORAPI_H 234b169a6bSchristos 244b169a6bSchristos /* This file contains function prototypes for the user-callable API 254b169a6bSchristos routines in libcollector. */ 264b169a6bSchristos 274b169a6bSchristos #include <pthread.h> 284b169a6bSchristos 294b169a6bSchristos #ifdef __cplusplus 304b169a6bSchristos extern "C" 314b169a6bSchristos { 324b169a6bSchristos #endif 334b169a6bSchristos /* Routine to record a sample in the experiment. */ 344b169a6bSchristos extern void collector_sample (const char *name); 354b169a6bSchristos 364b169a6bSchristos /* Routine to suspend data collection during an experiment. */ 374b169a6bSchristos extern void collector_pause (void); 384b169a6bSchristos 394b169a6bSchristos /* Routine to resume data collection during an experiment. */ 404b169a6bSchristos extern void collector_resume (void); 414b169a6bSchristos 424b169a6bSchristos /* Routine to suspend per-thread data collection during an experiment. */ 434b169a6bSchristos extern void collector_thread_pause (pthread_t tid); 444b169a6bSchristos 454b169a6bSchristos /* Routine to resume per-thread data collection during an experiment. */ 464b169a6bSchristos extern void collector_thread_resume (pthread_t tid); 474b169a6bSchristos 484b169a6bSchristos /* Routine to close the experiment, and stop all data collection. */ 494b169a6bSchristos extern void collector_terminate_expt (void); 504b169a6bSchristos 514b169a6bSchristos typedef struct 524b169a6bSchristos { 534b169a6bSchristos unsigned int offset; 544b169a6bSchristos unsigned int lineno; 554b169a6bSchristos } Lineno; 564b169a6bSchristos 574b169a6bSchristos /* Routines to let libcollector know about dynamically loaded functions. */ 584b169a6bSchristos extern void collector_func_load (const char *name, const char *alias, 594b169a6bSchristos const char *sourcename, void *vaddr, 604b169a6bSchristos int size, int lntsize, Lineno *lntable); 614b169a6bSchristos 624b169a6bSchristos extern void collector_func_unload (void *vaddr); 634b169a6bSchristos 644b169a6bSchristos #ifdef NEED_COLLECTOR_MODULE 654b169a6bSchristos extern void collector_module_load (const char *modulename, void *vaddr); 664b169a6bSchristos extern void collector_module_unload (void *vaddr); 674b169a6bSchristos #endif 684b169a6bSchristos 694b169a6bSchristos #ifdef __cplusplus 704b169a6bSchristos } 714b169a6bSchristos #endif 724b169a6bSchristos 734b169a6bSchristos #endif /* _COLLECTORAPI_H */ 74