nikademus79 / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

SystemError on import - 64bit FreeBSD, python2.5 #226

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
{{{
import psutil
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "build/bdist.freebsd-7.0-RELEASE-p3-amd64/egg/psutil/__init__.py", line 581, in <module>
  File "build/bdist.freebsd-7.0-RELEASE-p3-amd64/egg/psutil/__init__.py", line 577, in cpu_times
  File "build/bdist.freebsd-7.0-RELEASE-p3-amd64/egg/psutil/_psbsd.py", line 52, in get_system_per_cpu_times
    for cpu_t in _psutil_bsd.get_system_per_cpu_times():
SystemError: error return without exception set
}}}

Running psutil 0.3.0 with python2.5, on FreeBSD 64-bit.

Original issue reported on code.google.com by timwin...@gmail.com on 26 Oct 2011 at 11:06

GoogleCodeExporter commented 8 years ago
What freebsd version are you using?
Also, can you paste the output of "sysctl kern.smp.maxcpus" and "sysctl 
kern.cp_times" commands?

Original comment by g.rodola on 26 Oct 2011 at 11:37

GoogleCodeExporter commented 8 years ago
> uname -rp
7.0-RELEASE-p3 amd64

> sysctl kern.smp.maxcpus
kern.smp.maxcpus: 16

> sysctl kern.cp_times
sysctl: unknown oid 'kern.cp_times'

> sysctl kern.cp_time
kern.cp_time: 56447090 1492763 13068187 1144287 197020887

Thanks

Original comment by timwin...@gmail.com on 26 Oct 2011 at 11:47

GoogleCodeExporter commented 8 years ago
Wondering whether we can freely use kern.cp_time as replacement. Apparently it 
seems so.
On the other hand I've just tried to compile psutil on freebsd 7 and I get 
different compiling errors.
It seems at some point we broke support for it. :(

Original comment by g.rodola on 26 Oct 2011 at 11:58

GoogleCodeExporter commented 8 years ago
Ok, we cannot use kern.cp_time.
After some research it seems there's no easy/immediate way to gather per-cpu 
stats on free bsd versions < 8.0.
I'm even inclined to think there might be no way at all because:

- "top -P", which shows this info, doesn't work on free bsd 7
- "htop", which provides this info without any option, requires some 
preliminary setup to be installed in the first place: 
http://daemon80.blogspot.com/2007/09/htop-in-freebsd.html

Other than that I'm realizing we have some other incompatibilities which are 
annoying to fix: Process's get_open_files() and getcwd() don't work because 
kinfo_file structure doesn't exists.

At this point I think we have 2 possibilities: drop support for freebsd 7 or 
drop support for those functionnalities which are not working.
Since freebsd 7 appeared only 3 years ago:
http://www.freebsd.org/releases/
...I think it makes more sense to go with the second option.

Original comment by g.rodola on 26 Oct 2011 at 9:25

GoogleCodeExporter commented 8 years ago
Fixed in r1206, which is a commit I'm really ashamed of. =)

Original comment by g.rodola on 26 Oct 2011 at 9:33

GoogleCodeExporter commented 8 years ago

Original comment by g.rodola on 29 Oct 2011 at 3:44

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Updated csets after the SVN -> Mercurial migration:
r1206 == revision b146de777a1d

Original comment by g.rodola on 2 Mar 2013 at 12:05