11 #ifndef __TRACETOOLS_TRACETOOLS_H_ 12 #define __TRACETOOLS_TRACETOOLS_H_ 14 #include <boost/shared_ptr.hpp> 15 #include <boost/function.hpp> 16 #include <boost/version.hpp> 26 const void*
get_ptr(
const boost::function<
void (P)>& func_ptr) {
27 #if BOOST_VERSION < 106200 28 return reinterpret_cast<void*
>(func_ptr.functor.func_ptr);
30 return reinterpret_cast<void*
>(func_ptr.functor.members.func_ptr);
40 void task_init(
const char *task_name,
const char *owner = NULL);
43 void node_init(
const char *node_name,
unsigned int roscpp_version);
45 void timer_added(
const void *fun_ptr,
const char *type_info,
int period_sec,
86 const uint32_t receipt_time_sec,
87 const uint32_t receipt_time_nsec);
107 void call_start(
const void *ptr_ref,
const void *data,
const uint64_t trace_id);
113 void call_end(
const void *ptr_ref,
const void *data,
const uint64_t trace_id);
115 void queue_delay(
const char *queue_name,
const void *ptr_ref,
const void *data,
116 const uint32_t entry_time_sec,
const uint32_t entry_time_nsec);
139 const void *callback_ref,
const void *message_ref,
140 int receipt_time_sec,
int receipt_time_nsec);
146 const void *callback_ref,
const void *message_ref,
147 int receipt_time_sec,
int receipt_time_nsec);
157 void time_sleep(
const void *callback_ref,
int sleep_sec,
int sleep_nsec);
163 const char *remote_hostport_arg,
164 const void *channel_ref_arg,
const char *channel_type_arg,
165 const char *name_arg,
const char *data_type_arg);
168 const void *buffer_ref_arg);
171 const void *callback_ref_arg,
172 const char *type_info_arg,
173 const char *data_type_arg,
174 const char *source_name_arg,
int queue_size_arg);
178 const void *buffer_ref_arg);
180 const void *buffer_ref_arg);
183 const void *channel_ref_arg);
188 const void *buffer_ref_arg,
189 const void *queue_ref_arg,
190 const void *callback_ref_arg,
191 const void *message_ref_arg,
192 int receipt_time_sec_arg,
193 int receipt_time_nsec_arg);
195 const void *queue_ref_arg,
196 const void *callback_ref_arg,
197 const void *message_ref_arg,
198 int receipt_time_sec,
int receipt_time_nsec);
214 void link_step(
const char *element_name,
const void *caller_name,
215 const void *in_data_ref,
const void *out_data_ref,
216 const uint64_t trace_id);
221 template <
typename T>
229 template <
typename T>
void subscriber_call_end(const std::string &topic, const void *queue_ref, const void *callback_ref, const void *message_ref, int receipt_time_sec, int receipt_time_nsec)
Marks the end of the call, same arguments as above.
void callback_wrapper(const void *func_ptr, const boost::shared_ptr< T > &helper)
Legacy compatibility function for above which takes a wrapper function directly.
std::string getCallbackInfo(const void *func_ptr, const char *name)
try to get a name for the function inside the CallbackInterfacePtr
void subscriber_callback_added(const void *queue_ref_arg, const void *callback_ref_arg, const char *type_info_arg, const char *data_type_arg, const char *source_name_arg, int queue_size_arg)
Trace metadata on a new subscription callback.
std::string get_backtrace(int index=-1)
void timer_added(const void *fun_ptr, const char *type_info, int period_sec, int period_nsec)
void node_init(const char *node_name, unsigned int roscpp_version)
also set's procname, but be aware that's limited to 16 chars
void fn_name_info(const void *fun_ptr, const void *ref)
Emit tracing information linking the function ptr's name to the given reference pointer.
std::string get_symbol(void *funptr)
void publisher_link_handle_message(const void *channel_ref_arg, const void *buffer_ref_arg)
Trace metadata on creation of a publisher link (incoming topic connection)
void publisher_message_queued(const char *topic_arg, const void *buffer_ref_arg)
Trace a message being queue for publishing.
void new_connection(const char *local_hostport_arg, const char *remote_hostport_arg, const void *channel_ref_arg, const char *channel_type_arg, const char *name_arg, const char *data_type_arg)
Trace metadata on creation of a new connection.
void subscriber_link_message_dropped(const void *message_ref_arg)
Trac on an incoming message being dropped (queue full, etc.)
void call_end(const void *ptr_ref, const void *data, const uint64_t trace_id)
Trace the end of a user-callback invocation.
void time_sleep(const void *callback_ref, int sleep_sec, int sleep_nsec)
void task_init(const char *task_name, const char *owner=NULL)
emit a tracepoint specifying a name for this thread.
void subscription_message_queued(const char *topic_arg, const void *buffer_ref_arg, const void *queue_ref_arg, const void *callback_ref_arg, const void *message_ref_arg, int receipt_time_sec_arg, int receipt_time_nsec_arg)
Trace on a message having been received and queued.
const void * get_ptr(const boost::function< void(P)> &func_ptr)
bool compile_status()
report whether tracing is compiled in
void queue_delay(const char *queue_name, const void *ptr_ref, const void *data, const uint32_t entry_time_sec, const uint32_t entry_time_nsec)
Trace queue delay experienced by the given function pointer.
void message_processed(const char *message_name, const void *callback_ref, const uint32_t receipt_time_sec, const uint32_t receipt_time_nsec)
Mark the processing of a given "message".
void subscription_message_dropped(const char *topic_arg, const void *buffer_arg, const void *queue_ref_arg, const void *callback_ref_arg, const void *message_ref_arg, int receipt_time_sec, int receipt_time_nsec)
const void * getCallbackFunction(const boost::shared_ptr< T > &cb)
get the function being pointed to by the CallbackInterfacePtr
void subscriber_call_start(const std::string &topic, const void *queue_ref, const void *callback_ref, const void *message_ref, int receipt_time_sec, int receipt_time_nsec)
Trace the invocation of a previously queued subscriber call.
void call_start(const void *ptr_ref, const void *data, const uint64_t trace_id)
Trace the start of a function call through a function pointer.
void timer_scheduled(const void *callback_ref, const void *timer_ref)
Emit tracing information that the timer identified by 'timer_ref' has been scheduled for invocation o...
void subscriber_link_message_write(const void *message_ref_arg, const void *channel_ref_arg)
Trace on a message being written to the socket.
void link_step(const char *element_name, const void *caller_name, const void *in_data_ref, const void *out_data_ref, const uint64_t trace_id)
Emit a trace message for a link in a processing chain.