lkml.org 
[lkml]   [2010]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[rfc 3/3] perf, x86: P4 PMU -- export ABI part of event config to userspace
Due to tight 64 bit size of event config field (where we have to track
pretty lot of info during event lifetime) some bits are to be exported
via header into userspace.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: Lin Ming <ming.m.lin@intel.com>
CC: Stephane Eranian <eranian@google.com>
CC: Peter Zijlstra <peterz@infradead.org>
---
Note that I don't like much the idea to export anything into userspace
but it seems there is no other choise. So there is a minimum which should
be exported.

arch/x86/include/asm/Kbuild | 1 +
arch/x86/include/asm/perf_event_p4.h | 8 ++++++++
2 files changed, 9 insertions(+)
Index: linux-2.6.git/arch/x86/include/asm/Kbuild
=====================================================================
--- linux-2.6.git.orig/arch/x86/include/asm/Kbuild
+++ linux-2.6.git/arch/x86/include/asm/Kbuild
@@ -23,3 +23,4 @@ header-y += unistd_32.h
header-y += unistd_64.h
header-y += vm86.h
header-y += vsyscall.h
+header-y += perf_event_p4.h
Index: linux-2.6.git/arch/x86/include/asm/perf_event_p4.h
=====================================================================
--- linux-2.6.git.orig/arch/x86/include/asm/perf_event_p4.h
+++ linux-2.6.git/arch/x86/include/asm/perf_event_p4.h
@@ -5,6 +5,8 @@
#ifndef PERF_EVENT_P4_H
#define PERF_EVENT_P4_H

+#ifdef __KERNEL__
+
#include <linux/cpu.h>
#include <linux/bitops.h>

@@ -201,6 +203,8 @@ static inline u32 p4_default_escr_conf(i
return escr;
}

+#endif /* __KERNEL__ */
+
/*
* This are the events which should be used in "Event Select"
* field of ESCR register, they are like unique keys which allow
@@ -256,6 +260,8 @@ enum P4_EVENTS {
P4_EVENT_INSTR_COMPLETED,
};

+#ifdef __KERNEL__
+
#define P4_OPCODE(event) event##_OPCODE
#define P4_OPCODE_ESEL(opcode) ((opcode & 0x00ff) >> 0)
#define P4_OPCODE_EVNT(opcode) ((opcode & 0xff00) >> 8)
@@ -767,6 +773,8 @@ enum P4_ESCR_EMASKS {

#define p4_config_pebs_has(v, mask) (p4_config_unpack_pebs(v) & (mask))

+#endif /* __KERNEL__ */
+
enum P4_PEBS_METRIC {
P4_PEBS_METRIC__none,



\
 
 \ /
  Last update: 2010-11-23 23:51    [W:0.099 / U:0.168 seconds]
©2003-2014 Jasper Spaans. Advertise on this site