Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ddbac98 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

Merge branch 'perfcounters-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'perfcounters-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf_counter: Start documenting HAVE_PERF_COUNTERS requirements
  perf_counter: Add forward/backward attribute ABI compatibility
  perf record: Explicity program a default counter
  perf_counter: Remove PERF_TYPE_RAW special casing
  perf_counter: PERF_TYPE_HW_CACHE is a hardware counter too
  powerpc, perf_counter: Fix performance counter event types
  perf_counter/x86: Add a quirk for Atom processors
  perf_counter tools: Remove one L1-data alias
parents 02a99ed6 018df72d
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -294,12 +294,12 @@ static void power7_disable_pmc(unsigned int pmc, u64 mmcr[])
}

static int power7_generic_events[] = {
	[PERF_COUNT_CPU_CYCLES] = 0x1e,
	[PERF_COUNT_INSTRUCTIONS] = 2,
	[PERF_COUNT_CACHE_REFERENCES] = 0xc880,		/* LD_REF_L1_LSU */
	[PERF_COUNT_CACHE_MISSES] = 0x400f0,		/* LD_MISS_L1 */
	[PERF_COUNT_BRANCH_INSTRUCTIONS] = 0x10068,	/* BRU_FIN */
	[PERF_COUNT_BRANCH_MISSES] = 0x400f6,		/* BR_MPRED */
	[PERF_COUNT_HW_CPU_CYCLES] = 0x1e,
	[PERF_COUNT_HW_INSTRUCTIONS] = 2,
	[PERF_COUNT_HW_CACHE_REFERENCES] = 0xc880,	/* LD_REF_L1_LSU*/
	[PERF_COUNT_HW_CACHE_MISSES] = 0x400f0,		/* LD_MISS_L1	*/
	[PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x10068,	/* BRU_FIN	*/
	[PERF_COUNT_HW_BRANCH_MISSES] = 0x400f6,	/* BR_MPRED	*/
};

#define C(x)	PERF_COUNT_HW_CACHE_##x
+7 −0
Original line number Diff line number Diff line
@@ -968,6 +968,13 @@ fixed_mode_idx(struct perf_counter *counter, struct hw_perf_counter *hwc)
	if (!x86_pmu.num_counters_fixed)
		return -1;

	/*
	 * Quirk, IA32_FIXED_CTRs do not work on current Atom processors:
	 */
	if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
					boot_cpu_data.x86_model == 28)
		return -1;

	event = hwc->config & ARCH_PERFMON_EVENT_MASK;

	if (unlikely(event == x86_pmu.event_map(PERF_COUNT_HW_INSTRUCTIONS)))
+17 −5
Original line number Diff line number Diff line
@@ -120,6 +120,8 @@ enum perf_counter_sample_format {
	PERF_SAMPLE_ID				= 1U << 6,
	PERF_SAMPLE_CPU				= 1U << 7,
	PERF_SAMPLE_PERIOD			= 1U << 8,

	PERF_SAMPLE_MAX = 1U << 9,		/* non-ABI */
};

/*
@@ -131,17 +133,26 @@ enum perf_counter_read_format {
	PERF_FORMAT_TOTAL_TIME_ENABLED		= 1U << 0,
	PERF_FORMAT_TOTAL_TIME_RUNNING		= 1U << 1,
	PERF_FORMAT_ID				= 1U << 2,

	PERF_FORMAT_MAX = 1U << 3, 		/* non-ABI */
};

#define PERF_ATTR_SIZE_VER0	64	/* sizeof first published struct */

/*
 * Hardware event to monitor via a performance monitoring counter:
 */
struct perf_counter_attr {

	/*
	 * Major type: hardware/software/tracepoint/etc.
	 */
	__u32			type;
	__u32			__reserved_1;

	/*
	 * Size of the attr structure, for fwd/bwd compat.
	 */
	__u32			size;

	/*
	 * Type specific configuration information.
@@ -168,12 +179,12 @@ struct perf_counter_attr {
				comm	       :  1, /* include comm data     */
				freq           :  1, /* use freq, not period  */

				__reserved_2   : 53;
				__reserved_1   : 53;

	__u32			wakeup_events;	/* wakeup every n events */
	__u32			__reserved_3;
	__u32			__reserved_2;

	__u64			__reserved_4;
	__u64			__reserved_3;
};

/*
@@ -621,7 +632,8 @@ extern int perf_counter_overflow(struct perf_counter *counter, int nmi,
static inline int is_software_counter(struct perf_counter *counter)
{
	return (counter->attr.type != PERF_TYPE_RAW) &&
		(counter->attr.type != PERF_TYPE_HARDWARE);
		(counter->attr.type != PERF_TYPE_HARDWARE) &&
		(counter->attr.type != PERF_TYPE_HW_CACHE);
}

extern void perf_swcounter_event(u32, u64, int, struct pt_regs *, u64);
+1 −1
Original line number Diff line number Diff line
@@ -758,6 +758,6 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[]);


asmlinkage long sys_perf_counter_open(
		const struct perf_counter_attr __user *attr_uptr,
		struct perf_counter_attr __user *attr_uptr,
		pid_t pid, int cpu, int group_fd, unsigned long flags);
#endif
+2 −0
Original line number Diff line number Diff line
@@ -936,6 +936,8 @@ config AIO

config HAVE_PERF_COUNTERS
	bool
	help
	  See tools/perf/design.txt for details.

menu "Performance Counters"

Loading