Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
giampaolo opened this issue May 23, 2014 · 7 comments
Closed

Comments

@giampaolo
Copy link
Owner

From Curtin1...@gmail.com on October 18, 2012 20:47:51

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: http://code.google.com/p/psutil/issues/detail?id=337

@giampaolo
Copy link
Owner Author

From g.rodola on October 18, 2012 11:49:48

What linux distro is this?

@giampaolo
Copy link
Owner Author

From Curtin1...@gmail.com on October 19, 2012 10:39:11

-sh-3.1$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.1 (Tikanga)

@giampaolo
Copy link
Owner Author

From tipec...@gmail.com on November 01, 2012 09:34:36

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.

Attachment: fix-get_num_ctx_switches-on-old-kernels.patch

@giampaolo
Copy link
Owner Author

From g.rodola on March 02, 2013 04:13:33

Updated csets after the SVN -> Mercurial migration: r27 == revision 446c22c12039

@giampaolo
Copy link
Owner Author

From g.rodola on April 07, 2013 18:21:49

Status: FixedInHG

@giampaolo
Copy link
Owner Author

From g.rodola on April 11, 2013 02:17:39

Labels: -Milestone-0.6.2 Milestone-0.7.0

@giampaolo
Copy link
Owner Author

From g.rodola on April 12, 2013 11:21:26

Status: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant