summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-06-10 19:44:20 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-06-10 19:44:20 -0300
commite13d9c086c14d7553656d9def163d6102211e2f9 (patch)
tree504e0c55de46bc9e107fdd14444953fd2b9ffdf7
parentc7b830b03a976297d28598fb01c82d2e4a1d97de (diff)
downloadpython-linux-procfs-e13d9c086c14d7553656d9def163d6102211e2f9.tar.gz
interrupts: Do not refrain from parsing the irq affinities for !root
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>
-rwxr-xr-xprocfs/procfs.py2
1 files changed, 0 insertions, 2 deletions
diff --git a/procfs/procfs.py b/procfs/procfs.py
index 4ff7e98..2d0e2b0 100755
--- a/procfs/procfs.py
+++ b/procfs/procfs.py
@@ -405,8 +405,6 @@ class interrupts:
return dict
def parse_affinity(self, irq):
- if os.getuid() != 0:
- return
try:
f = file("/proc/irq/%s/smp_affinity" % irq)
line = f.readline()