~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/x86/oprofile/op_x86_model.h

Version: ~ [ linux-5.10-rc5 ] ~ [ linux-5.9.10 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.79 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.159 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.208 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.245 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.245 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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  * @author Robert Richter <robert.richter@amd.com>
 10  */
 11 
 12 #ifndef OP_X86_MODEL_H
 13 #define OP_X86_MODEL_H
 14 
 15 #include <asm/types.h>
 16 #include <asm/perf_event.h>
 17 
 18 struct op_msr {
 19         unsigned long   addr;
 20         u64             saved;
 21 };
 22 
 23 struct op_msrs {
 24         struct op_msr *counters;
 25         struct op_msr *controls;
 26         struct op_msr *multiplex;
 27 };
 28 
 29 struct pt_regs;
 30 
 31 struct oprofile_operations;
 32 
 33 /* The model vtable abstracts the differences between
 34  * various x86 CPU models' perfctr support.
 35  */
 36 struct op_x86_model_spec {
 37         unsigned int    num_counters;
 38         unsigned int    num_controls;
 39         unsigned int    num_virt_counters;
 40         u64             reserved;
 41         u16             event_mask;
 42         int             (*init)(struct oprofile_operations *ops);
 43         int             (*fill_in_addresses)(struct op_msrs * const msrs);
 44         void            (*setup_ctrs)(struct op_x86_model_spec const *model,
 45                                       struct op_msrs const * const msrs);
 46         int             (*check_ctrs)(struct pt_regs * const regs,
 47                                       struct op_msrs const * const msrs);
 48         void            (*start)(struct op_msrs const * const msrs);
 49         void            (*stop)(struct op_msrs const * const msrs);
 50         void            (*shutdown)(struct op_msrs const * const msrs);
 51 #ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX
 52         void            (*switch_ctrl)(struct op_x86_model_spec const *model,
 53                                        struct op_msrs const * const msrs);
 54 #endif
 55 };
 56 
 57 struct op_counter_config;
 58 
 59 static inline void op_x86_warn_in_use(int counter)
 60 {
 61         /*
 62          * The warning indicates an already running counter. If
 63          * oprofile doesn't collect data, then try using a different
 64          * performance counter on your platform to monitor the desired
 65          * event. Delete counter #%d from the desired event by editing
 66          * the /usr/share/oprofile/%s/<cpu>/events file. If the event
 67          * cannot be monitored by any other counter, contact your
 68          * hardware or BIOS vendor.
 69          */
 70         pr_warning("oprofile: counter #%d on cpu #%d may already be used\n",
 71                    counter, smp_processor_id());
 72 }
 73 
 74 static inline void op_x86_warn_reserved(int counter)
 75 {
 76         pr_warning("oprofile: counter #%d is already reserved\n", counter);
 77 }
 78 
 79 extern u64 op_x86_get_ctrl(struct op_x86_model_spec const *model,
 80                            struct op_counter_config *counter_config);
 81 extern int op_x86_phys_to_virt(int phys);
 82 extern int op_x86_virt_to_phys(int virt);
 83 
 84 extern struct op_x86_model_spec op_ppro_spec;
 85 extern struct op_x86_model_spec op_p4_spec;
 86 extern struct op_x86_model_spec op_p4_ht2_spec;
 87 extern struct op_x86_model_spec op_amd_spec;
 88 extern struct op_x86_model_spec op_arch_perfmon_spec;
 89 
 90 #endif /* OP_X86_MODEL_H */
 91 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp