I have to write a Python3 program which counts every process on a virtual machine that's using seccomp. It should use the proc filesystem to identify these processes but I don't know how to do it. In general I would go through every folder in this filesystem, open the file and search for the string 'seccomp'. If it occurs, I would increment a counter. That's just theoretical because I don't know how to implement it. That's one attempt that lists every process and add it to a list but it doesn't get access to the processes
#!/usr/bin/env python3
import os
os.system("pip install psutil")
import psutil
processes = []
for proc in psutil.process_iter():
processName = proc.name()
processes.append(processName)
for i in range(len(processes)-1):
print(processes.count("seccomp")