Intel(r) Performance Counter Monitor
client_bw.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2012-2013, Intel Corporation
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6 
7  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9  * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10 
11 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12 */
13 // written by Roman Dementiev
14 //
15 
16 #ifndef CPUCounters_CLIENTBW_H
17 #define CPUCounters_CLIENTBW_H
18 
24 #include "types.h"
25 
26 #ifdef _MSC_VER
27 #include "windows.h"
28 #include "winpmem\winpmem.h"
29 #else
30 #include <unistd.h>
31 #endif
32 
33 #define PCM_CLIENT_IMC_BAR_OFFSET (0x0048)
34 #define PCM_CLIENT_IMC_DRAM_IO_REQESTS (0x5048)
35 #define PCM_CLIENT_IMC_DRAM_DATA_READS (0x5050)
36 #define PCM_CLIENT_IMC_DRAM_DATA_WRITES (0x5054)
37 #define PCM_CLIENT_IMC_MMAP_SIZE (0x6000)
38 
39 
40 class ClientBW
41 {
42 #if defined(__linux__) || defined(__FreeBSD__)
43  int32 fd;
44  char * mmapAddr;
45 #endif
46 #ifdef __APPLE__
47  char * mmapAddr;
48 #endif
49 #ifdef _MSC_VER
50  WinPmem * pmem;
51  uint64 startAddr;
52  HANDLE Mutex;
53 #endif
54 
55 public:
56  ClientBW();
57 
58  uint64 getImcReads();
59  uint64 getImcWrites();
60  uint64 getIoRequests();
61 
62  ~ClientBW();
63 };
64 
65 
66 #endif
Internal type and constant definitions.
Definition: client_bw.h:40