Closed bu3ny closed 1 year ago
Looks like it's due to clashing module names. I guess you have the python proc
package installed and pSnapper imports that instead of its own proc package. I guess I'll change the package name in the future to prevent such clashes, but for now you could either uninstall the python proc
package if you don't use it or set up the pythonpath environment variable as a workaround for pSnapper.
# sudo psn -p "mysqld|kwork" -G syscall,wchan
Traceback (most recent call last):
File "/usr/bin/psn", line 113, in <module>
args.sources = [s for s in proc.all_sources if s.name in args.sources.split(',')]
AttributeError: module 'proc' has no attribute 'all_sources'
# pip uninstall proc
Found existing installation: proc 1.0
Uninstalling proc-1.0:
Would remove:
/usr/local/bin/cron-graceful
/usr/local/bin/notify-send-headless
/usr/local/bin/with-gpg-agent
/usr/local/bin/with-gui-environment
/usr/local/lib/python3.10/site-packages/proc-1.0.dist-info/*
/usr/local/lib/python3.10/site-packages/proc/*
Proceed (Y/n)?
Successfully uninstalled proc-1.0
# sudo psn -p "mysqld|kwork" -G syscall,wchan
Linux Process Snapper v1.1.0 by Tanel Poder [https://0x.tools]
Sampling /proc/stat, syscall, wchan for 5 seconds...
finished.
=== Active Threads
query returned no rows
samples: 100
(expected: 100)
total processes: 17, threads: 17
runtime: 5.00, measure time: 0.34
I tried changing the PYTHONPATH
, but hit some other errors, a temporary workaround (if you can't remove the clashing proc
package) is to rename pSnapper's proc.py
to psnproc.py
and change imports in 2 files.
import proc
to import psnproc as proc
in /usr/lib/0xtools/psnreport.py
import proc, psnreport
to import psnproc as proc, psnreport
in /usr/bin/psn
Or just remove the separate clashingproc
package with pip uninstall proc
as described above.
I'll fix this naming clash in the next release.
Hi @tanelpoder
Tried your solution, it worked perfectly fine. I had python proc module installed using pip.
This tool is simply amazing, I think we need to produce an RPM/DEB packages for such great tool !!!
Thanks :-)
There's actually a PR already for RPM generation (#18). But I was the bottleneck last year getting this completed. But I plan to be more active this year (and any help is appreciated).
I'll try to open a RFE to include it in upcoming RHEL release.
That would be great! I'd be happy to make any changes to file & directory locations etc and anything that's needed for proper standardized deployment to Fedora/CentOS appstream/RHEL environment.
Fixed in v1.2.3
Hi,
I'm getting the following error while trying to use any of the tools: