linux/arch/x86/events/amd/uncore.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2013 Advanced Micro Devices, Inc.
 *
 * Author: Jacob Shin <[email protected]>
 */

#include <linux/perf_event.h>
#include <linux/percpu.h>
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/cpu.h>
#include <linux/cpumask.h>
#include <linux/cpufeature.h>
#include <linux/smp.h>

#include <asm/perf_event.h>
#include <asm/msr.h>

#define NUM_COUNTERS_NB
#define NUM_COUNTERS_L2
#define NUM_COUNTERS_L3

#define RDPMC_BASE_NB
#define RDPMC_BASE_LLC

#define COUNTER_SHIFT
#define UNCORE_NAME_LEN
#define UNCORE_GROUP_MAX

#undef pr_fmt
#define pr_fmt(fmt)

static int pmu_version;

struct amd_uncore_ctx {};

struct amd_uncore_pmu {};

enum {};

amd_uncore_info;

struct amd_uncore {};

static struct amd_uncore uncores[UNCORE_TYPE_MAX];

static struct amd_uncore_pmu *event_to_amd_uncore_pmu(struct perf_event *event)
{}

static void amd_uncore_read(struct perf_event *event)
{}

static void amd_uncore_start(struct perf_event *event, int flags)
{}

static void amd_uncore_stop(struct perf_event *event, int flags)
{}

static int amd_uncore_add(struct perf_event *event, int flags)
{}

static void amd_uncore_del(struct perf_event *event, int flags)
{}

static int amd_uncore_event_init(struct perf_event *event)
{}

static umode_t
amd_f17h_uncore_is_visible(struct kobject *kobj, struct attribute *attr, int i)
{}

static umode_t
amd_f19h_uncore_is_visible(struct kobject *kobj, struct attribute *attr, int i)
{}

static ssize_t amd_uncore_attr_show_cpumask(struct device *dev,
					    struct device_attribute *attr,
					    char *buf)
{}
static DEVICE_ATTR(cpumask, S_IRUGO, amd_uncore_attr_show_cpumask, NULL);

static struct attribute *amd_uncore_attrs[] =;

static struct attribute_group amd_uncore_attr_group =;

#define DEFINE_UNCORE_FORMAT_ATTR(_var, _name, _format)

DEFINE_UNCORE_FORMAT_ATTR();
DEFINE_UNCORE_FORMAT_ATTR(); /* F17h+ DF */
DEFINE_UNCORE_FORMAT_ATTR();	   /* PerfMonV2 DF */
DEFINE_UNCORE_FORMAT_ATTR();		   /* F17h+ L3, PerfMonV2 UMC */
DEFINE_UNCORE_FORMAT_ATTR();
DEFINE_UNCORE_FORMAT_ATTR();	   /* PerfMonV2 DF */
DEFINE_UNCORE_FORMAT_ATTR();	   /* F19h L3 */
DEFINE_UNCORE_FORMAT_ATTR();	   /* F17h L3 */
DEFINE_UNCORE_FORMAT_ATTR();	   /* F17h L3 */
DEFINE_UNCORE_FORMAT_ATTR();	   /* F19h L3 */
DEFINE_UNCORE_FORMAT_ATTR();		   /* F19h L3 */
DEFINE_UNCORE_FORMAT_ATTR();		   /* F19h L3 */
DEFINE_UNCORE_FORMAT_ATTR();	   /* F19h L3 */
DEFINE_UNCORE_FORMAT_ATTR();		   /* PerfMonV2 UMC */

/* Common DF and NB attributes */
static struct attribute *amd_uncore_df_format_attr[] =;

/* Common L2 and L3 attributes */
static struct attribute *amd_uncore_l3_format_attr[] =;

/* Common UMC attributes */
static struct attribute *amd_uncore_umc_format_attr[] =;

/* F17h unique L3 attributes */
static struct attribute *amd_f17h_uncore_l3_format_attr[] =;

/* F19h unique L3 attributes */
static struct attribute *amd_f19h_uncore_l3_format_attr[] =;

static struct attribute_group amd_uncore_df_format_group =;

static struct attribute_group amd_uncore_l3_format_group =;

static struct attribute_group amd_f17h_uncore_l3_format_group =;

static struct attribute_group amd_f19h_uncore_l3_format_group =;

static struct attribute_group amd_uncore_umc_format_group =;

static const struct attribute_group *amd_uncore_df_attr_groups[] =;

static const struct attribute_group *amd_uncore_l3_attr_groups[] =;

static const struct attribute_group *amd_uncore_l3_attr_update[] =;

static const struct attribute_group *amd_uncore_umc_attr_groups[] =;

static __always_inline
int amd_uncore_ctx_cid(struct amd_uncore *uncore, unsigned int cpu)
{}

static __always_inline
int amd_uncore_ctx_gid(struct amd_uncore *uncore, unsigned int cpu)
{}

static __always_inline
int amd_uncore_ctx_num_pmcs(struct amd_uncore *uncore, unsigned int cpu)
{}

static void amd_uncore_ctx_free(struct amd_uncore *uncore, unsigned int cpu)
{}

static int amd_uncore_ctx_init(struct amd_uncore *uncore, unsigned int cpu)
{}

static void amd_uncore_ctx_move(struct amd_uncore *uncore, unsigned int cpu)
{}

static int amd_uncore_cpu_starting(unsigned int cpu)
{}

static int amd_uncore_cpu_online(unsigned int cpu)
{}

static int amd_uncore_cpu_down_prepare(unsigned int cpu)
{}

static int amd_uncore_cpu_dead(unsigned int cpu)
{}

static int amd_uncore_df_event_init(struct perf_event *event)
{}

static int amd_uncore_df_add(struct perf_event *event, int flags)
{}

static
void amd_uncore_df_ctx_scan(struct amd_uncore *uncore, unsigned int cpu)
{}

static
int amd_uncore_df_ctx_init(struct amd_uncore *uncore, unsigned int cpu)
{}

static int amd_uncore_l3_event_init(struct perf_event *event)
{}

static
void amd_uncore_l3_ctx_scan(struct amd_uncore *uncore, unsigned int cpu)
{}

static
int amd_uncore_l3_ctx_init(struct amd_uncore *uncore, unsigned int cpu)
{}

static int amd_uncore_umc_event_init(struct perf_event *event)
{}

static void amd_uncore_umc_start(struct perf_event *event, int flags)
{}

static
void amd_uncore_umc_ctx_scan(struct amd_uncore *uncore, unsigned int cpu)
{}

static
int amd_uncore_umc_ctx_init(struct amd_uncore *uncore, unsigned int cpu)
{}

static struct amd_uncore uncores[UNCORE_TYPE_MAX] =;

static int __init amd_uncore_init(void)
{}

static void __exit amd_uncore_exit(void)
{}

module_init();
module_exit(amd_uncore_exit);

MODULE_DESCRIPTION();
MODULE_LICENSE();