Age | Commit message (Collapse) | Author | Files | Lines |
|
We should not be maintaining specfiles upstream, they should be
maintained in the distributions instead.
Also, a lot of the functionality in the Makefile was for working with
rpms. This is not needed anymore because there are other tools that do
this. So, the Makefile was gutted, leaving just a few things like making
tags.
Finally, for version 0.7.2, the version numbers were not bumped-up to
match the git tag. Therefore, bumping version numbers up to 0.7.3 and
creating a new git tag v0.7.3
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Change the COPYING file for SPDX licenses
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
procfs: Added SPDX licence
Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
utilist: Added SPDX licence
Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
__init__: Added SPDX licence
Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
- Added Copyright back
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
setup: Added SPDX licence
Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
bitmasklist_test: Added SPDX licence
Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
distutils is deprecated, so use sysconfig instead
different versions of python produce different results, which is why
we test which SCHEME is available before calculating our answer.
TODO: test whether we need to calculate PYTHONLIB at all. Is it being
used during the setup? We don't appear to be using a --prefix from our
specfiles. This patch ensures that if it is used, we are getting a
correct PYTHONLIB without using distutils, but perhaps we can just drop
this section.
We need to bump the version number as well here, it looks like it was
missed the last time.
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Create release v0.7.1
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Fix the VERSION number in procfs.
Note: this appears to be unused though. Consider either removing it
or using it, and removing version numbers elsewhere like in the spec
file
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Use f-strings instead of regular strings to improve readability
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
- Add missing "open" to with statement.
- Fix tests in __main__
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Use sys.exit and add some docstrings
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Create release v0.7.0
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Commit 7570fc0d6082 meant to solve the UnicodeDecodeError
Instead it actually increased the problem by reading lines as bytes
and decoding them.
The original problem is hard to trigger and doesn't trigger consistently
with reproducers. In addition there seems to be a difference in how this
is handled between python-3.6 to python-3.9
For now, we should return the code to reading as utf-8 (the default)
since that handles more cases than the current code.
We can catch the UnicodeDecodeError and ignore it for now. It is not
ideal because we are not handling some pids that trigger the error.
This patch also includes a fix for a FileNotFoundError which can occur if
a pid exits and disappears before we try to read it in the /proc file
system.
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
- Replace f=open with 'with' (context managers), except in try-except blocks
- Reformat lines that are too long, especially in comments
- Use min() instead of if construct
- Use bool instead of complicated and True or False constructs
- Reorder imports
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
python-linux-procfs makes no use of sysctl.py, nor does tuna
It appears to be code that was written to abstract some common
operations reading procfs, but was never actually put into use.
Just delete it
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Add the ability to use ctags to the Makefile. This adds the commands
make tags
make cleantags
and modifies
make clean
to call cleantags
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Sometimes pids disappear when they are completed.
Programs such as pflags that use procfs must account for that.
The solution is to simply recognize this situation, and to continue.
Reviewed-by: Leah Leshchinsky <lleshchi@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
If a pid is completed and disappears a FileNotFoundError will occur
because /proc/pid/stat will disappear too.
It is not possible to check for the file first because it could still
disappear between the time of the check and the time of use.
Propagate this error to the user.
The user should handle this with a try, except clause and ignore it if
an exception occurs.
Reviewed-by: Leah Leshchinsky <lleshchi@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Fix traceback if there are non-utf8 characters in the /proc/PID/cmdline
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Add tar.xz and *.asc files to .gitignore
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
python-linux-procfs: Create release 0.6.3
with tag v0.6.3
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
- elif not necessary after continue
- don't use len() as a condition
- Fix import order
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Simply is_s390 by using bool instead of if statement.
Add a docstring to the function and remove space from shebang while we're at it.
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Fix spacing problems as recommended by PEP8 for procfs.py
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Add gitignore and gitattributes files to make programming more pleasant.
Also, procfs/procfs.pyc should not be tracked by git
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
If procfs/utilist.py is not in your PYTHONPATH, the import can fail.
Specify it fully.
Reported-by: David Runge <dave@sleepmap.de>
Suggested-by: Guy Streeter <guy.streeter@gmail.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Release 0.6.2
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Getting the number of cpus breaks on s390 and s390x due to differences
in /proc/cpuinfo
This can cause problems in other programs such as tuna when running
tuna --cpus=1 --isolate
for example
Fix this by testing whether we are on s390 and increasing the cpu count
if we match "cpu number"
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
- Specify python3 explictly
- Fixing tabbing and spacing
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Use is None and is not None instead of == or !=
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
- use list to loop over keys
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
- Replaces tabs with 4 spaces
- Specify python3 explicitly
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
- fix order of imports
- fix spacing in assignment of lists
- fix spacing in defaults of methods and functions
- fix a few more indentation problems
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
- Remove __future__
- Fix import
- Use list where required
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Use Python spacing
- remove tabs and replace with 4 spaces
- specify python3
- Remove spaces on empty lines
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
- python3 only, so remove from __future__
- explicitly specify python3
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Conform to python spacing recommendations, for easier maintainence
- remove tabs, for 4 spaces
- remove unnecessary parenthesis
- remove unnecessary spacing around return
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
- Remove tabs for spaces
- Don't import unused glob module
- Changes order of imports so that os comes before from os.path
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
- Rename class to conform to python naming conventions
- Remove unneeded semicolons
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Only python3 is supported now
Changes to python3
- Specify python3 on the shebang
- Get rid of future
- Apply optional ws_comma from 2to3
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
If a process disappears while iterating the loop in
pidstats.reload_threads(), we get a RuntimeError as shown below. This
is because we cannot remove an entry from a dictionary while iterating the
dictionary.
Reproducer:
1. Add the following line to the beginning of pidstats.reload_threads():
import pdb; pdb.set_trace()
2. Start some process
3. Start the python interpreter and proceed as follows:
[~/git/python-linux-procfs]$ python3
Python 3.6.8 (default, Jan 3 2019, 16:11:14)
[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import procfs
>>> ps = procfs.pidstats()
>>> ps.reload_threads()
> /home/olysonek/git/python-linux-procfs/procfs/procfs.py(462)reload_threads()
-> for pid in self.processes.keys():
(Pdb) next
> /home/olysonek/git/python-linux-procfs/procfs/procfs.py(463)reload_threads()
-> try:
At this point, terminate the process started in step 2. Return to the
python interpreter:
(Pdb) continue
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/olysonek/git/python-linux-procfs/procfs/procfs.py", line 463, in reload_threads
try:
RuntimeError: dictionary changed size during iteration
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Fix iterating over the 'cache' dictionary in refresh(). A dictionary is
not callable. This fixes the following error:
>>> import procfs.sysctl
>>> s = procfs.sysctl()
>>> s.refresh()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.6/site-packages/procfs/sysctl.py", line 64, in refresh
for key in self.cache():
TypeError: 'dict' object is not callable
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
If the user enters a non-existent pid or process name, skip over it,
Also, if the user enters nothing but a non-existent pid, then make sure
the max_comm_len defaults to 0 instead of generating an error.
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
The purpose of this change was to create a -h, or --help option.
The following changes were made.
1. pflags is now python3 only, since it uses argparse.
2. The handling of pids or process names is improved, instead of a
command separated list (without spaces), the more standard unix way of
space separated command line arguements are used.
This is explained in the help
./pflags -h
usage: pflags [-h] [pid [pid ...]]
Print process flags
positional arguments:
pid a list of pids or names
optional arguments:
-h, --help show this help message and exit
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Reduce not in python3 by default, so import it from functools
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
new functionality, new version :)
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Add cannot_set_affinity and cannot_set_thread_affinity from tuna
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
trying to keep setup.py and rpm specfile coherent :)
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
added scripts to setup.py, pflags renamed and added to setup.py
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
We need to specify new dependency on `six` module with
`install_requires` which is supported via setuptools.
Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Moreover, `file()` is not available in Python 3.
Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
This adds the first unit test to python-linux-procfs
It adds the bitmasklist_test for testing the function bitmasklist, which
is called by parse_affinity. Unlike parse_affinity, the number of cpus
is not detected, so the unit test can simulate different numbers of
cpus.
This is an expanded form of a reproducer from Jozef Bacik from
Bugzilla 1365902
If we add more unit tests in the future (we should), then we can
consider some kind of python package scheme, but for now this can live
in the base directory.
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
The function parse_affinity reports wrong results for CPU numbers
greater than 31.
The problem is caused by the function bitmastlist which parse_affinity
calls. The fix treats the inpput line as a long hexbitmask instead of an
array in order to produce correct results
Signed-off-by: Jozef Bacik <jobacik@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
Signed-off-by: John Kacur <jkacur at redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Mention python-perf as an alternative way of noticing thread lifetime
events (FORK, EXIT).
Requested-by: Guy Streeter <streeter@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Reported-by: Guy Streeter <streeter@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Reported-by: Guy Streeter <streeter@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Reported-by: Guy Streeter <streeter@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@edhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Reported-by: Guy Streeter <streeter@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
So that we can use procfs.cmdline()["BOOT_IMAGE"], for instance.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Reported-by: Guy Streeter <streeter@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
So that we can do:
>>> import procfs
>>> processes = procfs.pidstats()
>>> sshd = processes.find_by_name("sshd")
>>> print sshd_maps[0].perms
>>> sshd_maps = procfs.smaps(sshd[0])
>>> print sshd_maps[0].perms
r-xp
I.e. access it like an array.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Getting the process flags documentation from the kernel
include/linux/sched.h file, that is what 'man procfs' references when
describing the processor flags in /proc/PID/stat.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
It is the last field, in CSV format, and that was what was being parsed,
but in a convoluted way, fixing it also simplified it.
Buggy:
[root@zoo ~]# tuna -Q
# users affinity
0 2-edge timer 0,1,2,3
8 8-edge rtc0 0,1,2,3
9 9-fasteoi acpi 0,1,2,3
17 17-fasteoi brcmsmac 0,1,2,3
22 22-fasteoi ehci_hcd:usb4 0,1,2,3
23 23-fasteoi ehci_hcd:usb3 0,1,2,3
26 2146304-edge pciehp 0,1,2,3
27 2162688-edge pciehp 0,1,2,3
28 2179072-edge pciehp 0,1,2,3
29 2195456-edge pciehp 0,1,2,3
30 512000-edge 0000:00:1f.2 0,1,2,3
31 327680-edge xhci_hcd 0,1,2,3
32 32768-edge i915 0,1,2,3
33 360448-edge mei_me 0,1,2,3
34 2621440-edge thunderbolt 0,1,2,3
35 442368-edge snd_hda_intel 0,1,2,3
[root@zoo ~]#
Fixed:
# tuna -Q
# users affinity
0 timer 0,1,2,3
8 rtc0 0,1,2,3
9 acpi 0,1,2,3
17 brcmsmac 0,1,2,3
22 ehci_hcd:usb4 0,1,2,3
23 ehci_hcd:usb3 0,1,2,3
26 pciehp 0,1,2,3
27 pciehp 0,1,2,3
28 pciehp 0,1,2,3
29 pciehp 0,1,2,3
30 0000:00:1f.2 0,1,2,3
31 xhci_hcd 0,1,2,3
32 i915 0,1,2,3
33 mei_me 0,1,2,3
34 thunderbolt 0,1,2,3
35 snd_hda_intel 0,1,2,3
#
Reported-by: Flavio Leitner <fbl@redhat.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1245677
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
The load method was just splitting the fields using space as the
separator, but since some COMM names started having spaces... We
better use the () as the COMM "quotes", using spaces as the
separator for the remaining fields.
Reported-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
E.g.:
$ ./pflags-cmd.py ssh*,bash,6941
1278 sshd RANDOMIZE|SUPERPRIV|USED_ASYNC|USED_MATH
2692 bash RANDOMIZE|USED_ASYNC|USED_MATH
2919 bash RANDOMIZE|SUPERPRIV|USED_ASYNC|USED_MATH
3116 bash RANDOMIZE|USED_ASYNC|USED_MATH
3149 bash RANDOMIZE|USED_ASYNC|USED_MATH
3384 bash RANDOMIZE|USED_ASYNC|USED_MATH
3579 bash RANDOMIZE|USED_ASYNC|USED_MATH
3834 ssh RANDOMIZE|USED_ASYNC|USED_MATH
4372 bash RANDOMIZE|USED_ASYNC|USED_MATH
5024 bash RANDOMIZE|USED_ASYNC|USED_MATH
6339 bash RANDOMIZE|USED_ASYNC|USED_MATH
6941 vim FREEZER_SKIP|RANDOMIZE|USED_ASYNC|USED_MATH
$
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Adding the ones found in the v4.1-rc kernel.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
It was referencing self.flags, that doesn't exists, fix it by making it
access self.fields["flags"] instead.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
I.e. let the OS be the one to decide if access to this file is allowed
or not, and non root users can see this, at least around 4.1-rc times:
Running: procfs/procfs.py:
31: {'affinity': [0, 1, 2, 3], 'type': 'PCI-MSI-edge', 'cpu': [178564, 0, 285828, 0], 'users': ['xhci_hcd']}
30: {'affinity': [0, 1, 2, 3], 'type': 'PCI-MSI-edge', 'cpu': [342630, 0, 197229, 0], 'users': ['0000:00:1f.2']}
35: {'affinity': [0, 1, 2, 3], 'type': 'PCI-MSI-edge', 'cpu': [858, 0, 565, 0], 'users': ['snd_hda_intel']}
34: {'affinity': [0, 1, 2, 3], 'type': 'PCI-MSI-edge', 'cpu': [306, 0, 44, 0], 'users': ['thunderbolt']}
And now 'tuna -Q' works for non root users:
[acme@zoo python-linux-procfs]$ ../tuna/tuna-cmd.py -Q
# users affinity
0 timer 0,1,2,3
8 rtc0 0,1,2,3
9 acpi 0,1,2,3
17 17-fasteoi brcmsmac 0,1,2,3
22 22-fasteoi ehci_hcd:usb4 0,1,2,3
23 23-fasteoi ehci_hcd:usb3 0,1,2,3
26 pciehp 0,1,2,3
27 pciehp 0,1,2,3
28 pciehp 0,1,2,3
29 pciehp 0,1,2,3
30 0000:00:1f.2 0,1,2,3
31 xhci_hcd 0,1,2,3
32 i915 0,1,2,3
33 mei_me 0,1,2,3
34 thunderbolt 0,1,2,3
35 snd_hda_intel 0,1,2,3
[acme@zoo python-linux-procfs]$
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
For the stat flag that means that userland is not allowed to meddle with
cpus_allowed, i.e. with the thread's smp affinity, via
sched_setaffinity.
This indeed has the same value as PF_THREAD_BOUND, see the kernel
sources for an explanation, but basically was in this cset:
commit 14a40ffccd6163bbcd1d6f32b28a88ffe6149fc6
Author: Tejun Heo <tj@kernel.org>
Date: Tue Mar 19 13:45:20 2013 -0700
sched: replace PF_THREAD_BOUND with PF_NO_SETAFFINITY
PF_THREAD_BOUND was originally used to mark kernel threads which
were bound to a specific CPU using kthread_bind() and a task with
the flag set allows cpus_allowed modifications only to itself.
Workqueue is currently abusing it to prevent userland from meddling
with cpus_allowed of workqueue workers.
---------------------------------------------------------------
So add the new const but keep the old one, we may have some tool out
there using it.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Guy Streeter <streeter@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Petr Oros <poros@redhat.com>
|
|
Recent kernels (detected on 3.9.0-rc2) have a VmFlags field that has
string flags that broke the detection of multiple memory maps.
Fix it by checking for a ':' as the last character of the first
token in the split() line.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
When the process vanishes after we got a list of pids that match some
criteria, just catch it, remove it from the pid dictionary and continue.
Reported-by: Clark Williams <williams@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Reviewed-by: Parag AN(पराग) <panemade@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Part of the fedora review process.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Reported-by: Guy Streeter <streeter@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Thanks to Guy Streeter for letting me know about this problem.
Signed-off-by: Arnaldo Carvalho de Melo <acme@doppio.ghostprotocols.net>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
So that we don't require the tools that use p-l-procfs to call load_cmdline
everytime we refresh the list of processes, leaving parsing of /proc/cmdline to
the last possible moment.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Since we now defer looking at the contents till we really need to parse the
files, we have to check if the process died in this method.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Usage example:
>>> import procfs
>>> ps = procfs.pidstats()
>>> for t in ps.find_by_name("sirq-net-tx/6"):
... print "%s: %s" % (t, ps.process_flags(t))
...
85: ['PF_FORKNOEXEC', 'PF_NOFREEZE', 'PF_SUPERPRIV', 'PF_THREAD_BOUND']
>>> for t in ps.find_by_name("pdflush"):
... print "%s: %s" % (t, ps.process_flags(t))
...
398: ['PF_FLUSHER', 'PF_FORKNOEXEC', 'PF_SWAPWRITE']
399: ['PF_FLUSHER', 'PF_FORKNOEXEC', 'PF_SWAPWRITE']
>>>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
To build an rpm without first commiting the latest changes.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Thanks to Jon Masters for pointing out this.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
So that we can experiment with files saved from different machines.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Number of cpus remains with the same algorithms, so for a 16 socket
machine with dual core cpus with ht enabled we have:
nr_sockets: 16
nr_cores: 32
nr_cpus: 64
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|