peter-hst / psutil

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

exception with get_num_ctx_switches --> raise RuntimeError("line not found") #337

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.
>>> import psutil
>>> p = psutil.Process(29562)
>>> p.as_dict()
2.
3.

What is the expected output?

What do you see instead?
throw exception in 
_pslinux.py", line 638, in get_num_ctx_switches
    raise RuntimeError("line not found")

What version of psutil are you using? What Python version?
psutil 0.6.1
Python 2.7 (r27:82500, Aug  3 2011, 11:55:34)

On what operating system? Is it 32bit or 64bit version?
Linux x86_64 GNU/Linux 2.6.18-53.1.4.el5

Please provide any additional information below.
cat  /proc/29562/status
Name:   sh
State:  S (sleeping)
SleepAVG:       98%
Tgid:   15393
Pid:    15393
PPid:   15358
TracerPid:      0
Uid:    703934  703934  703934  703934
Gid:    1052    1052    1052    1052
FDSize: 256
Groups: 1052 630013 630397 630538 630614 630625
VmPeak:    21408 kB
VmSize:    21408 kB
VmLck:         0 kB
VmHWM:      2840 kB
VmRSS:      2840 kB
VmData:      776 kB
VmStk:        84 kB
VmExe:       700 kB
VmLib:      5364 kB
VmPTE:        92 kB
StaBrk: 008bf000 kB
Brk:    05c76000 kB
StaStk: 7fff45a50760 kB
Threads:        1
SigQ:   0/1064959
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000010000
SigIgn: 0000000000384004
SigCgt: 000000004b813efb
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
Cpus_allowed:   
7fffffff,ffffffff,ffffffff,ffffffff,ffffffff,ffffffff,ffffffff,ffffffff
Mems_allowed:   00000000,0000000f

Original issue reported on code.google.com by Curtin1...@gmail.com on 18 Oct 2012 at 6:47

GoogleCodeExporter commented 8 years ago
What linux distro is this?

Original comment by g.rodola on 18 Oct 2012 at 6:49

GoogleCodeExporter commented 8 years ago
-sh-3.1$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.1 (Tikanga)

Original comment by Curtin1...@gmail.com on 19 Oct 2012 at 5:39

GoogleCodeExporter commented 8 years ago
From man 5 proc:

* voluntary_context_switches,   nonvoluntary_context_switches: Number of 
voluntary and involuntary  context  switches (since Linux 2.6.23).

Tikanga uses 2.6.18, so it does not have those fields. One solution would be to 
raise a NotImplementedError rather than a RuntimeError, see the attached patch.

Original comment by tipec...@gmail.com on 1 Nov 2012 at 4:34

Attachments:

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

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

GoogleCodeExporter commented 8 years ago

Original comment by g.rodola on 8 Apr 2013 at 1:21

GoogleCodeExporter commented 8 years ago

Original comment by g.rodola on 11 Apr 2013 at 9:17

GoogleCodeExporter commented 8 years ago

Original comment by g.rodola on 12 Apr 2013 at 6:21