summaryrefslogtreecommitdiff
path: root/kern/perfmon.h
diff options
context:
space:
mode:
authorRemy Noel <mocramis@gmail.com>2018-01-20 11:41:39 +0100
committerRemy Noel <mocramis@gmail.com>2018-02-22 23:33:24 +0100
commit652168fe3d867eec17ac7fa318c8743d524ef40f (patch)
tree0d16e8f3f07c99f0f5b78c74794686651cde4aed /kern/perfmon.h
parente363294da50ad602791ceccae7182a7d799bf032 (diff)
perfmon: split pmu into amd and intel architectures.
pmu_driver handling is now perfmon's responsibility.
Diffstat (limited to 'kern/perfmon.h')
-rw-r--r--kern/perfmon.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/kern/perfmon.h b/kern/perfmon.h
index 89fdd3d..1ab24be 100644
--- a/kern/perfmon.h
+++ b/kern/perfmon.h
@@ -52,6 +52,21 @@
#define PERFMON_EF_MASK (PERFMON_EF_KERN | PERFMON_EF_USER)
/*
+ * Pmu operations.
+ *
+ * Set by calling perfmon_register_pmu_ops.
+ */
+struct perfmon_pmu_ops {
+ void (*info)(void);
+ int (*translate)(unsigned int *raw_event_idp, unsigned int event_id);
+ int (*alloc)(unsigned int *pmc_idp, unsigned int raw_event_id);
+ void (*free)(unsigned int pmc_id);
+ void (*start)(unsigned int pmc_id, unsigned int raw_event_id);
+ void (*stop)(unsigned int pmc_id);
+ uint64_t (*read)(unsigned int pmc_id);
+};
+
+/*
* Performance monitoring event.
*
* An event describes a single, well-defined state and records its
@@ -200,4 +215,17 @@ INIT_OP_DECLARE(perfmon_bootstrap);
*/
INIT_OP_DECLARE(perfmon_setup);
+/*
+ * Register an architecture-specific driver.
+ */
+int
+perfmon_pmu_register(struct perfmon_pmu_ops *driver);
+
+/*
+ * PMU init moduls
+ * - module fully initialized
+ */
+INIT_OP_DECLARE(pmu_intel_setup);
+INIT_OP_DECLARE(pmu_amd_setup);
+
#endif /* _KERN_PERFMON_H */