/usr/include/eztrace_sampling.h is in libeztrace-dev 1.0.6-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | #ifndef EZTRACE_SAMPLING_H
#define EZTRACE_SAMPLING_H
#include <sys/time.h>
struct ezt_sampling_callback_instance;
/* The callback shall return 0 if successfull.
* If successfull, eztrace core will wait interval microseconds before invoking
* the callback again.
* If unsuccessfull, eztrace core may invoke the callback at any time
*/
typedef int (*ezt_sampling_callback_t)(struct ezt_sampling_callback_instance*instance);
/* This structure is passed to sampling callbacks. The callback should not modify any field apart
* from plugin_data.
*/
struct ezt_sampling_callback_instance {
ezt_sampling_callback_t callback;
unsigned interval;
struct timeval last_call;
void* plugin_data;
};
/* Register a sampling callback
* \param callback: the sampling callback
* \param interval: time in microsecond between each call to callback
*
* NB: the interval is thread-specific. Interval corresponds to the minimum
* time difference between two calls (within one thread). Please note that
* we use a lazy system: the callback is only called if eztrace intercepts a function.
* Thus, if the application performs a long computing phase, the callback may not be
* called very often.
*/
void ezt_sampling_register_callback(ezt_sampling_callback_t callback,
unsigned interval);
void ezt_sampling_check_callbacks();
#endif /* EZTRACE_SAMPLING_H */
|