Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180556
b: refs/heads/master
c: e04984c
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Feb 16, 2010
1 parent 2ab1691 commit 542a1da
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 12 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: 4b505db9c4c72dbd2a8e66b8d681640101325af6
refs/heads/master: e04984c8394b17bab85c28956ada6aba81cdf746
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 542a1da

Please sign in to comment.