2005-04-17 00:20:36 +02:00
|
|
|
/**
|
|
|
|
* @file op_x86_model.h
|
|
|
|
* interface to x86 model-specific MSR operations
|
|
|
|
*
|
|
|
|
* @remark Copyright 2002 OProfile authors
|
|
|
|
* @remark Read the file COPYING
|
|
|
|
*
|
|
|
|
* @author Graydon Hoare
|
2009-05-25 15:10:32 +02:00
|
|
|
* @author Robert Richter <robert.richter@amd.com>
|
2005-04-17 00:20:36 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OP_X86_MODEL_H
|
|
|
|
#define OP_X86_MODEL_H
|
|
|
|
|
2009-05-25 15:10:32 +02:00
|
|
|
#include <asm/types.h>
|
2009-06-12 17:58:48 +02:00
|
|
|
#include <asm/perf_counter.h>
|
2009-05-25 15:05:50 +02:00
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
struct op_msr {
|
2009-06-03 19:09:27 +02:00
|
|
|
unsigned long addr;
|
|
|
|
u64 saved;
|
2005-04-17 00:20:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct op_msrs {
|
2008-09-05 17:12:36 +02:00
|
|
|
struct op_msr *counters;
|
|
|
|
struct op_msr *controls;
|
2009-07-08 13:49:38 +02:00
|
|
|
struct op_msr *multiplex;
|
2005-04-17 00:20:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct pt_regs;
|
|
|
|
|
2009-05-25 15:10:32 +02:00
|
|
|
struct oprofile_operations;
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
/* The model vtable abstracts the differences between
|
2007-10-20 01:13:56 +02:00
|
|
|
* various x86 CPU models' perfctr support.
|
2005-04-17 00:20:36 +02:00
|
|
|
*/
|
|
|
|
struct op_x86_model_spec {
|
2009-05-28 02:12:36 +02:00
|
|
|
unsigned int num_counters;
|
|
|
|
unsigned int num_controls;
|
2009-07-08 13:49:38 +02:00
|
|
|
unsigned int num_virt_counters;
|
2009-05-25 15:10:32 +02:00
|
|
|
u64 reserved;
|
|
|
|
u16 event_mask;
|
2009-05-28 02:12:36 +02:00
|
|
|
int (*init)(struct oprofile_operations *ops);
|
|
|
|
void (*exit)(void);
|
|
|
|
void (*fill_in_addresses)(struct op_msrs * const msrs);
|
2009-05-25 19:31:44 +02:00
|
|
|
void (*setup_ctrs)(struct op_x86_model_spec const *model,
|
|
|
|
struct op_msrs const * const msrs);
|
2009-05-28 02:12:36 +02:00
|
|
|
int (*check_ctrs)(struct pt_regs * const regs,
|
|
|
|
struct op_msrs const * const msrs);
|
|
|
|
void (*start)(struct op_msrs const * const msrs);
|
|
|
|
void (*stop)(struct op_msrs const * const msrs);
|
|
|
|
void (*shutdown)(struct op_msrs const * const msrs);
|
2009-07-08 13:49:38 +02:00
|
|
|
#ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX
|
|
|
|
void (*switch_ctrl)(struct op_x86_model_spec const *model,
|
|
|
|
struct op_msrs const * const msrs);
|
|
|
|
#endif
|
2005-04-17 00:20:36 +02:00
|
|
|
};
|
|
|
|
|
2009-05-25 15:10:32 +02:00
|
|
|
struct op_counter_config;
|
|
|
|
|
|
|
|
extern u64 op_x86_get_ctrl(struct op_x86_model_spec const *model,
|
|
|
|
struct op_counter_config *counter_config);
|
2009-07-16 13:04:43 +02:00
|
|
|
extern int op_x86_phys_to_virt(int phys);
|
2009-05-25 15:10:32 +02:00
|
|
|
|
2009-07-09 15:12:35 +02:00
|
|
|
extern struct op_x86_model_spec op_ppro_spec;
|
|
|
|
extern struct op_x86_model_spec op_p4_spec;
|
|
|
|
extern struct op_x86_model_spec op_p4_ht2_spec;
|
|
|
|
extern struct op_x86_model_spec op_amd_spec;
|
2008-08-18 14:50:31 +02:00
|
|
|
extern struct op_x86_model_spec op_arch_perfmon_spec;
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
#endif /* OP_X86_MODEL_H */
|