uint32_t _code;
} ftid;
firehose_tracepoint_id_t ftid_value;
+ _Atomic(firehose_tracepoint_id_t) ftid_atomic_value;
} firehose_tracepoint_id_u;
#define FIREHOSE_STAMP_SLOP (1ULL << 36) // ~1minute
uint64_t ft_length : 16;
};
uint64_t ft_stamp_and_length;
+ _Atomic(uint64_t) ft_atomic_stamp_and_length;
};
uint8_t ft_data[];
} *firehose_tracepoint_t;
#define FIREHOSE_TRACE_ID_SET_TYPE(tid, ns, type) \
((tid).ftid._type = _firehose_tracepoint_type_##ns##_##type)
+#define FIREHOSE_TRACE_ID_PC_STYLE(tid) \
+ ((tid).ftid._flags & _firehose_tracepoint_flags_pc_style_mask)
+
+#define FIREHOSE_TRACE_ID_SET_PC_STYLE(tid, flag) ({ \
+ firehose_tracepoint_id_u _tmp_tid = (tid); \
+ _tmp_tid.ftid._flags &= ~_firehose_tracepoint_flags_pc_style_mask; \
+ _tmp_tid.ftid._flags |= _firehose_tracepoint_flags_pc_style_##flag; \
+})
+
#define FIREHOSE_TRACE_ID_HAS_FLAG(tid, ns, flag) \
((tid).ftid._flags & _firehose_tracepoint_flags_##ns##_##flag)
#define FIREHOSE_TRACE_ID_SET_FLAG(tid, ns, flag) \
#define FIREHOSE_TRACE_ID_SET_CODE(tid, code) \
((tid).ftid._code = code)
+/*!
+ * @typedef firehose_loss_payload_s
+ *
+ * @abstract
+ * The payload for tracepoints in the loss namespace, generated by the firehose
+ * itself when unreliable tracepoints are lost.
+ */
+typedef struct firehose_loss_payload_s {
+ uint64_t start_stamp; /* may (rarely!) disagree with the tracepoint stamp */
+ uint64_t end_stamp;
+#define FIREHOSE_LOSS_COUNT_WIDTH 6 /* as many bits as can be spared */
+#define FIREHOSE_LOSS_COUNT_MAX ((1u << FIREHOSE_LOSS_COUNT_WIDTH) - 1)
+ uint32_t count;
+} firehose_loss_payload_s, *firehose_loss_payload_t;
+
__BEGIN_DECLS
#if __has_feature(address_sanitizer)