extern
void ltt_write_event_header_slow(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer_ctx *ctx,
- u16 eID, u32 event_size);
+ uint16_t event_id);
/*
* ltt_write_event_header
*
* @config: ring buffer instance configuration
* @ctx: reservation context
- * @eID : event ID
- * @event_size : size of the event, excluding the event header.
+ * @event_id: event ID
*/
static __inline__
void ltt_write_event_header(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer_ctx *ctx,
- u16 eID, u32 event_size)
+ uint16_t event_id)
{
struct ltt_channel *ltt_chan = channel_get_private(ctx->chan);
{
uint32_t id_time = 0;
- bt_bitfield_write(&id_time, uint32_t, 0, 5, eID);
+ bt_bitfield_write(&id_time, uint32_t, 0, 5, event_id);
bt_bitfield_write(&id_time, uint32_t, 5, 27, ctx->tsc);
lib_ring_buffer_write(config, ctx, &id_time, sizeof(id_time));
break;
}
case 2: /* large */
{
- uint16_t event_id = eID;
uint32_t timestamp = (uint32_t) ctx->tsc;
lib_ring_buffer_write(config, ctx, &event_id, sizeof(event_id));
return;
slow_path:
- ltt_write_event_header_slow(config, ctx, eID, event_size);
+ ltt_write_event_header_slow(config, ctx, event_id);
}
/*
*/
void ltt_write_event_header_slow(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer_ctx *ctx,
- u16 eID, u32 event_size)
+ uint16_t event_id)
{
struct ltt_channel *ltt_chan = channel_get_private(ctx->chan);
if (!(ctx->rflags & RING_BUFFER_RFLAG_FULL_TSC)) {
uint32_t id_time = 0;
- bt_bitfield_write(&id_time, uint32_t, 0, 5, eID);
+ bt_bitfield_write(&id_time, uint32_t, 0, 5, event_id);
bt_bitfield_write(&id_time, uint32_t, 5, 27, ctx->tsc);
lib_ring_buffer_write(config, ctx, &id_time, sizeof(id_time));
} else {
uint8_t id = 0;
- uint32_t event_id = (uint32_t) eID;
+ uint32_t event_id = (uint32_t) event_id;
uint64_t timestamp = ctx->tsc;
bt_bitfield_write(&id, uint8_t, 0, 5, 31);
case 2: /* large */
{
if (!(ctx->rflags & RING_BUFFER_RFLAG_FULL_TSC)) {
- uint16_t event_id = eID;
uint32_t timestamp = (uint32_t) ctx->tsc;
lib_ring_buffer_write(config, ctx, &event_id, sizeof(event_id));
lib_ring_buffer_write(config, ctx, ×tamp, sizeof(timestamp));
} else {
uint16_t event_id = 65535;
- uint32_t event_id_ext = (uint32_t) eID;
+ uint32_t event_id_ext = (uint32_t) event_id;
uint64_t timestamp = ctx->tsc;
lib_ring_buffer_write(config, ctx, &event_id, sizeof(event_id));
}
static
-int ltt_event_reserve(struct lib_ring_buffer_ctx *ctx)
+int ltt_event_reserve(struct lib_ring_buffer_ctx *ctx,
+ uint16_t event_id)
{
int ret, cpu;
ret = lib_ring_buffer_reserve(&client_config, ctx);
if (ret)
goto put;
- return ret;
-
+ ltt_write_event_header(&client_config, ctx, event_id);
+ return 0;
put:
lib_ring_buffer_put_cpu(&client_config);
return ret;