16 #ifndef CPUCounters_MSR_H
17 #define CPUCounters_MSR_H
30 #include <MSRAccessor.h>
39 static MSRAccessor* driver;
40 static int num_handles;
50 int32 read(uint64 msr_number, uint64 * value);
51 int32 write(uint64 msr_number, uint64 value);
52 int32 getCoreId() {
return cpu_id; }
54 int32 buildTopology(uint32 num_cores,
void*);
55 uint32 getNumInstances();
56 uint32 incrementNumInstances();
57 uint32 decrementNumInstances();
76 int32 read(uint64 msr_number, uint64 * value)
79 return pHandle->read(msr_number, value);
83 return sizeof(uint64);
86 int32 write(uint64 msr_number, uint64 value)
89 return pHandle->write(msr_number, value);
91 return sizeof(uint64);
96 return pHandle->getCoreId();
98 throw std::exception();
102 int32 buildTopology(uint32 num_cores,
void* p)
105 return pHandle->buildTopology(num_cores,p);
107 throw std::exception();
110 uint32 getNumInstances()
113 return pHandle->getNumInstances();
115 throw std::exception();
118 uint32 incrementNumInstances()
121 return pHandle->incrementNumInstances();
123 throw std::exception();
126 uint32 decrementNumInstances()
129 return pHandle->decrementNumInstances();
131 throw std::exception();
Internal type and constant definitions.