1 #ifndef _BARECTF_TRACEPOINT_H
2 #define _BARECTF_TRACEPOINT_H
5 * The MIT License (MIT)
7 * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 * of this software and associated documentation files (the "Software"), to deal
11 * in the Software without restriction, including without limitation the rights
12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 * copies of the Software, and to permit persons to whom the Software is
14 * furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29 #ifdef BARECTF_TRACEPOINT_PREFIX
30 # define _BARECTF_TRACEPOINT_PREFIX BARECTF_TRACEPOINT_PREFIX
32 # ifdef _BARECTF_PREFIX
33 # define _BARECTF_TRACEPOINT_PREFIX _BARECTF_PREFIX
35 # error You need to define BARECTF_TRACEPOINT_PREFIX in order to use this header.
39 /* get stream name to use */
40 #ifdef BARECTF_TRACEPOINT_STREAM
41 # define _BARECTF_TRACEPOINT_STREAM BARECTF_TRACEPOINT_STREAM
43 # ifdef _BARECTF_DEFAULT_STREAM
44 # define _BARECTF_TRACEPOINT_STREAM _BARECTF_DEFAULT_STREAM
46 # error You need to define BARECTF_TRACEPOINT_STREAM in order to use this header.
50 /* get context to use */
51 #ifndef BARECTF_TRACEPOINT_CTX
52 # error You need to define BARECTF_TRACEPOINT_CTX in order to use this header.
56 * Combines 6 token. Inspired by __TP_COMBINE_TOKENS4() in
57 * <lttng/tracepoint.h>. See sections 6.10.3 and 6.10.3.1 of
60 #define __COMBINE_TOKENS6(_a, _b, _c, _d, _e, _f) \
61 _a ## _b ## _c ## _d ## _e ## _f
62 #define _COMBINE_TOKENS6(_a, _b, _c, _d, _e, _f) \
63 __COMBINE_TOKENS6(_a, _b, _c, _d, _e, _f)
65 /* tracepoint() used by the user */
67 #define tracepoint(_prov_name, _tp_name, ...) \
68 _COMBINE_TOKENS6(_BARECTF_TRACEPOINT_PREFIX, _BARECTF_TRACEPOINT_STREAM, _trace_, _prov_name, _, _tp_name)(BARECTF_TRACEPOINT_CTX, ##__VA_ARGS__)
70 #endif /* _BARECTF_TRACEPOINT_H */
This page took 0.049973 seconds and 4 git commands to generate.