*/
#include <ringbuffer/iterator.h>
-#include <wrapper/file.h>
+#include <wrapper/cpu.h>
+#include <linux/file.h>
#include <wrapper/uaccess.h>
#include <linux/jiffies.h>
#include <linux/delay.h>
chan->hp_iter_notifier.priority = 10;
register_cpu_notifier(&chan->hp_iter_notifier);
- get_online_cpus();
+ lttng_cpus_read_lock();
for_each_online_cpu(cpu) {
buf = per_cpu_ptr(chan->backend.buf, cpu);
lib_ring_buffer_iterator_init(chan, buf);
}
chan->hp_iter_enable = 1;
- put_online_cpus();
+ lttng_cpus_read_unlock();
#else
for_each_possible_cpu(cpu) {
buf = per_cpu_ptr(chan->backend.buf, cpu);
CHAN_WARN_ON(chan, config->output != RING_BUFFER_ITERATOR);
if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
- get_online_cpus();
+ lttng_cpus_read_lock();
/* Allow CPU hotplug to keep track of opened reader */
chan->iter.read_open = 1;
for_each_channel_cpu(cpu, chan) {
goto error;
buf->iter.read_open = 1;
}
- put_online_cpus();
+ lttng_cpus_read_unlock();
} else {
buf = channel_get_ring_buffer(config, chan, 0);
ret = lib_ring_buffer_iterator_open(buf);
error:
/* Error should always happen on CPU 0, hence no close is required. */
CHAN_WARN_ON(chan, cpu != 0);
- put_online_cpus();
+ lttng_cpus_read_unlock();
return ret;
}
EXPORT_SYMBOL_GPL(channel_iterator_open);
int cpu;
if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
- get_online_cpus();
+ lttng_cpus_read_lock();
for_each_channel_cpu(cpu, chan) {
buf = channel_get_ring_buffer(config, chan, cpu);
if (buf->iter.read_open) {
}
}
chan->iter.read_open = 0;
- put_online_cpus();
+ lttng_cpus_read_unlock();
} else {
buf = channel_get_ring_buffer(config, chan, 0);
lib_ring_buffer_iterator_release(buf);
size_t count,
loff_t *ppos)
{
- struct inode *inode = filp->lttng_f_dentry->d_inode;
+ struct inode *inode = filp->f_path.dentry->d_inode;
struct lttng_kernel_ring_buffer *buf = inode->i_private;
struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
size_t count,
loff_t *ppos)
{
- struct inode *inode = filp->lttng_f_dentry->d_inode;
+ struct inode *inode = filp->f_path.dentry->d_inode;
struct lttng_kernel_ring_buffer_channel *chan = inode->i_private;
const struct lttng_kernel_ring_buffer_config *config = &chan->backend.config;