2 * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
3 * Copyright (C) 2011-2012 Matthew Khouzam <matthew.khouzam@ericsson.com>
5 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
6 * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
8 * Permission is hereby granted to use or copy this program for any
9 * purpose, provided the above notices are retained on all copies.
10 * Permission to modify the code and to distribute modified code is
11 * granted, provided the above notices are retained, and a notice that
12 * the code was modified is included with the above copyright notice.
16 * Sample lttng-ust tracepoint provider.
21 * We undef a macro before defining it as it can be used in several files.
25 * Must be included before include tracepoint provider
27 * ex.: project_component_event
29 * Optional company name goes here
30 * ex.: com_efficios_project_component_event
32 * In this example, "sample" is the project, and "component" is the
35 #undef TRACEPOINT_PROVIDER
36 #define TRACEPOINT_PROVIDER sample_component
39 * include file (this files's name)
41 #undef TRACEPOINT_INCLUDE_FILE
42 #define TRACEPOINT_INCLUDE_FILE ./sample_component_provider.h
45 * Add this macro and its matching element to make sure the program
50 #endif /*__cplusplus */
53 * Add this precompiler conditionals to ensure the tracepoint event generation
54 * can include this file more than once.
56 #if !defined(_SAMPLE_COMPONENT_PROVIDER_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
57 #define _SAMPLE_COMPONENT_PROVIDER_H
59 * Add this to allow programs to call "tracepoint(...):
61 #include <lttng/tracepoint.h>
64 * The following tracepoint event writes a message (c string) into the
65 * field message of the trace event message in the provider
66 * sample_component in other words:
68 * sample_component:message:message = text.
72 * provider name, not a variable but a string starting with a letter
73 * and containing either letters, numbers or underscores.
74 * Needs to be the same as TRACEPOINT_PROVIDER
78 * tracepoint name, same format as sample provider. Does not need to be
79 * declared before. in this case the name is "message"
83 * TP_ARGS macro contains the arguments passed for the tracepoint
84 * it is in the following format
85 * TP_ARGS( type1, name1, type2, name2, ... type10, name10)
86 * where there can be from zero to ten elements.
87 * typeN is the datatype, such as int, struct or double **.
88 * name is the variable name (in "int myInt" the name would be myint)
89 * TP_ARGS() is valid to mean no arguments
90 * TP_ARGS( void ) is valid too
92 TP_ARGS(char *, text
),
94 * TP_FIELDS describes how to write the fields of the trace event.
95 * You can use the args here
99 * The ctf_string macro takes a c string and writes it into a field
102 ctf_string(message
, text
)
106 * Trace loglevel, shows the level of the trace event. It can be TRACE_EMERG,
107 * TRACE_ALERT, TRACE_CRIT, TRACE_ERR, TRACE_WARNING, TRACE_INFO or others.
108 * If this is not set, TRACE_DEFAULT is assumed.
109 * The first two arguments identify the tracepoint
110 * See details in <lttng/tracepoint.h> line 347
114 * The provider name, must be the same as the provider name in the
115 * TRACEPOINT_EVENT and as TRACEPOINT_PROVIDER above.
119 * The tracepoint name, must be the same as the tracepoint name in the
124 * The tracepoint loglevel. Warning, some levels are abbreviated and
125 * others are not, please see <lttng/tracepoint.h>
129 #endif /* _SAMPLE_COMPONENT_PROVIDER_H */
132 * Add this after defining the tracepoint events to expand the macros.
134 #include <lttng/tracepoint-event.h>
137 * Add this macro and its matching element to make sure the program
142 #endif /*__cplusplus */
This page took 0.033505 seconds and 5 git commands to generate.