summaryrefslogtreecommitdiff
path: root/kern/perfmon.h
diff options
context:
space:
mode:
authorRemy Noel <mocramis@gmail.com>2018-04-30 20:30:08 +0200
committerRemy Noel <mocramis@gmail.com>2018-05-03 13:08:30 +0200
commitc4ba76cc4f84a25b259e9089b5e49a6edc015f1d (patch)
tree2e8548cd533672cf517b0ae5df76bf2e449f3890 /kern/perfmon.h
parent70794059bfae7a538ee6b1ffe6f1604950ef83f2 (diff)
perfmon: register a pmu_driver in place of pmu_ops.
Replace pmu_get_width with a property. Prepare the default overfow handling.
Diffstat (limited to 'kern/perfmon.h')
-rw-r--r--kern/perfmon.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/kern/perfmon.h b/kern/perfmon.h
index b9a3882..cd7eb3a 100644
--- a/kern/perfmon.h
+++ b/kern/perfmon.h
@@ -65,11 +65,24 @@ struct perfmon_pmu_ops {
void (*stop)(unsigned int pmc_id);
uint64_t (*read)(unsigned int pmc_id);
void (*write)(unsigned int pmc_id, uint64_t value);
- uint8_t (*get_pmc_width)(void);
+ /* If set, of_max_ticks should be set to 0. */
void (*handle_of_intr)(void);
};
/*
+ * Pmu device description.
+ */
+struct perfmon_pmu_driver {
+ uint8_t pmc_width; /* width in bits of a pmc */
+ /*
+ * Maximum number of clock ticks between two overflow ckecks.
+ * Should be set to 0 if handle_of_intr is set.
+ */
+ uint64_t of_max_ticks;
+ struct perfmon_pmu_ops ops;
+};
+
+/*
* Performance monitoring event.
*
* An event describes a single, well-defined state and records its
@@ -226,7 +239,7 @@ void perfmon_of_intr(void);
/*
* Register an architecture-specific driver.
*/
-int perfmon_pmu_register(struct perfmon_pmu_ops *driver);
+int perfmon_pmu_register(struct perfmon_pmu_driver *driver);
/*
* Get the last value of given pmc.