#define LTT_ARCH_VARIANT LTT_ARCH_VARIANT_NONE
#endif
-struct ltt_active_marker;
+struct ltt_active_ust_marker;
-/* Maximum number of callbacks per marker */
+/* Maximum number of callbacks per ust_marker */
#define LTT_NR_CALLBACKS 10
struct ltt_serialize_closure;
extern size_t ltt_serialize_data(struct ust_buffer *buf, size_t buf_offset,
struct ltt_serialize_closure *closure,
void *serialize_private,
- int *largest_align, const char *fmt, va_list *args);
+ unsigned int stack_pos_ctx, int *largest_align,
+ const char *fmt, va_list *args);
struct ltt_probe_private_data {
struct ust_trace *trace; /*
unsigned int def_subbufcount;
};
-struct ltt_active_marker {
- struct list_head node; /* active markers list */
+struct ltt_active_ust_marker {
+ struct cds_list_head node; /* active markers list */
const char *channel;
const char *name;
const char *format;
struct ltt_available_probe *probe;
};
-struct marker; //ust//
-extern void ltt_vtrace(const struct marker *mdata, void *probe_data,
+struct ust_marker; //ust//
+extern void ltt_vtrace(const struct ust_marker *mdata, void *probe_data,
struct registers *regs, void *call_data, const char *fmt, va_list *args);
-extern void ltt_trace(const struct marker *mdata, void *probe_data,
+extern void ltt_trace(const struct ust_marker *mdata, void *probe_data,
struct registers *regs, void *call_data, const char *fmt, ...);
/*
* Unique ID assigned to each registered probe.
*/
-enum marker_id {
- MARKER_ID_SET_MARKER_ID = 0, /* Static IDs available (range 0-7) */
- MARKER_ID_SET_MARKER_FORMAT,
- MARKER_ID_COMPACT, /* Compact IDs (range: 8-127) */
- MARKER_ID_DYNAMIC, /* Dynamic IDs (range: 128-65535) */
+enum ust_marker_id {
+ UST_MARKER_ID_SET_MARKER_ID = 0, /* Static IDs available (range 0-7) */
+ UST_MARKER_ID_SET_MARKER_FORMAT,
+ UST_MARKER_ID_COMPACT, /* Compact IDs (range: 8-127) */
+ UST_MARKER_ID_DYNAMIC, /* Dynamic IDs (range: 128-65535) */
};
/* static ids 0-1 reserved for internal use. */
-#define MARKER_CORE_IDS 2
-static __inline__ enum marker_id marker_id_type(uint16_t id)
+#define UST_MARKER_CORE_IDS 2
+static __inline__ enum ust_marker_id ust_marker_id_type(uint16_t id)
{
- if (id < MARKER_CORE_IDS)
- return (enum marker_id)id;
+ if (id < UST_MARKER_CORE_IDS)
+ return (enum ust_marker_id)id;
else
- return MARKER_ID_DYNAMIC;
+ return UST_MARKER_ID_DYNAMIC;
}
struct user_dbg_data {
struct ltt_transport {
char *name;
struct module *owner;
- struct list_head node;
+ struct cds_list_head node;
struct ltt_trace_ops ops;
};
/* Per-trace information - each trace/flight recorder represented by one */
struct ust_trace {
/* First 32 bytes cache-hot cacheline */
- struct list_head list;
+ struct cds_list_head list;
struct ltt_trace_ops *ops;
int active;
/* Second 32 bytes cache-hot cacheline */
struct {
struct dentry *trace_root;
} dentry;
- struct kref kref; /* Each channel has a kref of the trace struct */
+ struct urcu_ref urcu_ref; /* Each channel has a urcu_ref of the trace struct */
struct ltt_transport *transport;
- struct kref ltt_transport_kref;
+ struct urcu_ref ltt_transport_urcu_ref;
char trace_name[NAME_MAX];
} ____cacheline_aligned;
header->freq_scale = trace->freq_scale;
}
+#ifndef UST_VALGRIND
+
static __inline__ int ust_get_cpu(void)
{
-#ifndef UST_VALGRIND
- return sched_getcpu();
-#else
- /* Valgrind does not support the sched_getcpu() vsyscall.
+ int cpu;
+
+ cpu = sched_getcpu();
+ if (likely(cpu >= 0))
+ return cpu;
+ /*
+ * If getcpu(2) is not implemented in the Kernel use CPU 0 as fallback.
+ */
+ return 0;
+}
+
+#else /* #else #ifndef UST_VALGRIND */
+
+static __inline__ int ust_get_cpu(void)
+{
+ /*
+ * Valgrind does not support the sched_getcpu() vsyscall.
* It causes it to detect a segfault in the program and stop it.
* So if we want to check libust with valgrind, we have to refrain
* from using this call. TODO: it would probably be better to return
* other values too, to better test it.
*/
return 0;
-#endif
}
+#endif /* #else #ifndef UST_VALGRIND */
/*
* Size reserved for high priority events (interrupts, NMI, BH) at the end of a
extern void ltt_core_unregister(void);
-extern void ltt_release_trace(struct kref *kref);
-extern void ltt_release_transport(struct kref *kref);
+extern void ltt_release_trace(struct urcu_ref *urcu_ref);
+extern void ltt_release_transport(struct urcu_ref *urcu_ref);
-extern void ltt_dump_marker_state(struct ust_trace *trace);
+extern void ltt_dump_ust_marker_state(struct ust_trace *trace);
extern void ltt_lock_traces(void);
extern void ltt_unlock_traces(void);