bcc icon indicating copy to clipboard operation
bcc copied to clipboard

make deadlock can run everywhere

Open mackong opened this issue 3 years ago • 2 comments

Currently, deadlock.py open deadlock.c in relative path, which make deadlock.py only can run in the installation directory. This patch make deadlock.c opened in absolute path, then we can run deadlock.py everywhere.

Before:

➜  ~ sudo deadlock --binary /usr/lib64/libc.so.6 1102
Traceback (most recent call last):
  File "/usr/share/bcc/tools/deadlock", line 573, in <module>
    main()
  File "/usr/share/bcc/tools/deadlock", line 481, in main
    with open('deadlock.c') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'deadlock.c'

After:

➜  ~ sudo deadlock --binary /usr/lib64/libc.so.6 1102
Tracing... Hit Ctrl-C to end.

mackong avatar Jun 11 '22 04:06 mackong

Could you have a good commit message to explain the problem you are facing and how this patch addressed your issue?

yonghong-song avatar Jul 03 '22 02:07 yonghong-song

I confirm that I face the same problem on my side. I patched my BCC setup with the proposed patch and it helped me to get rid of this error.

The commit message seems explicit to me, but maybe some words could be added to highlight the problem like suggested by @yonghong-song. Can't hurt.

Thanks @mackong for proposing this fix. Hopefully it will be merged.

4383 avatar May 03 '24 12:05 4383