#define pr_fmt(fmt) …
#include <linux/perf_event.h>
#include <linux/init.h>
#include <linux/cpumask.h>
#include <linux/slab.h>
#include <linux/amd-iommu.h>
#include "../perf_event.h"
#include "iommu.h"
#define GET_CSOURCE(x) …
#define GET_DEVID(x) …
#define GET_DOMID(x) …
#define GET_PASID(x) …
#define GET_DEVID_MASK(x) …
#define GET_DOMID_MASK(x) …
#define GET_PASID_MASK(x) …
#define IOMMU_NAME_SIZE …
struct perf_amd_iommu { … };
static LIST_HEAD(perf_amd_iommu_list);
PMU_FORMAT_ATTR(…);
PMU_FORMAT_ATTR(…);
PMU_FORMAT_ATTR(…);
PMU_FORMAT_ATTR(…);
PMU_FORMAT_ATTR(…);
PMU_FORMAT_ATTR(…);
PMU_FORMAT_ATTR(…);
static struct attribute *iommu_format_attrs[] = …;
static struct attribute_group amd_iommu_format_group = …;
static struct attribute_group amd_iommu_events_group = …;
struct amd_iommu_event_desc { … };
static ssize_t _iommu_event_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
#define AMD_IOMMU_EVENT_DESC(_name, _event) …
static struct amd_iommu_event_desc amd_iommu_v2_event_descs[] = …;
static cpumask_t iommu_cpumask;
static ssize_t _iommu_cpumask_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(cpumask, S_IRUGO, _iommu_cpumask_show, NULL);
static struct attribute *iommu_cpumask_attrs[] = …;
static struct attribute_group amd_iommu_cpumask_group = …;
static int get_next_avail_iommu_bnk_cntr(struct perf_event *event)
{ … }
static int clear_avail_iommu_bnk_cntr(struct perf_amd_iommu *perf_iommu,
u8 bank, u8 cntr)
{ … }
static int perf_iommu_event_init(struct perf_event *event)
{ … }
static inline struct amd_iommu *perf_event_2_iommu(struct perf_event *ev)
{ … }
static void perf_iommu_enable_event(struct perf_event *ev)
{ … }
static void perf_iommu_disable_event(struct perf_event *event)
{ … }
static void perf_iommu_start(struct perf_event *event, int flags)
{ … }
static void perf_iommu_read(struct perf_event *event)
{ … }
static void perf_iommu_stop(struct perf_event *event, int flags)
{ … }
static int perf_iommu_add(struct perf_event *event, int flags)
{ … }
static void perf_iommu_del(struct perf_event *event, int flags)
{ … }
static __init int _init_events_attrs(void)
{ … }
static const struct attribute_group *amd_iommu_attr_groups[] = …;
static const struct pmu iommu_pmu __initconst = …;
static __init int init_one_iommu(unsigned int idx)
{ … }
static __init int amd_iommu_pc_init(void)
{ … }
device_initcall(amd_iommu_pc_init);