Add basic tracing lib files
This commit is contained in:
parent
7c51d23850
commit
5583fa68d1
4 changed files with 67 additions and 0 deletions
3
tracetools/src/.gitignore
vendored
Normal file
3
tracetools/src/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
# generated files (LTTng)
|
||||
tp_call.c
|
||||
tp_call.h
|
14
tracetools/src/status.c
Normal file
14
tracetools/src/status.c
Normal file
|
@ -0,0 +1,14 @@
|
|||
#include <stdio.h>
|
||||
#include "tracetools/tracetools.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("Tracing ");
|
||||
if (ros_trace_compile_status()) {
|
||||
printf("enabled\n");
|
||||
return 0;
|
||||
} else {
|
||||
printf("disabled\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
20
tracetools/src/tracetools.c
Normal file
20
tracetools/src/tracetools.c
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include "tracetools/tracetools.h"
|
||||
|
||||
#ifdef WITH_LTTNG
|
||||
#include "tp_call.h"
|
||||
#endif
|
||||
|
||||
|
||||
bool ros_trace_compile_status() {
|
||||
#ifdef WITH_LTTNG
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void ros_trace_rcl_init() {
|
||||
#ifdef WITH_LTTNG
|
||||
tracepoint(ros2, rcl_init);
|
||||
#endif
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue