|
@@ -257,6 +257,14 @@ static inline int uncore_num_counters(struct intel_uncore_box *box)
|
|
|
return box->pmu->type->num_counters;
|
|
|
}
|
|
|
|
|
|
+static inline void uncore_box_init(struct intel_uncore_box *box)
|
|
|
+{
|
|
|
+ if (!test_and_set_bit(UNCORE_BOX_FLAG_INITIATED, &box->flags)) {
|
|
|
+ if (box->pmu->type->ops->init_box)
|
|
|
+ box->pmu->type->ops->init_box(box);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
static inline void uncore_disable_box(struct intel_uncore_box *box)
|
|
|
{
|
|
|
if (box->pmu->type->ops->disable_box)
|
|
@@ -265,6 +273,8 @@ static inline void uncore_disable_box(struct intel_uncore_box *box)
|
|
|
|
|
|
static inline void uncore_enable_box(struct intel_uncore_box *box)
|
|
|
{
|
|
|
+ uncore_box_init(box);
|
|
|
+
|
|
|
if (box->pmu->type->ops->enable_box)
|
|
|
box->pmu->type->ops->enable_box(box);
|
|
|
}
|
|
@@ -287,14 +297,6 @@ static inline u64 uncore_read_counter(struct intel_uncore_box *box,
|
|
|
return box->pmu->type->ops->read_counter(box, event);
|
|
|
}
|
|
|
|
|
|
-static inline void uncore_box_init(struct intel_uncore_box *box)
|
|
|
-{
|
|
|
- if (!test_and_set_bit(UNCORE_BOX_FLAG_INITIATED, &box->flags)) {
|
|
|
- if (box->pmu->type->ops->init_box)
|
|
|
- box->pmu->type->ops->init_box(box);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
static inline bool uncore_box_is_fake(struct intel_uncore_box *box)
|
|
|
{
|
|
|
return (box->phys_id < 0);
|