aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-25 20:53:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-25 20:53:09 -0400
commit2a20b02c055a14eb60ac8da737d79dc940bb9ee0 (patch)
tree1cf09a5e13f8ed24bc66386c153969ad49f8f098 /kernel
parent839767e79e7bdf06f241a47701f0f64b8e2d3f61 (diff)
parent45daae575e08bbf7405c5a3633e956fa364d1b4f (diff)
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: perf, x86: Complain louder about BIOSen corrupting CPU/PMU state and continue perf, x86: P4 PMU - Read proper MSR register to catch unflagged overflows perf symbols: Look at .dynsym again if .symtab not found perf build-id: Add quirk to deal with perf.data file format breakage perf session: Pass evsel in event_ops->sample() perf: Better fit max unprivileged mlock pages for tools needs perf_events: Fix stale ->cgrp pointer in update_cgrp_time_from_cpuctx() perf top: Fix uninitialized 'counter' variable tracing: Fix set_ftrace_filter probe function display perf, x86: Fix Intel fixed counters base initialization
Diffstat (limited to 'kernel')
-rw-r--r--kernel/perf_event.c15
-rw-r--r--kernel/trace/ftrace.c3
2 files changed, 14 insertions, 4 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 3472bb1a070c..c75925c4d1e2 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -145,7 +145,8 @@ static struct srcu_struct pmus_srcu;
145 */ 145 */
146int sysctl_perf_event_paranoid __read_mostly = 1; 146int sysctl_perf_event_paranoid __read_mostly = 1;
147 147
148int sysctl_perf_event_mlock __read_mostly = 512; /* 'free' kb per user */ 148/* Minimum for 128 pages + 1 for the user control page */
149int sysctl_perf_event_mlock __read_mostly = 516; /* 'free' kb per user */
149 150
150/* 151/*
151 * max perf event sample rate 152 * max perf event sample rate
@@ -941,6 +942,7 @@ static void perf_group_attach(struct perf_event *event)
941static void 942static void
942list_del_event(struct perf_event *event, struct perf_event_context *ctx) 943list_del_event(struct perf_event *event, struct perf_event_context *ctx)
943{ 944{
945 struct perf_cpu_context *cpuctx;
944 /* 946 /*
945 * We can have double detach due to exit/hot-unplug + close. 947 * We can have double detach due to exit/hot-unplug + close.
946 */ 948 */
@@ -949,8 +951,17 @@ list_del_event(struct perf_event *event, struct perf_event_context *ctx)
949 951
950 event->attach_state &= ~PERF_ATTACH_CONTEXT; 952 event->attach_state &= ~PERF_ATTACH_CONTEXT;
951 953
952 if (is_cgroup_event(event)) 954 if (is_cgroup_event(event)) {
953 ctx->nr_cgroups--; 955 ctx->nr_cgroups--;
956 cpuctx = __get_cpu_context(ctx);
957 /*
958 * if there are no more cgroup events
959 * then cler cgrp to avoid stale pointer
960 * in update_cgrp_time_from_cpuctx()
961 */
962 if (!ctx->nr_cgroups)
963 cpuctx->cgrp = NULL;
964 }
954 965
955 ctx->nr_events--; 966 ctx->nr_events--;
956 if (event->attr.inherit_stat) 967 if (event->attr.inherit_stat)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 888b611897d3..c075f4ea6b94 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1467,7 +1467,7 @@ t_next(struct seq_file *m, void *v, loff_t *pos)
1467 return t_hash_next(m, pos); 1467 return t_hash_next(m, pos);
1468 1468
1469 (*pos)++; 1469 (*pos)++;
1470 iter->pos = *pos; 1470 iter->pos = iter->func_pos = *pos;
1471 1471
1472 if (iter->flags & FTRACE_ITER_PRINTALL) 1472 if (iter->flags & FTRACE_ITER_PRINTALL)
1473 return t_hash_start(m, pos); 1473 return t_hash_start(m, pos);
@@ -1502,7 +1502,6 @@ t_next(struct seq_file *m, void *v, loff_t *pos)
1502 if (!rec) 1502 if (!rec)
1503 return t_hash_start(m, pos); 1503 return t_hash_start(m, pos);
1504 1504
1505 iter->func_pos = *pos;
1506 iter->func = rec; 1505 iter->func = rec;
1507 1506
1508 return iter; 1507 return iter;