diff options
Diffstat (limited to 'kern/perfmon.h')
-rw-r--r-- | kern/perfmon.h | 17 |
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. |