2 * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
3 * Copyright (C) 2011-2012 Matthew Khouzam <matthew.khouzam@ericsson.com>
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * Sample lttng-ust tracepoint provider.
30 * We undef a macro before defining it as it can be used in several files.
34 * Must be included before include tracepoint provider
36 * ex.: project_component_event
38 * Optional company name goes here
39 * ex.: com_efficios_project_component_event
41 * In this example, "sample" is the project, and "component" is the
44 #undef TRACEPOINT_PROVIDER
45 #define TRACEPOINT_PROVIDER sample_component
48 * include file (this files's name)
50 #undef TRACEPOINT_INCLUDE
51 #define TRACEPOINT_INCLUDE "./sample_component_provider.h"
54 * Add this precompiler conditionals to ensure the tracepoint event generation
55 * can include this file more than once.
57 #if !defined(_SAMPLE_COMPONENT_PROVIDER_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
58 #define _SAMPLE_COMPONENT_PROVIDER_H
60 * Add this to allow programs to call "tracepoint(...):
62 #include <lttng/tracepoint.h>
65 * The following tracepoint event writes a message (c string) into the
66 * field message of the trace event message in the provider
67 * sample_component in other words:
69 * sample_component:message:message = text.
73 * provider name, not a variable but a string starting with a letter
74 * and containing either letters, numbers or underscores.
75 * Needs to be the same as TRACEPOINT_PROVIDER
79 * tracepoint name, same format as sample provider. Does not need to be
80 * declared before. in this case the name is "message"
84 * TP_ARGS macro contains the arguments passed for the tracepoint
85 * it is in the following format
86 * TP_ARGS( type1, name1, type2, name2, ... type10, name10)
87 * where there can be from zero to ten elements.
88 * typeN is the datatype, such as int, struct or double **.
89 * name is the variable name (in "int myInt" the name would be myint)
90 * TP_ARGS() is valid to mean no arguments
91 * TP_ARGS( void ) is valid too
93 TP_ARGS(char *, text
),
95 * TP_FIELDS describes how to write the fields of the trace event.
96 * You can use the args here
100 * The ctf_string macro takes a c string and writes it into a field
103 ctf_string(message
, text
)
107 * Trace loglevel, shows the level of the trace event. It can be TRACE_EMERG,
108 * TRACE_ALERT, TRACE_CRIT, TRACE_ERR, TRACE_WARNING, TRACE_INFO or others.
109 * If this is not set, TRACE_DEFAULT is assumed.
110 * The first two arguments identify the tracepoint
111 * See details in <lttng/tracepoint.h> line 347
115 * The provider name, must be the same as the provider name in the
116 * TRACEPOINT_EVENT and as TRACEPOINT_PROVIDER above.
120 * The tracepoint name, must be the same as the tracepoint name in the
125 * The tracepoint loglevel. Warning, some levels are abbreviated and
126 * others are not, please see <lttng/tracepoint.h>
130 #endif /* _SAMPLE_COMPONENT_PROVIDER_H */
133 * Add this after defining the tracepoint events to expand the macros.
135 #include <lttng/tracepoint-event.h>
This page took 0.032365 seconds and 4 git commands to generate.