/* echo 0>/dev/oprofile/enable */ void oprofile_stop(void) { mutex_lock(&start_mutex); if (!oprofile_started) goto out; oprofile_ops.stop(); oprofile_started = 0; /* wake up the daemon to read what remains */ wake_up_buffer_waiter(); out: mutex_unlock(&start_mutex); }
/* echo 0>/dev/oprofile/enable */ void oprofile_stop(void) { down(&start_sem); if (!oprofile_started) goto out; oprofile_ops.stop(); oprofile_started = 0; /* wake up the daemon to read what remains */ wake_up_buffer_waiter(); out: up(&start_sem); }
static ssize_t dump_write(struct file *file, char const __user *buf, size_t count, loff_t *offset) { wake_up_buffer_waiter(); return count; }