#include <wrapper/mm.h>
#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_mappings() */
#include <wrapper/ringbuffer/config.h>
#include <wrapper/mm.h>
#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_mappings() */
#include <wrapper/ringbuffer/config.h>
chanb->cpuhp_prepare.component = LTTNG_RING_BUFFER_BACKEND;
ret = cpuhp_state_add_instance(lttng_rb_hp_prepare,
&chanb->cpuhp_prepare.node);
if (ret)
goto free_bufs;
chanb->cpuhp_prepare.component = LTTNG_RING_BUFFER_BACKEND;
ret = cpuhp_state_add_instance(lttng_rb_hp_prepare,
&chanb->cpuhp_prepare.node);
if (ret)
goto free_bufs;
for_each_online_cpu(i) {
ret = lib_ring_buffer_create(per_cpu_ptr(chanb->buf, i),
chanb, i);
if (ret)
goto free_bufs; /* cpu hotplug locked */
}
for_each_online_cpu(i) {
ret = lib_ring_buffer_create(per_cpu_ptr(chanb->buf, i),
chanb, i);
if (ret)
goto free_bufs; /* cpu hotplug locked */
}
#else
for_each_possible_cpu(i) {
ret = lib_ring_buffer_create(per_cpu_ptr(chanb->buf, i),
#else
for_each_possible_cpu(i) {
ret = lib_ring_buffer_create(per_cpu_ptr(chanb->buf, i),
/*
* Teardown of lttng_rb_hp_prepare instance
* on "add" error is handled within cpu hotplug,
* no teardown to do from the caller.
*/
/*
* Teardown of lttng_rb_hp_prepare instance
* on "add" error is handled within cpu hotplug,
* no teardown to do from the caller.
*/
for_each_possible_cpu(i) {
struct lib_ring_buffer *buf =
per_cpu_ptr(chanb->buf, i);
for_each_possible_cpu(i) {
struct lib_ring_buffer *buf =
per_cpu_ptr(chanb->buf, i);
const struct lib_ring_buffer_config *config = &chanb->config;
if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
const struct lib_ring_buffer_config *config = &chanb->config;
if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
int ret;
ret = cpuhp_state_remove_instance(lttng_rb_hp_prepare,
&chanb->cpuhp_prepare.node);
WARN_ON(ret);
int ret;
ret = cpuhp_state_remove_instance(lttng_rb_hp_prepare,
&chanb->cpuhp_prepare.node);
WARN_ON(ret);