op_x86_model.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /**
  2. * @file op_x86_model.h
  3. * interface to x86 model-specific MSR operations
  4. *
  5. * @remark Copyright 2002 OProfile authors
  6. * @remark Read the file COPYING
  7. *
  8. * @author Graydon Hoare
  9. */
  10. #ifndef OP_X86_MODEL_H
  11. #define OP_X86_MODEL_H
  12. struct op_saved_msr {
  13. unsigned int high;
  14. unsigned int low;
  15. };
  16. struct op_msr {
  17. unsigned long addr;
  18. struct op_saved_msr saved;
  19. struct op_saved_msr multiplex;
  20. };
  21. struct op_msrs {
  22. struct op_msr * counters;
  23. struct op_msr * controls;
  24. };
  25. struct pt_regs;
  26. /* The model vtable abstracts the differences between
  27. * various x86 CPU models' perfctr support.
  28. */
  29. struct op_x86_model_spec {
  30. int (*init)(struct oprofile_operations *ops);
  31. void (*exit)(void);
  32. unsigned int const num_hardware_counters;
  33. unsigned int const num_hardware_controls;
  34. unsigned int const num_counters;
  35. unsigned int const num_controls;
  36. void (*fill_in_addresses)(struct op_msrs * const msrs);
  37. void (*setup_ctrs)(struct op_msrs const * const msrs);
  38. int (*check_ctrs)(struct pt_regs * const regs,
  39. struct op_msrs const * const msrs);
  40. void (*start)(struct op_msrs const * const msrs);
  41. void (*stop)(struct op_msrs const * const msrs);
  42. void (*shutdown)(struct op_msrs const * const msrs);
  43. };
  44. extern struct op_x86_model_spec const op_ppro_spec;
  45. extern struct op_x86_model_spec const op_p4_spec;
  46. extern struct op_x86_model_spec const op_p4_ht2_spec;
  47. extern struct op_x86_model_spec const op_amd_spec;
  48. #endif /* OP_X86_MODEL_H */