Commit 2a20b02c authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'perf-fixes-for-linus' of...

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
parents 839767e7 45daae57
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -500,12 +500,17 @@ static bool check_hw_exists(void)
	return true;

bios_fail:
	printk(KERN_CONT "Broken BIOS detected, using software events only.\n");
	/*
	 * We still allow the PMU driver to operate:
	 */
	printk(KERN_CONT "Broken BIOS detected, complain to your hardware vendor.\n");
	printk(KERN_ERR FW_BUG "the BIOS has corrupted hw-PMU resources (MSR %x is %Lx)\n", reg, val);
	return false;

	return true;

msr_fail:
	printk(KERN_CONT "Broken PMU hardware detected, using software events only.\n");

	return false;
}

@@ -912,7 +917,7 @@ static inline void x86_assign_hw_event(struct perf_event *event,
		hwc->event_base	= 0;
	} else if (hwc->idx >= X86_PMC_IDX_FIXED) {
		hwc->config_base = MSR_ARCH_PERFMON_FIXED_CTR_CTRL;
		hwc->event_base = MSR_ARCH_PERFMON_FIXED_CTR0;
		hwc->event_base = MSR_ARCH_PERFMON_FIXED_CTR0 + (hwc->idx - X86_PMC_IDX_FIXED);
	} else {
		hwc->config_base = x86_pmu_config_addr(hwc->idx);
		hwc->event_base  = x86_pmu_event_addr(hwc->idx);
+1 −0
Original line number Diff line number Diff line
@@ -777,6 +777,7 @@ static inline int p4_pmu_clear_cccr_ovf(struct hw_perf_event *hwc)
	 * the counter has reached zero value and continued counting before
	 * real NMI signal was received:
	 */
	rdmsrl(hwc->event_base, v);
	if (!(v & ARCH_P4_UNFLAGGED_BIT))
		return 1;

+0 −2
Original line number Diff line number Diff line
@@ -938,9 +938,7 @@ struct perf_cpu_context {
	struct list_head		rotation_list;
	int				jiffies_interval;
	struct pmu			*active_pmu;
#ifdef CONFIG_CGROUP_PERF
	struct perf_cgroup		*cgrp;
#endif
};

struct perf_output_handle {
+13 −2
Original line number Diff line number Diff line
@@ -145,7 +145,8 @@ static struct srcu_struct pmus_srcu;
 */
int sysctl_perf_event_paranoid __read_mostly = 1;

int sysctl_perf_event_mlock __read_mostly = 512; /* 'free' kb per user */
/* Minimum for 128 pages + 1 for the user control page */
int sysctl_perf_event_mlock __read_mostly = 516; /* 'free' kb per user */

/*
 * max perf event sample rate
@@ -941,6 +942,7 @@ static void perf_group_attach(struct perf_event *event)
static void
list_del_event(struct perf_event *event, struct perf_event_context *ctx)
{
	struct perf_cpu_context *cpuctx;
	/*
	 * We can have double detach due to exit/hot-unplug + close.
	 */
@@ -949,8 +951,17 @@ list_del_event(struct perf_event *event, struct perf_event_context *ctx)

	event->attach_state &= ~PERF_ATTACH_CONTEXT;

	if (is_cgroup_event(event))
	if (is_cgroup_event(event)) {
		ctx->nr_cgroups--;
		cpuctx = __get_cpu_context(ctx);
		/*
		 * if there are no more cgroup events
		 * then cler cgrp to avoid stale pointer
		 * in update_cgrp_time_from_cpuctx()
		 */
		if (!ctx->nr_cgroups)
			cpuctx->cgrp = NULL;
	}

	ctx->nr_events--;
	if (event->attr.inherit_stat)
+1 −2
Original line number Diff line number Diff line
@@ -1467,7 +1467,7 @@ t_next(struct seq_file *m, void *v, loff_t *pos)
		return t_hash_next(m, pos);

	(*pos)++;
	iter->pos = *pos;
	iter->pos = iter->func_pos = *pos;

	if (iter->flags & FTRACE_ITER_PRINTALL)
		return t_hash_start(m, pos);
@@ -1502,7 +1502,6 @@ t_next(struct seq_file *m, void *v, loff_t *pos)
	if (!rec)
		return t_hash_start(m, pos);

	iter->func_pos = *pos;
	iter->func = rec;

	return iter;
Loading