1# A simple profiler 2Fit for lightwight usage, minimum dependency 3 4## Build 5``` 6g++ -o profiler profiler.cpp 7``` 8 9## Run 10The profiler would open perf event with the cgroup which controls the specified pid 11``` 12./profiler <pid> 13``` 14 15To create a perf-event cgroup 16 17cgroup v1 18``` 19mkdir /sys/fs/cgroup/perf_event/<somename> 20echo $$ > /sys/fs/cgroup/perf_event/<somename>/cgroup.procs 21# run the target progrom 22# run profiler with any pid within the cgroup 23``` 24For cgroup v2, just use /sys/fs/cgroup/<somename> 25 26 27## Example 28When profiler terminated, a report is generated, following is an example showing the performance impact from seccomp when running a high-IO program within a docker container. 29![example](./example1.png "report") 30