+++ /dev/null
-#ifndef _LTT_FACILITY_TESTS_H_
-#define _LTT_FACILITY_TESTS_H_
-
-
-#include <linux/types.h>
-#include "ltt-facility-id-tests.h"
-#include <ltt/ltt-tracer.h>
-
-#define ltt_get_index_from_facility_tests ltt_get_index_from_facility
-
-/* Named types */
-
-/* Event write_4bytes structures */
-
-/* Event write_4bytes logging function */
-static inline void trace_tests_write_4bytes(
- unsigned int lttng_param_value)
-{
- unsigned int index;
- struct ltt_channel_struct *channel;
- struct ltt_trace_struct *trace;
- void *transport_data;
- char *buffer = NULL;
- size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
- size_t *to_base = &real_to_base;
- size_t real_to = 0;
- size_t *to = &real_to;
- size_t real_len = 0;
- size_t *len = &real_len;
- size_t reserve_size;
- size_t slot_size;
- size_t align;
- const char *real_from;
- const char **from = &real_from;
- u64 tsc;
- size_t before_hdr_pad, after_hdr_pad, header_size;
-
- if (ltt_traces.num_active_traces == 0)
- return;
-
- /* For each field, calculate the field size. */
- /* size = *to_base + *to + *len */
- /* Assume that the padding for alignment starts at a
- * sizeof(void *) address. */
-
- *from = (const char*)<tng_param_value;
- align = sizeof(unsigned int);
-
- if (*len == 0) {
- *to += ltt_align(*to, align); /* align output */
- } else {
- *len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
- }
-
- *len += sizeof(unsigned int);
-
- reserve_size = *to_base + *to + *len;
- preempt_disable();
- ltt_nesting[smp_processor_id()]++;
- index = ltt_get_index_from_facility_tests( event_tests_write_4bytes);
-
- list_for_each_entry_rcu(trace, <t_traces.head, list) {
- if (!trace->active)
- continue;
-
- channel = ltt_get_channel_from_index(trace, index);
-
- slot_size = 0;
- buffer = ltt_reserve_slot(trace, channel, &transport_data,
- reserve_size, &slot_size, &tsc,
- &before_hdr_pad, &after_hdr_pad, &header_size);
- if (!buffer)
- continue; /* buffer full */
-
- *to_base = *to = *len = 0;
-
- ltt_write_event_header(trace, channel, buffer,
- ltt_facility_tests_CA7F1536, event_tests_write_4bytes,
- reserve_size, before_hdr_pad, tsc);
- *to_base += before_hdr_pad + after_hdr_pad + header_size;
-
- *from = (const char*)<tng_param_value;
- align = sizeof(unsigned int);
-
- if (*len == 0) {
- *to += ltt_align(*to, align); /* align output */
- } else {
- *len += ltt_align(*to+*len, align); /* alignment, ok to do a memcpy of it */
- }
-
- *len += sizeof(unsigned int);
-
- /* Flush pending memcpy */
- if (*len != 0) {
- memcpy(buffer+*to_base+*to, *from, *len);
- *to += *len;
- *len = 0;
- }
-
- ltt_commit_slot(channel, &transport_data, buffer, slot_size);
-
- }
-
- ltt_nesting[smp_processor_id()]--;
- preempt_enable_no_resched();
-}
-
-#endif //_LTT_FACILITY_TESTS_H_