$ strace -c ps
- Files of interactions NONE.
- Time taken by each syscall and syscall list can be found here by executing the command below.
$ strace -o ps_trace.txt -c ps
- Files of interaction ps_trace.txt.
$ strace -c ls
- Files of interactions NONE.
- Time taken by each syscall and syscall list can be found here by executing the command below.
$ strace -o ls_trace.txt -c ls
- Files of interaction ls_trace.txt.
$ strace -c cd
- Error:
strace: Can't stat 'cd': No such file or directory
- Note: cd do not have an executable in the bin directory like ls and ps commands, because it's built in the shell.
- Solution: Trace a bash that runs the cd command
- Time taken by each syscall and syscall list can be found here by executing the command below.
$ strace -o cd_trace.txt -c sh -c "cd"
- Files of interaction: the directory you want to go, ex: Downloads and cd_trace.txt.
$ top
- press 1 to list all the cores you have
$ for i in {1..22}; do dd if=/dev/zero of=/dev/null & done
$ sudo renice -n 20 $(jobs -p)
$ killall dd
OR
$ kill $(jobs -p)
- Note: this will kill all the background processes.