X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Flttng-context-perf-counters.c;h=25ca8c59f1790c1d6cdcd3ca04e1d71a0be6226c;hb=5f4c791e2ad2c814101ccdb500e65543f2792c41;hp=bc860e67465e508ba48451cd6414d51cbad785f3;hpb=be06402dbdbea2f3394e60ec15c5d3356e2be416;p=deliverable%2Flttng-modules.git diff --git a/src/lttng-context-perf-counters.c b/src/lttng-context-perf-counters.c index bc860e67..25ca8c59 100644 --- a/src/lttng-context-perf-counters.c +++ b/src/lttng-context-perf-counters.c @@ -59,7 +59,7 @@ void perf_counter_record(struct lttng_ctx_field *field, chan->ops->event_write(ctx, &value, sizeof(value)); } -#if defined(CONFIG_PERF_EVENTS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) +#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, @@ -80,7 +80,7 @@ void lttng_destroy_perf_counter_field(struct lttng_ctx_field *field) { 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; @@ -91,7 +91,7 @@ void lttng_destroy_perf_counter_field(struct lttng_ctx_field *field) &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; @@ -103,14 +103,14 @@ void lttng_destroy_perf_counter_field(struct lttng_ctx_field *field) 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) @@ -151,7 +151,7 @@ int lttng_cpuhp_perf_counter_dead(unsigned int cpu, 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 @@ -210,7 +210,7 @@ int lttng_perf_counter_cpu_hp_callback(struct notifier_block *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)) */ int lttng_add_perf_counter_to_ctx(uint32_t type, uint64_t config, @@ -264,7 +264,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type, 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, @@ -278,7 +278,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type, 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; @@ -304,7 +304,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type, 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; @@ -324,7 +324,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type, 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; @@ -334,7 +334,7 @@ cpuhp_online_error: 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: { @@ -349,7 +349,7 @@ 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: