Perf_Lttng.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. This program is free software: you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation, either version 3 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program. If not, see <http://www.gnu.org/licenses/>.
  12. */
  13. #ifdef HAVE_LTTNG_UST
  14. #define TRACEPOINT_CREATE_PROBES
  15. #define TRACEPOINT_DEFINE
  16. #include <string.h>
  17. #include "AP_HAL_Linux.h"
  18. #include "Perf_Lttng_TracePoints.h"
  19. #include "Perf_Lttng.h"
  20. using namespace Linux;
  21. void Perf_Lttng::begin(const char *name)
  22. {
  23. tracepoint(ardupilot, begin, name);
  24. }
  25. void Perf_Lttng::end(const char *name)
  26. {
  27. tracepoint(ardupilot, end, name);
  28. }
  29. void Perf_Lttng::count(const char *name, uint64_t val)
  30. {
  31. tracepoint(ardupilot, count, name, val);
  32. }
  33. #else
  34. #include "Perf_Lttng.h"
  35. using namespace Linux;
  36. void Perf_Lttng::begin(const char *name) { }
  37. void Perf_Lttng::end(const char *name) { }
  38. void Perf_Lttng::count(const char *name, uint64_t val) { }
  39. #endif