Profiling lammps calls from python

I guess this is in some sense a generic linux question, but I was wondering if anyone knew how to profile lammps calls that are initiated from a python script. I’ve been poking around the internet trying to figure out how to profile functions in a shared library, and I get hits like this [Solved]-gprof : How to generate call graph for functions in shared library that is linked to main program-C

However, I can’t figure out where to get oProfile, and sprof appears to be broken, with an error that’s been documented for years in various places such as 22380 – Inconsistency detected by ld.so: dl-open.c: 717: _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed! or linux - Example in the sprof MAN page is not working - Stack Overflow

Am I missing some workaround or fix? Are there other profiling tools I could use that people might suggest?