Merge commit 'origin/master' into next
This commit is contained in:
@@ -1503,10 +1503,21 @@ static void perf_counter_enable_on_exec(struct task_struct *task)
|
||||
*/
|
||||
static void __perf_counter_read(void *info)
|
||||
{
|
||||
struct perf_cpu_context *cpuctx = &__get_cpu_var(perf_cpu_context);
|
||||
struct perf_counter *counter = info;
|
||||
struct perf_counter_context *ctx = counter->ctx;
|
||||
unsigned long flags;
|
||||
|
||||
/*
|
||||
* If this is a task context, we need to check whether it is
|
||||
* the current task context of this cpu. If not it has been
|
||||
* scheduled out before the smp call arrived. In that case
|
||||
* counter->count would have been updated to a recent sample
|
||||
* when the counter was scheduled out.
|
||||
*/
|
||||
if (ctx->task && cpuctx->task_ctx != ctx)
|
||||
return;
|
||||
|
||||
local_irq_save(flags);
|
||||
if (ctx->is_active)
|
||||
update_context_time(ctx);
|
||||
@@ -1780,7 +1791,7 @@ static int perf_counter_read_group(struct perf_counter *counter,
|
||||
size += err;
|
||||
|
||||
list_for_each_entry(sub, &leader->sibling_list, list_entry) {
|
||||
err = perf_counter_read_entry(counter, read_format,
|
||||
err = perf_counter_read_entry(sub, read_format,
|
||||
buf + size);
|
||||
if (err < 0)
|
||||
return err;
|
||||
@@ -2008,6 +2019,10 @@ int perf_counter_task_disable(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef PERF_COUNTER_INDEX_OFFSET
|
||||
# define PERF_COUNTER_INDEX_OFFSET 0
|
||||
#endif
|
||||
|
||||
static int perf_counter_index(struct perf_counter *counter)
|
||||
{
|
||||
if (counter->state != PERF_COUNTER_STATE_ACTIVE)
|
||||
|
@@ -137,11 +137,12 @@ int clockevents_program_event(struct clock_event_device *dev, ktime_t expires,
|
||||
*/
|
||||
int clockevents_register_notifier(struct notifier_block *nb)
|
||||
{
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
|
||||
spin_lock(&clockevents_lock);
|
||||
spin_lock_irqsave(&clockevents_lock, flags);
|
||||
ret = raw_notifier_chain_register(&clockevents_chain, nb);
|
||||
spin_unlock(&clockevents_lock);
|
||||
spin_unlock_irqrestore(&clockevents_lock, flags);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -178,16 +179,18 @@ static void clockevents_notify_released(void)
|
||||
*/
|
||||
void clockevents_register_device(struct clock_event_device *dev)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED);
|
||||
BUG_ON(!dev->cpumask);
|
||||
|
||||
spin_lock(&clockevents_lock);
|
||||
spin_lock_irqsave(&clockevents_lock, flags);
|
||||
|
||||
list_add(&dev->list, &clockevent_devices);
|
||||
clockevents_do_notify(CLOCK_EVT_NOTIFY_ADD, dev);
|
||||
clockevents_notify_released();
|
||||
|
||||
spin_unlock(&clockevents_lock);
|
||||
spin_unlock_irqrestore(&clockevents_lock, flags);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(clockevents_register_device);
|
||||
|
||||
@@ -235,8 +238,9 @@ void clockevents_exchange_device(struct clock_event_device *old,
|
||||
void clockevents_notify(unsigned long reason, void *arg)
|
||||
{
|
||||
struct list_head *node, *tmp;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock(&clockevents_lock);
|
||||
spin_lock_irqsave(&clockevents_lock, flags);
|
||||
clockevents_do_notify(reason, arg);
|
||||
|
||||
switch (reason) {
|
||||
@@ -251,7 +255,7 @@ void clockevents_notify(unsigned long reason, void *arg)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
spin_unlock(&clockevents_lock);
|
||||
spin_unlock_irqrestore(&clockevents_lock, flags);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(clockevents_notify);
|
||||
#endif
|
||||
|
@@ -205,11 +205,11 @@ static void tick_handle_periodic_broadcast(struct clock_event_device *dev)
|
||||
* Powerstate information: The system enters/leaves a state, where
|
||||
* affected devices might stop
|
||||
*/
|
||||
static void tick_do_broadcast_on_off(void *why)
|
||||
static void tick_do_broadcast_on_off(unsigned long *reason)
|
||||
{
|
||||
struct clock_event_device *bc, *dev;
|
||||
struct tick_device *td;
|
||||
unsigned long flags, *reason = why;
|
||||
unsigned long flags;
|
||||
int cpu, bc_stopped;
|
||||
|
||||
spin_lock_irqsave(&tick_broadcast_lock, flags);
|
||||
@@ -276,8 +276,7 @@ void tick_broadcast_on_off(unsigned long reason, int *oncpu)
|
||||
printk(KERN_ERR "tick-broadcast: ignoring broadcast for "
|
||||
"offline CPU #%d\n", *oncpu);
|
||||
else
|
||||
smp_call_function_single(*oncpu, tick_do_broadcast_on_off,
|
||||
&reason, 1);
|
||||
tick_do_broadcast_on_off(&reason);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -286,7 +286,7 @@ static int __init init_timer_list_procfs(void)
|
||||
{
|
||||
struct proc_dir_entry *pe;
|
||||
|
||||
pe = proc_create("timer_list", 0644, NULL, &timer_list_fops);
|
||||
pe = proc_create("timer_list", 0444, NULL, &timer_list_fops);
|
||||
if (!pe)
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
|
@@ -2278,7 +2278,11 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
|
||||
read++;
|
||||
cnt--;
|
||||
|
||||
if (!(iter->flags & ~FTRACE_ITER_CONT)) {
|
||||
/*
|
||||
* If the parser haven't finished with the last write,
|
||||
* continue reading the user input without skipping spaces.
|
||||
*/
|
||||
if (!(iter->flags & FTRACE_ITER_CONT)) {
|
||||
/* skip white space */
|
||||
while (cnt && isspace(ch)) {
|
||||
ret = get_user(ch, ubuf++);
|
||||
@@ -2288,8 +2292,9 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
|
||||
cnt--;
|
||||
}
|
||||
|
||||
/* only spaces were written */
|
||||
if (isspace(ch)) {
|
||||
file->f_pos += read;
|
||||
*ppos += read;
|
||||
ret = read;
|
||||
goto out;
|
||||
}
|
||||
@@ -2319,12 +2324,12 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
|
||||
if (ret)
|
||||
goto out;
|
||||
iter->buffer_idx = 0;
|
||||
} else
|
||||
} else {
|
||||
iter->flags |= FTRACE_ITER_CONT;
|
||||
iter->buffer[iter->buffer_idx++] = ch;
|
||||
}
|
||||
|
||||
|
||||
file->f_pos += read;
|
||||
|
||||
*ppos += read;
|
||||
ret = read;
|
||||
out:
|
||||
mutex_unlock(&ftrace_regex_lock);
|
||||
|
@@ -3896,17 +3896,9 @@ trace_options_core_write(struct file *filp, const char __user *ubuf, size_t cnt,
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
switch (val) {
|
||||
case 0:
|
||||
trace_flags &= ~(1 << index);
|
||||
break;
|
||||
case 1:
|
||||
trace_flags |= 1 << index;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (val != 0 && val != 1)
|
||||
return -EINVAL;
|
||||
}
|
||||
set_tracer_flags(1 << index, val);
|
||||
|
||||
*ppos += cnt;
|
||||
|
||||
|
Reference in New Issue
Block a user