Skip to content

Commit 95470d2

Browse files
committed
remove hacks to handle /pcm/resctrl and unessesary out-of-date files
1 parent 2375435 commit 95470d2

File tree

7 files changed

+17
-112
lines changed

7 files changed

+17
-112
lines changed

KUBERNETES.md

Lines changed: 0 additions & 92 deletions
This file was deleted.

deployment/pcm/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,6 @@ More information here: https://kubernetes.io/docs/tutorials/security/ns-level-ps
104104
| perf-topdown | /sys/bus/event_source/devices/cpu/events | | yes | cpucounters.cpp:perfSupportsTopDown() | sysMount (TODO: conflicts with sys/fs) |
105105
| RDT | uses "msr" or "resctrl" interface | PCM_NO_RDT | 0 / 0 | cpucounters.cpp:isRDTDisabled()/QOSMetricAvailable() | PCM_NO_RDT |
106106
| resctrl | RW: /sys/fs/resctrl | PCM_USE_RESCTRL | 0 / 0 | resctrl.cpp | resctrlHostMount |
107-
| | Notes: | | | | |
108-
| | * privileged "inside" mount or RW bind mount | | | | |
109-
| | * /pcm/resctrl unprivileged (TODO WORKS! | | | | |
110-
| | * unprivileged RW bind mount in sys (TODO: doesn't work!) | | | | |
111-
| | * unprivileged "inside" mount in sys (TODO: doesn't work!) | | | | |
112107
| watchdog | RO/RW: /proc/sys/kernel/nmi_watchdog | PCM_KEEP_NMI_WATCHDOG | yes (tries to disable)| src/cpucounters.cpp:disableNMIWatchdog() | |
113108
| msr | RW: /dev/cpu/X/msr + privileged or CAP_ADMIN/CAP_RAWIO | PCM_NO_MSR | 0 / 0 | msr.cpp:MsrHandle() | privileged or values-device-injector.yaml |
114109
| | RW: /dev/mem | ? | 0 / 0 | cpucounters.cpp:initUncoreObjects, pci.cpp:PCIHandleM() | privileged or values-device-injector.yaml |
@@ -118,6 +113,12 @@ More information here: https://kubernetes.io/docs/tutorials/security/ns-level-ps
118113

119114
### Validation on local kind cluster
120115

116+
117+
#### Requirements
118+
119+
- kubectl/kind/helm/jq binaries available in PATH
120+
- docker service up and running
121+
121122
#### 1) Optionally mount resctrl filesystem
122123

123124
```
@@ -191,9 +192,9 @@ helm install prometheus prometheus-community/kube-prometheus-stack --set prometh
191192
kubectl get sts prometheus-prometheus-kube-prometheus-prometheus
192193
```
193194

194-
#### 5) Deploy PCM helm chart in pcm namespace
195+
#### 5) Deploy PCM helm chart
195196

196-
Deploy to "pcm" namespace
197+
Deploy with defaults:
197198
```
198199
# Deploy to current namespace with defaults
199200
helm install pcm .

deployment/pcm/templates/daemonset.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,6 @@ spec:
139139
readOnly: true # RW?
140140
{{- end }}
141141
{{- if .Values.resctrlHostMount }}
142-
#- mountPath: /sys/fs/resctrl # HACK because issues with sys mounting! ?!?!?! really?
143-
# - mountPath: /pcm/resctrl
144-
# name: sysfs-resctrl
145142
- mountPath: /sys/fs/resctrl
146143
name: sysfs-resctrl
147144
{{- end }}

src/cpucounters.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,9 +1864,9 @@ void PCM::initUncoreObjects()
18641864
#ifdef _MSC_VER
18651865
std::cerr << "You must have signed msr.sys driver in your current directory and have administrator rights to run this program.\n";
18661866
#else
1867-
std::cerr << "you must have read and write permissions for /proc/bus/pci/7f/10.* and /proc/bus/pci/ff/10.* devices (the 'chown' command can help).\n";
1868-
std::cerr << "you must have read and write permissions for /dev/mem device (the 'chown' command can help).\n";
1869-
std::cerr << "you must have read permission for /sys/firmware/acpi/tables/MCFG device (the 'chmod' command can help).\n";
1867+
//std::cerr << "you must have read and write permissions for /proc/bus/pci/7f/10.* and /proc/bus/pci/ff/10.* devices (the 'chown' command can help).\n";
1868+
//std::cerr << "you must have read and write permissions for /dev/mem device (the 'chown' command can help).\n";
1869+
//std::cerr << "you must have read permission for /sys/firmware/acpi/tables/MCFG device (the 'chmod' command can help).\n";
18701870
std::cerr << "You must be root to access server uncore counters in PCM.\n";
18711871
#endif
18721872
}
@@ -6830,7 +6830,7 @@ void initSocket2Bus(std::vector<std::pair<uint32, uint32> > & socket2bus, uint32
68306830
// match
68316831
if (DEV_IDS[i] == device_id)
68326832
{
6833-
std::cerr << "PCI: DEBUG: found bus " << std::hex << bus << " with device ID " << device_id << std::dec << "\n";
6833+
// std::cout << "DEBUG: found bus " << std::hex << bus << " with device ID " << device_id << std::dec << "\n";
68346834
socket2bus.push_back(std::make_pair(group, bus));
68356835
break;
68366836
}

src/pcm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ int mainThrows(int argc, char * argv[])
12941294
set_signal_handlers();
12951295

12961296
cerr << "\n";
1297-
cerr << " FOO1 Intel(r) Performance Counter Monitor " << PCM_VERSION << "\n";
1297+
cerr << " Intel(r) Performance Counter Monitor " << PCM_VERSION << "\n";
12981298
cerr << "\n";
12991299

13001300
cerr << "\n";

src/resctrl.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ namespace pcm
1717
bool Resctrl::isMounted()
1818
{
1919
struct stat st;
20-
//if (stat("/sys/fs/resctrl/mon_groups", &st) < 0)
21-
if (stat("/pcm/resctrl/mon_groups", &st) < 0)
20+
if (stat("/sys/fs/resctrl/mon_groups", &st) < 0)
2221
{
2322
return false;
2423
}
@@ -28,9 +27,9 @@ namespace pcm
2827
{
2928
if (isMounted() == false)
3029
{
31-
std::cerr << "ERROR: /pcm/resctrl is not mounted\n";
30+
std::cerr << "ERROR: /sys/fs/resctrl is not mounted\n";
3231
std::cerr << "ERROR: RDT metrics (L3OCC,LMB,RMB) will not be available\n";
33-
std::cerr << "Mount it to make it work: mount -t resctrl resctrl /pcm/resctrl\n";
32+
std::cerr << "Mount it to make it work: mount -t resctrl resctrl /sys/fs/resctrl\n";
3433
return;
3534
}
3635
const auto numCores = pcm.getNumCores();

src/resctrl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace pcm
2828
FileMapType L3OCC, MBL, MBT;
2929
Resctrl() = delete;
3030
size_t getMetric(const FileMapType & fileMap, int core);
31-
static constexpr auto PCMPath = "/pcm/resctrl/mon_groups/pcm";
31+
static constexpr auto PCMPath = "/sys/fs/resctrl/mon_groups/pcm";
3232
public:
3333
Resctrl(PCM & m) : pcm(m) {}
3434
bool isMounted();

0 commit comments

Comments
 (0)