1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 06:46:26 +01:00
Files
openshift-docs/modules/spo-memory-profiling.adoc
2023-01-18 15:10:44 +00:00

64 lines
1.8 KiB
Plaintext

// Module included in the following assemblies:
//
// * security/security_profiles_operator/spo-troubleshooting.adoc
:_content-type: PROCEDURE
[id="spo-memory-profiling_{context}"]
= Enable CPU and memory profiling
You can enable the CPU and memory profiling endpoints for debugging purposes.
.Procedure
. To use the profiling support, patch the `spod` configuration and set the `enableProfiling` value by running the following command:
+
[source,terminal]
----
$ oc -n openshift-security-profiles patch spod \
spod --type=merge -p '{"spec":{"enableProfiling":true}}'
----
+
.Example output
[source,terminal]
----
securityprofilesoperatordaemon.security-profiles-operator.x-k8s.io/spod patched
----
. Verify the `openshift-security-profiles` container is serving the profile endpoint by running the following command:
+
[source,terminal]
----
$ oc logs --selector name=spod -c openshift-security-profiles | grep "Starting profiling"
----
+
.Example output
[source,terminal]
----
I1202 15:14:40.276363 2185724 main.go:226] "msg"="Starting profiling server" "endpoint"="localhost:6060"
----
. Verify the `log-enricher` container is serving the profile endpoint by running the following command:
+
[source,terminal]
----
$ oc logs --selector name=spod -c log-enricher | grep "Starting profiling"
----
+
.Example output
[source,terminal]
----
I1202 15:14:40.364046 2185814 main.go:226] "msg"="Starting profiling server" "endpoint"="localhost:6061"
----
. Verify the `bpf-recorder` container is serving the profile endpoint by running the following command:
+
[source,terminal]
----
$ oc logs --selector name=spod -c bpf-recorder | grep "Starting profiling"
----
+
.Example output
[source,terminal]
----
I1202 15:14:40.457506 2185914 main.go:226] "msg"="Starting profiling server" "endpoint"="localhost:6062"
----