Lines Matching +full:delay +full:- +full:line

2 # SPDX-License-Identifier: GPL-2.0-only
4 # top-like utility for displaying kvm statistics
6 # Copyright 2006-2008 Qumranet Technologies
7 # Copyright 2008-2011 Red Hat, Inc.
15 - as a top-like text ui
16 - in a key -> value format
17 - in an all keys, all values format
257 for line in open('/proc/cpuinfo'):
258 if not line.startswith('flags'):
261 flags = line.split()
425 Used to set up performance events, returns a file descriptor or -1
429 - syscall number
430 - struct perf_event_attr *
431 - pid or -1 to monitor all pids
432 - cpu number or -1 to monitor all cpus
433 - The file descriptor of the group leader or -1 to create a group.
434 - flags
463 group_leader = -1
471 if fd == -1:
522 As it is only a wrapper it returns the same 3-tuple of (dirpath,
587 # add parents for child fields - otherwise we won't see any output!
603 if '-' not in member:
606 int_range = member.split('-')
657 # pid > 0 and cpu == -1
660 # pid == -1 and cpu >= 0
662 trace_cpu = groupid if self._pid == 0 else -1
663 trace_pid = int(groupid) if self._pid != 0 else -1
755 # add parents for child fields - otherwise we won't see any output!
782 self.paths = list(filter(lambda x: "{}-".format(pid) in x, vms))
796 """Returns a dict with format:'file name / field -> current value'.
825 if self._baseline.get(key, -1) == -1:
832 field = key.split('-')[0] # set 'field' to 'pid'
833 increment = value - self._baseline.get(key, 0)
937 """Returns a dict with field -> (value, delta to last value) of all
941 * child-parent: 'key' is in format '<child> <parent>'
951 newdelta = newval - oldval
1008 # over-conscientiousness in the curses module, the error
1039 child = subprocess.Popen(['ps', '-A', '--format', 'pid,args'],
1043 for line in child.stdout:
1044 line = line.decode(ENCODING).lstrip().split(' ', 1)
1047 if ' -name ' in line[1]:
1048 res.append((line[0], Tui.get_gname_from_pid(line[0])))
1055 self.screen.addstr(row, 2, '%8s %-60s' %
1061 for line in self.get_all_gnames():
1062 self.screen.addstr(row, 2, '%8s %-60s' % (line[0], line[1]))
1078 for line in Tui.get_all_gnames():
1079 if gname == line[1]:
1080 pids.append(int(line[0]))
1088 Extracts the guest name from the QEMU comma line by processing the
1089 '-name' option. Will also handle names specified out of sequence.
1094 line = open('/proc/{}/cmdline'
1096 parms = line[line.index('-name') + 1].split(',')
1101 parms[idx - 1] += ',' + parms[idx + 1]
1103 # the '-name' switch allows for two ways to specify the guest name,
1134 self._headline = 'kvm statistics - pid {0} {1}'.format(pid, gname)
1136 self._headline = 'kvm statistics - summary'
1147 self.screen.addstr(2, 1, '%-40s %10s%7s %8s' %
1177 # when sorted - separate out all children first, and add in later
1182 if key.find(' ') != -1:
1219 if not key.find(' ') != -1:
1224 # we don't have any fields, or all non-child events are filtered
1232 if row >= self.screen.getmaxyx()[0] - 1 or values == (0, 0):
1249 self.screen.addstr(row, 1, '%-40s %10d%7.1f %8s' % (key,
1260 self.screen.addstr(row, 1, '%-40s %10d %8s' %
1266 y = min(len(self._headline), 80 - len(marker))
1276 for line in text:
1277 start = (term_width - len(line)) // 2
1278 self.screen.addstr(row, start, line)
1280 self.screen.addstr(row + 1, (term_width - len(hint)) // 2, hint,
1296 ' s set delay between refreshs (value range: '
1297 '%s-%s secs)' % (MIN_DELAY, MAX_DELAY),
1307 for line in msg:
1308 self.screen.addstr(row, 0, line)
1354 self.screen.addstr(2, 0, 'Change delay from %.1fs to ' %
1362 delay = float(val)
1363 err = is_delay_valid(delay)
1368 delay = DELAY_DEFAULT
1369 self._delay_regular = delay
1440 self._refresh_body(time.time() - start)
1451 'debugfs only (see option \'-d\') and '
1495 print('%-42s%10d%10d' % (key.split(' ')[0], values.value,
1534 line = 0
1552 statline = datetime.now().strftime("%Y-%m-%d %H:%M:%S") + \
1563 line = 0
1567 if (line % banner_repeat == 0 and not banner_printed and
1575 line += 1
1592 def is_delay_valid(delay): argument
1593 """Verify delay is in valid value range."""
1595 if delay < MIN_DELAY:
1596 msg = '"' + str(delay) + '": Delay must be >=%s' % MIN_DELAY
1597 if delay > MAX_DELAY:
1598 msg = '"' + str(delay) + '": Delay must be <=%s' % MAX_DELAY
1613 - Access to:
1617 - /proc/sys/kernel/perf_event_paranoid < 1 if user has no
1619 - CAP_SYS_RESOURCE if the hard limit is not high enough to allow
1632 s set update interval (value range: 0.1-25.5 secs)
1642 sys.exit('Error while searching for guest "{}". Use "-p" to '
1648 sys.exit('Error: Multiple processes found (pids: {}). Use "-p"'
1655 argparser.add_argument('-1', '--once', '--batch',
1660 argparser.add_argument('-c', '--csv',
1663 help='log in csv format - requires option -l/-L',
1665 argparser.add_argument('-d', '--debugfs',
1670 argparser.add_argument('-f', '--fields',
1673 "-f help" for a list of available events''',
1675 argparser.add_argument('-g', '--guest',
1680 argparser.add_argument('-i', '--debugfs-include-past',
1686 argparser.add_argument('-l', '--log',
1691 argparser.add_argument('-L', '--log-to-file',
1694 help="like '--log', but logging to a file"
1696 argparser.add_argument('-p', '--pid',
1701 argparser.add_argument('-s', '--set-delay',
1704 metavar='DELAY',
1705 help='set delay between refreshs (value range: '
1706 '%s-%s secs)' % (MIN_DELAY, MAX_DELAY),
1708 argparser.add_argument('-t', '--tracepoints',
1713 argparser.add_argument('-z', '--skip-zero-records',
1720 sys.exit('Error: Option -c/--csv requires -l/--log')
1722 sys.exit('Error: Option -z/--skip-zero-records requires -l/-L')
1738 "when using the option -t (default).\n"
1757 for line in open('/proc/mounts'):
1758 if line.split(' ')[0] == 'debugfs':
1759 debugfs = line.split(' ')[1]
1765 "('mount -t debugfs debugfs /sys/kernel/debug')\n")