Skip to content

Commit 7b5b04f

Browse files
committed
Add initial SRF support
Co-authored-by: Alexander Antonov <[email protected]> Co-authored-by: Dementiev, Roman <[email protected]> Co-authored-by: Gang Deng <[email protected]> Co-authored-by: Pavithran Pandiyan <[email protected]> Change-Id: Ie80bbe9195cef7d928269ea58c1632592cc43716
1 parent e51bae8 commit 7b5b04f

24 files changed

+2096
-342
lines changed

scripts/bhs-die-stat.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
3+
4+
echo "Intel(r) Performance Counter Monitor"
5+
echo "Birch Stream Die Statistics Utility"
6+
echo
7+
8+
# Run the pcm-tpmi command and store the output
9+
output=$(pcm-tpmi 2 0x10 -d)
10+
11+
# Use a while loop to read each line of the output
12+
echo "$output" | while read -r line; do
13+
# Check if the line contains "Read value"
14+
if [[ $line =~ Read\ value\ ([0-9]+)\ from\ TPMI\ ID\ 2@16\ for\ entry\ ([0-9]+)\ in\ instance\ ([0-9]+) ]]; then
15+
# Extract the value using BASH_REMATCH
16+
value=${BASH_REMATCH[1]}
17+
die=${BASH_REMATCH[2]}
18+
socket=${BASH_REMATCH[3]}
19+
20+
freq=$(( (value & 0x7F) * 100 ))
21+
compute=$(( (value >> 23) & 1 ))
22+
llc=$(( (value >> 24) & 1 ))
23+
memory=$(( (value >> 25) & 1 ))
24+
io=$(( (value >> 26) & 1 ))
25+
26+
die_type=""
27+
if [ "$compute" -ne 0 ]; then
28+
die_type="compute/"
29+
fi
30+
if [ "$llc" -ne 0 ]; then
31+
die_type="${die_type}LLC/"
32+
fi
33+
if [ "$memory" -ne 0 ]; then
34+
die_type="${die_type}memory/"
35+
fi
36+
if [ "$io" -ne 0 ]; then
37+
die_type="${die_type}IO"
38+
fi
39+
die_type="${die_type%"${die_type##*[!\/]}"}"
40+
str="Socket $socket die $die ($die_type) uncore frequency"
41+
printf "%-60s: %d MHz\n" "$str" "$freq"
42+
fi
43+
done
44+

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# All pcm-* executables
66
set(PROJECT_NAMES pcm pcm-numa pcm-latency pcm-power pcm-msr pcm-memory pcm-tsx pcm-pcie pcm-core pcm-iio pcm-lspci pcm-pcicfg pcm-mmio pcm-tpmi pcm-raw pcm-accel)
77

8-
file(GLOB COMMON_SOURCES pcm-accel-common.cpp msr.cpp cpucounters.cpp pci.cpp mmio.cpp bw.cpp utils.cpp topology.cpp debug.cpp threadpool.cpp uncore_pmu_discovery.cpp)
8+
file(GLOB COMMON_SOURCES pcm-accel-common.cpp msr.cpp cpucounters.cpp pci.cpp mmio.cpp tpmi.cpp bw.cpp utils.cpp topology.cpp debug.cpp threadpool.cpp uncore_pmu_discovery.cpp)
99

1010
if (APPLE)
1111
file(GLOB UNUX_SOURCES dashboard.cpp)
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
{
2+
"core" : {
3+
"programmable" : {
4+
"EventCode": {"Config": 0, "Position": 0, "Width": 8},
5+
"UMask": {"Config": 0, "Position": 8, "Width": 8},
6+
"User": {"Config": 0, "Position": 16, "Width": 1, "DefaultValue": 1},
7+
"OS": {"Config": 0, "Position": 17, "Width": 1, "DefaultValue": 1},
8+
"EdgeDetect": {"Config": 0, "Position": 18, "Width": 1},
9+
"PinControl": {"Config": 0, "Position": 19, "Width": 1, "DefaultValue": 0},
10+
"APICInt": {"Config": 0, "Position": 20, "Width": 1, "DefaultValue": 0},
11+
"Enable": {"Config": 0, "Position": 22, "Width": 1, "DefaultValue": 1},
12+
"Invert": {"Config": 0, "Position": 23, "Width": 1},
13+
"CounterMask": {"Config": 0, "Position": 24, "Width": 8},
14+
"MSRIndex": {
15+
"0x1a6" : {"Config": 1, "Position": 0, "Width": 64},
16+
"0x1a7" : {"Config": 2, "Position": 0, "Width": 64},
17+
"0x3f6" : {"Config": 3, "Position": 0, "Width": 64},
18+
"0x3f7" : {"Config": 4, "Position": 0, "Width": 64}
19+
}
20+
},
21+
"fixed0" : {
22+
"OS": {"Config": 0, "Position": 0, "Width": 1, "DefaultValue": 1},
23+
"User": {"Config": 0, "Position": 1, "Width": 1, "DefaultValue": 1},
24+
"EnablePMI": {"Config": 0, "Position": 3, "Width": 1, "DefaultValue": 0},
25+
"EventCode": {"Config": 0, "Position": -1, "__comment": "position=-1 means field ignored"},
26+
"UMask": {"Config": 0, "Position": -1, "__comment": "position=-1 means field ignored"},
27+
"EdgeDetect": {"Config": 0, "Position": -1, "__comment": "position=-1 means field ignored"},
28+
"Invert": {"Config": 0, "Position": -1, "__comment": "position=-1 means field ignored"},
29+
"CounterMask": {"Config": 0, "Position": -1, "__comment": "position=-1 means field ignored"}
30+
},
31+
"fixed1" : {
32+
"OS": {"Config": 0, "Position": 4, "Width": 1, "DefaultValue": 1},
33+
"User": {"Config": 0, "Position": 5, "Width": 1, "DefaultValue": 1},
34+
"EnablePMI": {"Config": 0, "Position": 7, "Width": 1, "DefaultValue": 0},
35+
"EventCode": {"Config": 0, "Position": -1, "__comment": "position=-1 means field ignored"},
36+
"UMask": {"Config": 0, "Position": -1, "__comment": "position=-1 means field ignored"},
37+
"EdgeDetect": {"Config": 0, "Position": -1, "__comment": "position=-1 means field ignored"},
38+
"Invert": {"Config": 0, "Position": -1, "__comment": "position=-1 means field ignored"},
39+
"CounterMask": {"Config": 0, "Position": -1, "__comment": "position=-1 means field ignored"}
40+
},
41+
"fixed2" : {
42+
"OS": {"Config": 0, "Position": 8, "Width": 1, "DefaultValue": 1},
43+
"User": {"Config": 0, "Position": 9, "Width": 1, "DefaultValue": 1},
44+
"EnablePMI": {"Config": 0, "Position": 11, "Width": 1, "DefaultValue": 0},
45+
"EventCode": {"Config": 0, "Position": -1, "__comment": "position=-1 means field ignored"},
46+
"UMask": {"Config": 0, "Position": -1, "__comment": "position=-1 means field ignored"},
47+
"EdgeDetect": {"Config": 0, "Position": -1, "__comment": "position=-1 means field ignored"},
48+
"Invert": {"Config": 0, "Position": -1, "__comment": "position=-1 means field ignored"},
49+
"CounterMask": {"Config": 0, "Position": -1, "__comment": "position=-1 means field ignored"}
50+
}
51+
},
52+
"cha" : {
53+
"programmable" : {
54+
"EventCode": {"Config": 0, "Position": 0, "Width": 8},
55+
"UMask": {"Config": 0, "Position": 8, "Width": 8},
56+
"TIDEnable": {"Config": 0, "Position": 16, "Width": 1, "DefaultValue": 0},
57+
"EdgeDetect": {"Config": 0, "Position": 18, "Width": 1, "DefaultValue": 0},
58+
"Threshold": {"Config": 0, "Position": 24, "Width": 8, "DefaultValue": 0},
59+
"UMaskExt": {"Config": 0, "Position": 32, "Width": 26},
60+
"TID": {"Config": 1, "Position": 0, "Width": 10, "DefaultValue": 0}
61+
}
62+
},
63+
"imc" : {
64+
"programmable" : {
65+
"EventCode": {"Config": 0, "Position": 0, "Width": 8},
66+
"UMask": {"Config": 0, "Position": 8, "Width": 8},
67+
"EdgeDetect": {"Config": 0, "Position": 18, "Width": 1, "DefaultValue": 0},
68+
"Threshold": {"Config": 0, "Position": 24, "Width": 8, "DefaultValue": 0}
69+
}
70+
},
71+
"xpi" : {
72+
"__comment" : "this is for UPI LL and QPI LL uncore PMUs",
73+
"programmable" : {
74+
"EventCode": {"Config": 0, "Position": 0, "Width": 8},
75+
"UMask": {"Config": 0, "Position": 8, "Width": 8},
76+
"EdgeDetect": {"Config": 0, "Position": 18, "Width": 1, "DefaultValue": 0},
77+
"Threshold": {"Config": 0, "Position": 24, "Width": 8, "DefaultValue": 0},
78+
"UMaskExt": {"Config": 0, "Position": 32, "Width": 24}
79+
}
80+
},
81+
"m2m" : {
82+
"programmable" : {
83+
"EventCode": {"Config": 0, "Position": 0, "Width": 8},
84+
"UMask": {"Config": 0, "Position": 8, "Width": 8},
85+
"EdgeDetect": {"Config": 0, "Position": 18, "Width": 1, "DefaultValue": 0},
86+
"Threshold": {"Config": 0, "Position": 24, "Width": 8, "DefaultValue": 0},
87+
"UMaskExt": {"Config": 0, "Position": 32, "Width": 8}
88+
}
89+
},
90+
"m3upi" : {
91+
"programmable" : {
92+
"EventCode": {"Config": 0, "Position": 0, "Width": 8},
93+
"UMask": {"Config": 0, "Position": 8, "Width": 8},
94+
"EdgeDetect": {"Config": 0, "Position": 18, "Width": 1, "DefaultValue": 0},
95+
"Threshold": {"Config": 0, "Position": 24, "Width": 8, "DefaultValue": 0}
96+
}
97+
},
98+
"mdf" : {
99+
"programmable" : {
100+
"EventCode": {"Config": 0, "Position": 0, "Width": 8},
101+
"UMask": {"Config": 0, "Position": 8, "Width": 8},
102+
"EdgeDetect": {"Config": 0, "Position": 18, "Width": 1, "DefaultValue": 0},
103+
"Threshold": {"Config": 0, "Position": 24, "Width": 8, "DefaultValue": 0}
104+
}
105+
},
106+
"irp" : {
107+
"programmable" : {
108+
"EventCode": {"Config": 0, "Position": 0, "Width": 8},
109+
"UMask": {"Config": 0, "Position": 8, "Width": 8},
110+
"EdgeDetect": {"Config": 0, "Position": 18, "Width": 1, "DefaultValue": 0},
111+
"Threshold": {"Config": 0, "Position": 24, "Width": 8, "DefaultValue": 0}
112+
}
113+
},
114+
"pcu" : {
115+
"programmable" : {
116+
"EventCode": {"Config": 0, "Position": 0, "Width": 8},
117+
"UMask": {"Config": 0, "Position": 8, "Width": 8},
118+
"EdgeDetect": {"Config": 0, "Position": 18, "Width": 1, "DefaultValue": 0}
119+
}
120+
},
121+
"pciex8" : {
122+
"programmable" : {
123+
"EventCode": {"Config": 0, "Position": 0, "Width": 8},
124+
"UMask": {"Config": 0, "Position": 8, "Width": 8},
125+
"EdgeDetect": {"Config": 0, "Position": 18, "Width": 1, "DefaultValue": 0}
126+
}
127+
},
128+
"pciex16" : {
129+
"programmable" : {
130+
"EventCode": {"Config": 0, "Position": 0, "Width": 8},
131+
"UMask": {"Config": 0, "Position": 8, "Width": 8},
132+
"EdgeDetect": {"Config": 0, "Position": 18, "Width": 1, "DefaultValue": 0}
133+
}
134+
},
135+
"iio" : {
136+
"programmable" : {
137+
"EventCode": {"Config": 0, "Position": 0, "Width": 8},
138+
"UMask": {"Config": 0, "Position": 8, "Width": 8},
139+
"EdgeDetect": {"Config": 0, "Position": 18, "Width": 1, "DefaultValue": 0},
140+
"Threshold": {"Config": 0, "Position": 24, "Width": 12, "DefaultValue": 0},
141+
"PortMask": {"Config": 0, "Position": 36, "Width": 12},
142+
"FCMask": {"Config": 0, "Position": 48, "Width": 3}
143+
}
144+
}
145+
}

src/client/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ int main(int argc, char * argv[])
281281
printTitle("PMM Memory Mode hit rate p/Sock. ");
282282
for (PCMDaemon::uint32 i = 0; i < counters.system.numOfOnlineSockets; ++i)
283283
{
284-
std::cout << std::setprecision(coutPrecision) << counters.memory.sockets[i].pmmMemoryModeHitRate << " ";
284+
std::cout << std::setprecision(coutPrecision) << counters.memory.sockets[i].memoryModeHitRate << " ";
285285
}
286286
std::cout << "\n";
287287
}

0 commit comments

Comments
 (0)