chan->ops->event_write(ctx, &value, sizeof(value));
}
-#if defined(CONFIG_PERF_EVENTS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,99))
+#if defined(CONFIG_PERF_EVENTS) && (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0))
static
void overflow_callback(struct perf_event *event,
struct perf_sample_data *data,
{
struct perf_event **events = field->u.perf_counter->e;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0))
{
int ret;
&field->u.perf_counter->cpuhp_prepare.node);
WARN_ON(ret);
}
-#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
+#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
{
int cpu;
unregister_cpu_notifier(&field->u.perf_counter->nb);
#endif
}
-#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
+#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
kfree(field->event_field.name);
kfree(field->u.perf_counter->attr);
lttng_kvfree(events);
kfree(field->u.perf_counter);
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0))
int lttng_cpuhp_perf_counter_online(unsigned int cpu,
struct lttng_cpuhp_node *node)
return 0;
}
-#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
+#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
#ifdef CONFIG_HOTPLUG_CPU
#endif
-#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
+#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
int lttng_add_perf_counter_to_ctx(uint32_t type,
uint64_t config,
goto find_error;
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0))
perf_field->cpuhp_prepare.component = LTTNG_CONTEXT_PERF_COUNTERS;
ret = cpuhp_state_add_instance(lttng_hp_prepare,
if (ret)
goto cpuhp_online_error;
-#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
+#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
{
int cpu;
put_online_cpus();
perf_field->hp_enable = 1;
}
-#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
+#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
field->destroy = lttng_destroy_perf_counter_field;
field->event_field.name = name_alloc;
- field->event_field.type.atype = atype_integer;
+ field->event_field.type.type = lttng_kernel_type_integer;
field->event_field.type.u.integer.size = sizeof(uint64_t) * CHAR_BIT;
field->event_field.type.u.integer.alignment = lttng_alignof(uint64_t) * CHAR_BIT;
field->event_field.type.u.integer.signedness = lttng_is_signed_type(uint64_t);
field->event_field.type.u.integer.reverse_byte_order = 0;
field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field.type.u.integer.encoding = lttng_kernel_string_encoding_none;
field->get_size = perf_counter_get_size;
field->record = perf_counter_record;
field->u.perf_counter = perf_field;
wrapper_vmalloc_sync_mappings();
return 0;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0))
cpuhp_online_error:
{
int remove_ret;
WARN_ON(remove_ret);
}
cpuhp_prepare_error:
-#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
+#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
counter_busy:
counter_error:
{
unregister_cpu_notifier(&perf_field->nb);
#endif
}
-#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
+#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
find_error:
lttng_remove_context_field(ctx, field);
append_context_error: