- ust_type = lttng_ust_create_type_integer(sizeof(uint64_t) * CHAR_BIT,
- lttng_ust_rb_alignof(uint64_t) * CHAR_BIT,
- lttng_ust_is_signed_type(uint64_t),
- BYTE_ORDER, 10);
- if (!ust_type) {
- ret = -ENOMEM;
- goto type_alloc_error;
- }
- field = lttng_append_context(ctx);
- if (!field) {
- ret = -ENOMEM;
- goto append_context_error;
- }
- if (lttng_find_context(*ctx, name_alloc)) {
- ret = -EEXIST;
- goto find_error;
- }
-
- field->destroy = lttng_destroy_perf_counter_field;
-
- field->event_field->name = name_alloc;
- field->event_field->type = ust_type;
- field->get_size = perf_counter_get_size;
- field->record = perf_counter_record;
- field->get_value = perf_counter_get_value;
-