Browse Source

[#55970] watch.py: graph.py: Moved tmpfs monitoring to use /proc/meminfo

This commit replaces the df-based tmpfs usage graphs with meminfo-based one.
Shmem is the metric monitored and it always includes all tmpfs mounts, but also
includes some kernel-specific buffers and shared memory within the system

Signed-off-by: Jan Bylicki <jbylicki@antmicro.com>
main
Jan Bylicki 2 years ago
parent
commit
4a9ea12e5f
  1. 2
      graph.py
  2. 4
      watch.py

2
graph.py

@ -124,7 +124,7 @@ def plot_stacked(ylabel, title, session, column, tmpfs_color, other_cache_color,
g('set style histogram rowstacked')
g('set key reverse below Left width -25')
g(f"plot '{session}.txt' using 1:($8 + ${column}):{column} title 'RAM' with boxes palette, \
'' using 1:8 with boxes title 'tmpfs' lc rgb '{tmpfs_color}', \
'' using 1:8 with boxes title 'Shared mem' lc rgb '{tmpfs_color}', \
'' using 1:($8 - $7) with boxes title 'Other cache (freed automatically)' lc rgb '{other_cache_color}'")
g('unset key')
# Read additional information from 'data.txt' comments

4
watch.py

@ -214,8 +214,8 @@ def watch(session, fsdev, iface, tmpfs_color, other_cache_color):
my_env = os.environ
my_env["S_TIME_FORMAT"] = "ISO"
p = run_or_fail("sar", "-F", "-u", "-r", "-n", "DEV", "1", stdout=subprocess.PIPE, env=my_env)
p2 = run_or_fail("while true; do df -t tmpfs --output=used | awk '{sum+=$1} END {print sum}'; sleep 1; done", shell=True, stdout=subprocess.PIPE, env=my_env)
p = run_or_fail("sar", "-F", "-u", "-r", "ALL", "-n", "DEV", "1", stdout=subprocess.PIPE, env=my_env)
p2 = run_or_fail("while true; do cat /proc/meminfo | grep Shmem\: | awk '{print $2}'; sleep 1; done", shell=True, stdout=subprocess.PIPE, env=my_env)
# subprocess for GPU data fetching in the background
try:
pgpu = subprocess.Popen(

Loading…
Cancel
Save