This PR adds --perf_path option for damo record to provide a way to
change the file path of perf.
In addition, the current way of testing perf is to check whether perf exists or not.
However, if the perf record doesn't work properly, then there is no need
to proceed to the actual damo record.
This PR also makes damo record to check whether the given perf binary
actually works.
Here are the example executions.
$ ls /xxx/perf
ls: cannot access '/xxx/perf': No such file or directory
$ sudo ./damo record --perf_path=/xxx/perf $$
perf not found at "/xxx/perf"
$ file /usr/bin/perf
/usr/bin/perf: Bourne-Again shell script, ASCII text executable
$ sudo ./damo record --perf_path=/usr/bin/perf $$
perf record not working with "/usr/bin/perf"
$ file /home/honggyu/usr/bin/perf
/home/honggyu/usr/bin/perf: ELF 64-bit LSB pie executable, x86-64, ...
$ sudo ./damo record --perf_path=/home/honggyu/usr/bin/perf $$
Press Ctrl+C to stop
^C
signal 2 received
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 1.483 MB damon.data (153 samples) ]
This PR adds
--perf_path
option for damo record to provide a way to change the file path of perf.In addition, the current way of testing perf is to check whether perf exists or not.
However, if the perf record doesn't work properly, then there is no need to proceed to the actual damo record.
This PR also makes damo record to check whether the given perf binary actually works.
Here are the example executions.
Fixed: #38