*
* Ported to userspace by Pierre-Marc Fournier.
*
- * This file is released under the GPLv2.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _LTT_TRACER_H
#include <sys/types.h>
#include <stdarg.h>
+//#include "list.h"
+#include <ust/kernelcompat.h>
+#include "buffer.h"
#include "relay.h"
-#include "list.h"
-#include "kernelcompat.h"
#include "channels.h"
#include "tracercore.h"
-#include "marker.h"
+#include <ust/marker.h>
/* Number of bytes to log with a read/write event */
#define LTT_LOG_RW_SIZE 32L
unsigned int cb_idx;
};
-size_t ltt_serialize_data(struct rchan_buf *buf, size_t buf_offset,
+extern size_t ltt_serialize_data(struct rchan_buf *buf, size_t buf_offset,
struct ltt_serialize_closure *closure,
void *serialize_private,
int *largest_align, const char *fmt, va_list *args);
struct marker; //ust//
extern void ltt_vtrace(const struct marker *mdata, void *probe_data,
- void *call_data, const char *fmt, va_list *args);
+ struct registers *regs, void *call_data, const char *fmt, va_list *args);
extern void ltt_trace(const struct marker *mdata, void *probe_data,
- void *call_data, const char *fmt, ...);
+ struct registers *regs, void *call_data, const char *fmt, ...);
/*
* Unique ID assigned to each registered probe.
size_t *slot_size, long *buf_offset, u64 *tsc,
unsigned int *rflags,
int largest_align);
- void (*commit_slot) (struct ltt_channel_struct *channel,
- void **transport_data, long buf_offset,
- size_t slot_size);
+//ust// void (*commit_slot) (struct ltt_channel_struct *channel,
+//ust// void **transport_data, long buf_offset,
+//ust// size_t slot_size);
void (*wakeup_channel) (struct ltt_channel_struct *ltt_channel);
int (*user_blocking) (struct ltt_trace_struct *trace,
unsigned int index, size_t data_size,
/* Lockless LTTng */
-/* Buffer offset macros */
-
-/*
- * BUFFER_TRUNC zeroes the subbuffer offset and the subbuffer number parts of
- * the offset, which leaves only the buffer number.
- */
-#define BUFFER_TRUNC(offset, chan) \
- ((offset) & (~((chan)->alloc_size-1)))
-#define BUFFER_OFFSET(offset, chan) ((offset) & ((chan)->alloc_size - 1))
-#define SUBBUF_OFFSET(offset, chan) ((offset) & ((chan)->subbuf_size - 1))
-#define SUBBUF_ALIGN(offset, chan) \
- (((offset) + (chan)->subbuf_size) & (~((chan)->subbuf_size - 1)))
-#define SUBBUF_TRUNC(offset, chan) \
- ((offset) & (~((chan)->subbuf_size - 1)))
-#define SUBBUF_INDEX(offset, chan) \
- (BUFFER_OFFSET((offset), chan) >> (chan)->subbuf_size_order)
-
/*
* ltt_reserve_slot
*
}
-/*
- * ltt_commit_slot
- *
- * Atomic unordered slot commit. Increments the commit count in the
- * specified sub-buffer, and delivers it if necessary.
- *
- * Parameters:
- *
- * @channel : the chanel to reserve space into.
- * @transport_data : specific transport data.
- * @buf_offset : offset of beginning of reserved slot
- * @slot_size : size of the reserved slot.
- */
-static inline void ltt_commit_slot(
- struct ltt_channel_struct *channel,
- void **transport_data,
- long buf_offset,
- size_t slot_size)
-{
- struct ltt_trace_struct *trace = channel->trace;
-
- trace->ops->commit_slot(channel, transport_data, buf_offset, slot_size);
-}
+///*
+// * ltt_commit_slot
+// *
+// * Atomic unordered slot commit. Increments the commit count in the
+// * specified sub-buffer, and delivers it if necessary.
+// *
+// * Parameters:
+// *
+// * @channel : the chanel to reserve space into.
+// * @transport_data : specific transport data.
+// * @buf_offset : offset of beginning of reserved slot
+// * @slot_size : size of the reserved slot.
+// */
+//static inline void ltt_commit_slot(
+// struct ltt_channel_struct *channel,
+// void **transport_data,
+// long buf_offset,
+// size_t slot_size)
+//{
+// struct ltt_trace_struct *trace = channel->trace;
+//
+// trace->ops->commit_slot(channel, transport_data, buf_offset, slot_size);
+//}
/*
* Control channels :
#define LTT_FLIGHT_PREFIX "flight-"
/* Tracer properties */
-//#define LTT_DEFAULT_SUBBUF_SIZE_LOW 65536
-#define LTT_DEFAULT_SUBBUF_SIZE_LOW 4096
+//#define LTT_DEFAULT_SUBBUF_SIZE_LOW 134217728
+#define LTT_DEFAULT_SUBBUF_SIZE_LOW 65536
+//#define LTT_DEFAULT_SUBBUF_SIZE_LOW 4096
#define LTT_DEFAULT_N_SUBBUFS_LOW 2
-//#define LTT_DEFAULT_SUBBUF_SIZE_MED 262144
-#define LTT_DEFAULT_SUBBUF_SIZE_MED 4096
+//#define LTT_DEFAULT_SUBBUF_SIZE_MED 134217728
+#define LTT_DEFAULT_SUBBUF_SIZE_MED 262144
+//#define LTT_DEFAULT_SUBBUF_SIZE_MED 4096
#define LTT_DEFAULT_N_SUBBUFS_MED 2
-//#define LTT_DEFAULT_SUBBUF_SIZE_HIGH 1048576
-#define LTT_DEFAULT_SUBBUF_SIZE_HIGH 4096
+//#define LTT_DEFAULT_SUBBUF_SIZE_HIGH 134217728
+#define LTT_DEFAULT_SUBBUF_SIZE_HIGH 1048576
+//#define LTT_DEFAULT_SUBBUF_SIZE_HIGH 4096
#define LTT_DEFAULT_N_SUBBUFS_HIGH 2
#define LTT_TRACER_MAGIC_NUMBER 0x00D6B7ED
#define LTT_TRACER_VERSION_MAJOR 2
LTT_FUNCTION_STATEDUMP
};
-void ltt_transport_register(struct ltt_transport *transport);
-void ltt_transport_unregister(struct ltt_transport *transport);
+extern void ltt_transport_register(struct ltt_transport *transport);
+extern void ltt_transport_unregister(struct ltt_transport *transport);
/* Exported control function */
} new_trace;
};
-int _ltt_trace_setup(const char *trace_name);
-int ltt_trace_setup(const char *trace_name);
-struct ltt_trace_struct *_ltt_trace_find_setup(const char *trace_name);
-int ltt_trace_set_type(const char *trace_name, const char *trace_type);
-int ltt_trace_set_channel_subbufsize(const char *trace_name,
+extern int _ltt_trace_setup(const char *trace_name);
+extern int ltt_trace_setup(const char *trace_name);
+extern struct ltt_trace_struct *_ltt_trace_find_setup(const char *trace_name);
+extern int ltt_trace_set_type(const char *trace_name, const char *trace_type);
+extern int ltt_trace_set_channel_subbufsize(const char *trace_name,
const char *channel_name, unsigned int size);
-int ltt_trace_set_channel_subbufcount(const char *trace_name,
+extern int ltt_trace_set_channel_subbufcount(const char *trace_name,
const char *channel_name, unsigned int cnt);
-int ltt_trace_set_channel_enable(const char *trace_name,
+extern int ltt_trace_set_channel_enable(const char *trace_name,
const char *channel_name, unsigned int enable);
-int ltt_trace_set_channel_overwrite(const char *trace_name,
+extern int ltt_trace_set_channel_overwrite(const char *trace_name,
const char *channel_name, unsigned int overwrite);
-int ltt_trace_alloc(const char *trace_name);
-int ltt_trace_destroy(const char *trace_name);
-int ltt_trace_start(const char *trace_name);
-int ltt_trace_stop(const char *trace_name);
+extern int ltt_trace_alloc(const char *trace_name);
+extern int ltt_trace_destroy(const char *trace_name);
+extern int ltt_trace_start(const char *trace_name);
+extern int ltt_trace_stop(const char *trace_name);
enum ltt_filter_control_msg {
LTT_FILTER_DEFAULT_ACCEPT,
extern struct dentry *get_filter_root(void);
-void ltt_write_trace_header(struct ltt_trace_struct *trace,
+extern void ltt_write_trace_header(struct ltt_trace_struct *trace,
struct ltt_subbuffer_header *header);
extern void ltt_buffer_destroy(struct ltt_channel_struct *ltt_chan);
-void ltt_core_register(int (*function)(u8, void *));
+extern void ltt_core_register(int (*function)(u8, void *));
-void ltt_core_unregister(void);
+extern void ltt_core_unregister(void);
-void ltt_release_trace(struct kref *kref);
-void ltt_release_transport(struct kref *kref);
+extern void ltt_release_trace(struct kref *kref);
+extern void ltt_release_transport(struct kref *kref);
extern int ltt_probe_register(struct ltt_available_probe *pdata);
extern int ltt_probe_unregister(struct ltt_available_probe *pdata);
const char *pname);
extern void ltt_dump_marker_state(struct ltt_trace_struct *trace);
-void ltt_lock_traces(void);
-void ltt_unlock_traces(void);
+extern void ltt_lock_traces(void);
+extern void ltt_unlock_traces(void);
-struct ltt_trace_struct *_ltt_trace_find(const char *trace_name);
+extern struct ltt_trace_struct *_ltt_trace_find(const char *trace_name);
#endif /* _LTT_TRACER_H */