APM:Libraries
Perf_Lttng.cpp
Go to the documentation of this file.
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 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program. If not, see <http://www.gnu.org/licenses/>.
14  */
15 #ifdef HAVE_LTTNG_UST
16 
17 #define TRACEPOINT_CREATE_PROBES
18 #define TRACEPOINT_DEFINE
19 
20 #include <string.h>
21 
22 #include "AP_HAL_Linux.h"
23 #include "Perf_Lttng_TracePoints.h"
24 #include "Perf_Lttng.h"
25 
26 using namespace Linux;
27 
28 void Perf_Lttng::begin(const char *name)
29 {
30  tracepoint(ardupilot, begin, name);
31 }
32 
33 void Perf_Lttng::end(const char *name)
34 {
35  tracepoint(ardupilot, end, name);
36 }
37 
38 void Perf_Lttng::count(const char *name, uint64_t val)
39 {
40  tracepoint(ardupilot, count, name, val);
41 }
42 
43 #else
44 
45 #include "Perf_Lttng.h"
46 
47 using namespace Linux;
48 
49 void Perf_Lttng::begin(const char *name) { }
50 void Perf_Lttng::end(const char *name) { }
51 void Perf_Lttng::count(const char *name, uint64_t val) { }
52 
53 #endif
const char * name
Definition: BusTest.cpp:11
void end(const char *name)
Definition: Perf_Lttng.cpp:50
void begin(const char *name)
Definition: Perf_Lttng.cpp:49
void count(const char *name, uint64_t val)
Definition: Perf_Lttng.cpp:51