s390/perf: remove perf_release/reserver_sampling functions
Now that the oprofile sampling code is gone there is only one user of the sampling facility left. Therefore the reserve and release functions can be removed. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Reviewed-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
93dd49d002
commit
2764196f45
@ -86,16 +86,4 @@ struct sf_raw_sample {
|
|||||||
u8 padding[]; /* Padding to next multiple of 8 */
|
u8 padding[]; /* Padding to next multiple of 8 */
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
/* Perf hardware reserve and release functions */
|
|
||||||
#ifdef CONFIG_PERF_EVENTS
|
|
||||||
int perf_reserve_sampling(void);
|
|
||||||
void perf_release_sampling(void);
|
|
||||||
#else /* CONFIG_PERF_EVENTS */
|
|
||||||
static inline int perf_reserve_sampling(void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
static inline void perf_release_sampling(void) {}
|
|
||||||
#endif /* CONFIG_PERF_EVENTS */
|
|
||||||
|
|
||||||
#endif /* _ASM_S390_PERF_EVENT_H */
|
#endif /* _ASM_S390_PERF_EVENT_H */
|
||||||
|
@ -601,17 +601,12 @@ static void release_pmc_hardware(void)
|
|||||||
|
|
||||||
irq_subclass_unregister(IRQ_SUBCLASS_MEASUREMENT_ALERT);
|
irq_subclass_unregister(IRQ_SUBCLASS_MEASUREMENT_ALERT);
|
||||||
on_each_cpu(setup_pmc_cpu, &flags, 1);
|
on_each_cpu(setup_pmc_cpu, &flags, 1);
|
||||||
perf_release_sampling();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int reserve_pmc_hardware(void)
|
static int reserve_pmc_hardware(void)
|
||||||
{
|
{
|
||||||
int flags = PMC_INIT;
|
int flags = PMC_INIT;
|
||||||
int err;
|
|
||||||
|
|
||||||
err = perf_reserve_sampling();
|
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
on_each_cpu(setup_pmc_cpu, &flags, 1);
|
on_each_cpu(setup_pmc_cpu, &flags, 1);
|
||||||
if (flags & PMC_FAILURE) {
|
if (flags & PMC_FAILURE) {
|
||||||
release_pmc_hardware();
|
release_pmc_hardware();
|
||||||
|
@ -248,33 +248,3 @@ ssize_t cpumf_events_sysfs_show(struct device *dev,
|
|||||||
return sprintf(page, "event=0x%04llx,name=%s\n",
|
return sprintf(page, "event=0x%04llx,name=%s\n",
|
||||||
pmu_attr->id, attr->attr.name);
|
pmu_attr->id, attr->attr.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reserve/release functions for sharing perf hardware */
|
|
||||||
static DEFINE_SPINLOCK(perf_hw_owner_lock);
|
|
||||||
static void *perf_sampling_owner;
|
|
||||||
|
|
||||||
int perf_reserve_sampling(void)
|
|
||||||
{
|
|
||||||
int err;
|
|
||||||
|
|
||||||
err = 0;
|
|
||||||
spin_lock(&perf_hw_owner_lock);
|
|
||||||
if (perf_sampling_owner) {
|
|
||||||
pr_warn("The sampling facility is already reserved by %p\n",
|
|
||||||
perf_sampling_owner);
|
|
||||||
err = -EBUSY;
|
|
||||||
} else
|
|
||||||
perf_sampling_owner = __builtin_return_address(0);
|
|
||||||
spin_unlock(&perf_hw_owner_lock);
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(perf_reserve_sampling);
|
|
||||||
|
|
||||||
void perf_release_sampling(void)
|
|
||||||
{
|
|
||||||
spin_lock(&perf_hw_owner_lock);
|
|
||||||
WARN_ON(!perf_sampling_owner);
|
|
||||||
perf_sampling_owner = NULL;
|
|
||||||
spin_unlock(&perf_hw_owner_lock);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(perf_release_sampling);
|
|
||||||
|
Loading…
Reference in New Issue
Block a user