Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180561
b: refs/heads/master
c: 76212a8
h: refs/heads/master
i:
  180559: a3c059a
v: v3
  • Loading branch information
Linus Torvalds committed Feb 16, 2010
1 parent fdb3e26 commit 44e2f99
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e803e8b2628f3e9a42f45c5b7bb1f9821b08352c
refs/heads/master: 76212a840f6edc2b89865f09464f3bd90125896d
11 changes: 9 additions & 2 deletions trunk/arch/sh/kernel/ptrace_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,17 @@ void user_enable_single_step(struct task_struct *child)
struct pt_regs *regs = child->thread.uregs;

regs->sr |= SR_SSTEP; /* auto-resetting upon exception */

set_tsk_thread_flag(child, TIF_SINGLESTEP);
}

void user_disable_single_step(struct task_struct *child)
{
struct pt_regs *regs = child->thread.uregs;

regs->sr &= ~SR_SSTEP;

clear_tsk_thread_flag(child, TIF_SINGLESTEP);
}

static int genregs_get(struct task_struct *target,
Expand Down Expand Up @@ -454,15 +458,18 @@ asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs)

asmlinkage void do_syscall_trace_leave(struct pt_regs *regs)
{
int step;

if (unlikely(current->audit_context))
audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]),
regs->regs[9]);

if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
trace_sys_exit(regs, regs->regs[9]);

if (test_thread_flag(TIF_SYSCALL_TRACE))
tracehook_report_syscall_exit(regs, 0);
step = test_thread_flag(TIF_SINGLESTEP);
if (step || test_thread_flag(TIF_SYSCALL_TRACE))
tracehook_report_syscall_exit(regs, step);
}

/* Called with interrupts disabled */
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/sh/kernel/signal_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ static int do_signal(struct pt_regs *regs, sigset_t *oldset)
* clear the TS_RESTORE_SIGMASK flag.
*/
current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
tracehook_signal_handler(signr, &info, &ka, regs, 0);

tracehook_signal_handler(signr, &info, &ka, regs,
test_thread_flag(TIF_SINGLESTEP));
return 1;
}
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/hw_breakpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static inline int hw_breakpoint_type(struct perf_event *bp)
return bp->attr.bp_type;
}

static inline int hw_breakpoint_len(struct perf_event *bp)
static inline unsigned long hw_breakpoint_len(struct perf_event *bp)
{
return bp->attr.bp_len;
}
Expand Down
6 changes: 2 additions & 4 deletions trunk/include/linux/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,9 @@ struct perf_event_attr {
__u32 wakeup_watermark; /* bytes before wakeup */
};

__u32 __reserved_2;

__u64 bp_addr;
__u32 bp_type;
__u32 bp_len;
__u64 bp_addr;
__u64 bp_len;
};

/*
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/hw_breakpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ EXPORT_SYMBOL_GPL(register_user_hw_breakpoint);
int modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr)
{
u64 old_addr = bp->attr.bp_addr;
u64 old_len = bp->attr.bp_len;
int old_type = bp->attr.bp_type;
int old_len = bp->attr.bp_len;
int err = 0;

perf_event_disable(bp);
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -4580,7 +4580,7 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr,
if (attr->type >= PERF_TYPE_MAX)
return -EINVAL;

if (attr->__reserved_1 || attr->__reserved_2)
if (attr->__reserved_1)
return -EINVAL;

if (attr->sample_type & ~(PERF_SAMPLE_MAX-1))
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/trace/trace_kprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ static int create_trace_probe(int argc, char **argv)
return -EINVAL;
}
/* an address specified */
ret = strict_strtoul(&argv[0][2], 0, (unsigned long *)&addr);
ret = strict_strtoul(&argv[1][0], 0, (unsigned long *)&addr);
if (ret) {
pr_info("Failed to parse address.\n");
return ret;
Expand Down
24 changes: 24 additions & 0 deletions trunk/kernel/trace/trace_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ stack_max_size_write(struct file *filp, const char __user *ubuf,
unsigned long val, flags;
char buf[64];
int ret;
int cpu;

if (count >= sizeof(buf))
return -EINVAL;
Expand All @@ -171,9 +172,20 @@ stack_max_size_write(struct file *filp, const char __user *ubuf,
return ret;

local_irq_save(flags);

/*
* In case we trace inside arch_spin_lock() or after (NMI),
* we will cause circular lock, so we also need to increase
* the percpu trace_active here.
*/
cpu = smp_processor_id();
per_cpu(trace_active, cpu)++;

arch_spin_lock(&max_stack_lock);
*ptr = val;
arch_spin_unlock(&max_stack_lock);

per_cpu(trace_active, cpu)--;
local_irq_restore(flags);

return count;
Expand Down Expand Up @@ -206,7 +218,13 @@ t_next(struct seq_file *m, void *v, loff_t *pos)

static void *t_start(struct seq_file *m, loff_t *pos)
{
int cpu;

local_irq_disable();

cpu = smp_processor_id();
per_cpu(trace_active, cpu)++;

arch_spin_lock(&max_stack_lock);

if (*pos == 0)
Expand All @@ -217,7 +235,13 @@ static void *t_start(struct seq_file *m, loff_t *pos)

static void t_stop(struct seq_file *m, void *p)
{
int cpu;

arch_spin_unlock(&max_stack_lock);

cpu = smp_processor_id();
per_cpu(trace_active, cpu)--;

local_irq_enable();
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ static void print_mapped_keys(void)
fprintf(stdout, "\t[w] toggle display weighted/count[E]r. \t(%d)\n", display_weighted ? 1 : 0);

fprintf(stdout,
"\t[K] hide kernel_symbols symbols. \t(%s)\n",
"\t[K] hide kernel_symbols symbols. \t(%s)\n",
hide_kernel_symbols ? "yes" : "no");
fprintf(stdout,
"\t[U] hide user symbols. \t(%s)\n",
Expand Down
4 changes: 2 additions & 2 deletions trunk/tools/perf/util/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@ void thread__find_addr_location(struct thread *self,
al->thread = self;
al->addr = addr;

if (cpumode & PERF_RECORD_MISC_KERNEL) {
if (cpumode == PERF_RECORD_MISC_KERNEL) {
al->level = 'k';
mg = &session->kmaps;
} else if (cpumode & PERF_RECORD_MISC_USER)
} else if (cpumode == PERF_RECORD_MISC_USER)
al->level = '.';
else {
al->level = 'H';
Expand Down

0 comments on commit 44e2f99

Please sign in to comment.