-# Copyright (C) 2011-2012 Matthew Khouzam <matthew.khouzam@ericsson.com>
+# Copyright (C) 2011-2012 Matthew Khouzam <matthew.khouzam@ericsson.com>
# Copyright (C) 2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
#
# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
/*
- * Copyright (C) 2011-2012 Matthew Khouzam <matthew.khouzam@ericsson.com>
+ * Copyright (C) 2011-2012 Matthew Khouzam <matthew.khouzam@ericsson.com>
* Copyright (C) 2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-
+
#include <unistd.h>
/*
/*
* Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- * Copyright (C) 2011-2012 Matthew Khouzam <matthew.khouzam@ericsson.com>
+ * Copyright (C) 2011-2012 Matthew Khouzam <matthew.khouzam@ericsson.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-
+
/*
- * Sample lttng-ust tracepoint provider.
+ * Sample lttng-ust tracepoint provider.
*/
/*
* We undef a macro before defining it as it can be used in several files.
*/
-/*
- * Must be included before include tracepoint provider
+/*
+ * Must be included before include tracepoint provider
* ex.: project_event
* ex.: project_component_event
*
#define _SAMPLE_COMPONENT_PROVIDER_H
/*
* Add this to allow programs to call "tracepoint(...):
- */
-#include <lttng/tracepoint.h>
+ */
+#include <lttng/tracepoint.h>
/*
* The following tracepoint event writes a message (c string) into the
* field message of the trace event message in the provider
* sample_component in other words:
*
- * sample_component:message:message = text.
+ * sample_component:message:message = text.
*/
TRACEPOINT_EVENT(
/*
* provider name, not a variable but a string starting with a letter
- * and containing either letters, numbers or underscores.
+ * and containing either letters, numbers or underscores.
* Needs to be the same as TRACEPOINT_PROVIDER
*/
sample_component,
/*
- * tracepoint name, same format as sample provider. Does not need to be
- * declared before. in this case the name is "message"
+ * tracepoint name, same format as sample provider. Does not need to be
+ * declared before. in this case the name is "message"
*/
message,
/*
- * TP_ARGS macro contains the arguments passed for the tracepoint
+ * TP_ARGS macro contains the arguments passed for the tracepoint
* it is in the following format
* TP_ARGS( type1, name1, type2, name2, ... type10, name10)
- * where there can be from zero to ten elements.
- * typeN is the datatype, such as int, struct or double **.
- * name is the variable name (in "int myInt" the name would be myint)
+ * where there can be from zero to ten elements.
+ * typeN is the datatype, such as int, struct or double **.
+ * name is the variable name (in "int myInt" the name would be myint)
* TP_ARGS() is valid to mean no arguments
* TP_ARGS( void ) is valid too
- */
+ */
TP_ARGS(char *, text),
/*
- * TP_FIELDS describes how to write the fields of the trace event.
+ * TP_FIELDS describes how to write the fields of the trace event.
* You can use the args here
*/
TP_FIELDS(
/*
* The ctf_string macro takes a c string and writes it into a field
- * named "message"
- */
+ * named "message"
+ */
ctf_string(message, text)
)
)
/*
- * Trace loglevel, shows the level of the trace event. It can be TRACE_EMERG,
- * TRACE_ALERT, TRACE_CRIT, TRACE_ERR, TRACE_WARNING, TRACE_INFO or others.
+ * Trace loglevel, shows the level of the trace event. It can be TRACE_EMERG,
+ * TRACE_ALERT, TRACE_CRIT, TRACE_ERR, TRACE_WARNING, TRACE_INFO or others.
* If this is not set, TRACE_DEFAULT is assumed.
* The first two arguments identify the tracepoint
* See details in <lttng/tracepoint.h> line 347
*/
TRACEPOINT_LOGLEVEL(
/*
- * The provider name, must be the same as the provider name in the
+ * The provider name, must be the same as the provider name in the
* TRACEPOINT_EVENT and as TRACEPOINT_PROVIDER above.
*/
- sample_component,
- /*
- * The tracepoint name, must be the same as the tracepoint name in the
+ sample_component,
+ /*
+ * The tracepoint name, must be the same as the tracepoint name in the
* TRACEPOINT_EVENT
*/
- message,
+ message,
/*
* The tracepoint loglevel. Warning, some levels are abbreviated and
* others are not, please see <lttng/tracepoint.h>
#endif /* _SAMPLE_COMPONENT_PROVIDER_H */
/*
- * Add this after defining the tracepoint events to expand the macros.
- */
+ * Add this after defining the tracepoint events to expand the macros.
+ */
#include <lttng/tracepoint-event.h>
/*
* Defining macro creates the code objects of the traceprobes, only do
* it once per file
- */
+ */
#define TRACEPOINT_CREATE_PROBES
/*
- * The header containing our TRACEPOINT_EVENTs.
+ * The header containing our TRACEPOINT_EVENTs.
*/
#include "sample_component_provider.h"
-#
+#
# Copyright (C) 2013 - David Goulet <dgoulet@efficios.com>
#
# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED OR
* How to use the TRACEPOINT_EVENT macro:
*
* An example:
- *
+ *
* TRACEPOINT_EVENT(someproject_component, event_name,
*
* * TP_ARGS takes from 0 to 10 "type, field_name" pairs *
* * TP_FIELDS describes the event payload layout in the trace *
*
* TP_FIELDS(
- * * Integer, printed in base 10 *
+ * * Integer, printed in base 10 *
* ctf_integer(int, field_a, arg0)
*
- * * Integer, printed with 0x base 16 *
+ * * Integer, printed with 0x base 16 *
* ctf_integer_hex(unsigned long, field_d, arg1)
*
* * Enumeration *
* ctf_enum(someproject_component, enum_name, int, field_e, arg0)
*
- * * Array Sequence, printed as UTF8-encoded array of bytes *
+ * * Array Sequence, printed as UTF8-encoded array of bytes *
* ctf_array_text(char, field_b, string, FIXED_LEN)
* ctf_sequence_text(char, field_c, string, size_t, strlen)
*
- * * String, printed as UTF8-encoded string *
+ * * String, printed as UTF8-encoded string *
* ctf_string(field_e, string)
*
- * * Array sequence of signed integer values *
+ * * Array sequence of signed integer values *
* ctf_array(long, field_f, arg4, FIXED_LEN4)
* ctf_sequence(long, field_g, arg4, size_t, arg4_len)
* )
extern void ust_after_fork_parent(sigset_t *restore_sigset);
extern void ust_after_fork_child(sigset_t *restore_sigset);
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
* Returns a 32-bit value. Every bit of the key affects every bit of
* the return value. Two keys differing by one or two bits will have
* totally different hash values.
- *
+ *
* The best hash table sizes are powers of 2. There is no need to do
* mod a prime (mod is sooo slow!). If you need less than 32 bits,
* use a bitmask. For example, if you need only 10 bits, do
* h = (h & hashmask(10));
* In which case, the hash table should have hashsize(10) elements.
- *
+ *
* If you are hashing n strings (uint8_t **)k, do it like this:
* for (i = 0, h = 0; i < n; ++i) h = hashlittle(k[i], len[i], h);
- *
+ *
* By Bob Jenkins, 2006. bob_jenkins@burtleburtle.net. You may use this
* code any way you wish, private, educational, or commercial. It's free.
- *
+ *
* Use for hash table lookup, or anything where one collision in 2^^32 is
* acceptable. Do NOT use for cryptographic purposes.
*/
}
/*----------------------------- handle the last (probably partial) block */
- /*
+ /*
* "k[2]&0xffffff" actually reads beyond the end of the string, but
* then masks off the part it's not allowed to read. Because the
* string is aligned, the masked-off tail is in the same word as the
static
size_t lttng_packet_avail_size(struct channel *chan, struct lttng_ust_shm_handle *handle)
-
{
unsigned long o_begin;
struct lttng_ust_lib_ring_buffer *buf;
* Call "destroy" callback, finalize channels, decrement the channel
* reference count. Note that when readers have completed data
* consumption of finalized channels, get_subbuf() will return -ENODATA.
- * They should release their handle at that point.
+ * They should release their handle at that point.
*/
void channel_destroy(struct channel *chan, struct lttng_ust_shm_handle *handle,
int consumer)
return (0);
}
-
+
#ifdef FLOATING_POINT
static int
exponent(char *p0, int exp, int fmtch)