1
�
355_•I|¥‰ÓMjqØ‚¦ ë<óo¬ÁÀ c
404 Not Found
Not Found
The requested URL was not found on this server.
Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.
�
355¾ÁÀ c
404 Not Found
Not Found
The requested URL was not found on this server.
Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.
; ˆl–ß=¿Jõ5*mAàƒq§ÔÅ£Ä
„eÆZÃa–ß=¿JJj"Tâ‚fãmÜ ”ţ ?÷ #!/usr/bin/python3
# -*- python -*-
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2007-2025 Red Hat, Inc.
# Arnaldo Carvalho de Melo
# John Kacur
#
import os
import platform
import re
import time
from functools import reduce
from procfs.utilist import bitmasklist
VERSION = "0.7.4"
def is_s390():
""" Return True if running on s390 or s390x """
machine = platform.machine()
return bool(re.search('s390', machine))
def process_cmdline(pid_info):
"""
Returns the process command line, if available in the given `process' class,
if not available, falls back to using the comm (short process name) in its
pidstat key.
"""
if pid_info["cmdline"]:
return reduce(lambda a, b: a + " %s" % b, pid_info["cmdline"]).strip()
try:
""" If a pid disappears before we query it, return None """
return pid_info["stat"]["comm"]
except:
return None
class pidstat:
"""
Provides a dictionary to access the fields in the
per process /proc/PID/stat files.
One can obtain the available fields by asking for the keys of the
dictionary, e.g.:
>>> p = procfs.pidstat(1)
>>> print p.keys()
['majflt', 'rss', 'cnswap', 'cstime', 'pid', 'session', 'startstack', 'startcode', 'cmajflt', 'blocked', 'exit_signal', 'minflt', 'nswap', 'environ', 'priority', 'state', 'delayacct_blkio_ticks', 'policy', 'rt_priority', 'ppid', 'nice', 'cutime', 'endcode', 'wchan', 'num_threads', 'sigcatch', 'comm', 'stime', 'sigignore', 'tty_nr', 'kstkeip', 'utime', 'tpgid', 'itrealvalue', 'kstkesp', 'rlim', 'signal', 'pgrp', 'flags', 'starttime', 'cminflt', 'vsize', 'processor']
And then access the various process properties using it as a dictionary:
>>> print p['comm']
systemd
>>> print p['priority']
20
>>> print p['state']
S
Please refer to the 'procfs(5)' man page, by using:
$ man 5 procfs
To see information for each of the above fields, it is part of the
'man-pages' RPM package.
"""
# Entries with the same value, the one with a comment after it is the
# more recent, having replaced the other name in v4.1-rc kernel times.
PF_ALIGNWARN = 0x00000001
PF_STARTING = 0x00000002
PF_EXITING = 0x00000004
PF_EXITPIDONE = 0x00000008
PF_VCPU = 0x00000010
PF_WQ_WORKER = 0x00000020 # /* I'm a workqueue worker */
PF_FORKNOEXEC = 0x00000040
PF_MCE_PROCESS = 0x00000080 # /* process policy on mce errors */
PF_SUPERPRIV = 0x00000100
PF_DUMPCORE = 0x00000200
PF_SIGNALED = 0x00000400
PF_MEMALLOC = 0x00000800
# /* set_user noticed that RLIMIT_NPROC was exceeded */
PF_NPROC_EXCEEDED = 0x00001000
PF_FLUSHER = 0x00001000
PF_USED_MATH = 0x00002000
PF_USED_ASYNC = 0x00004000 # /* used async_schedule*(), used by module init */
PF_NOFREEZE = 0x00008000
PF_FROZEN = 0x00010000
PF_FSTRANS = 0x00020000
PF_KSWAPD = 0x00040000
PF_MEMALLOC_NOIO = 0x00080000 # /* Allocating memory without IO involved */
PF_SWAPOFF = 0x00080000
PF_LESS_THROTTLE = 0x00100000
PF_KTHREAD =