if we call tegrastats, dmesg will print “Tegra stats are disabled”. our system monitor service need to call tegrastats periodically, how to avoid print this log.
echo Y | sudo tee /sys/kernel/debug/pva0/stats_enabled, this cmd can work.
is there any recommended method to avoid print “Tegra stats are disabled“?
yes, we run the tegrastats as root, because we need to sample many system info, not only tegrastats, we need to run as root.
i also tried run tegrastats as not root, do not print this log info.
so if we need to run as root, how can we avoid print this log info?
hi, is there any update of this issue?
can i use this cmd to avoid print these logs.
”echo Y | sudo tee /sys/kernel/debug/pva0/stats_enabled”
i already tried this cmd, there is no different at tegrastats’s output, when input this cmd, or not input this cmd.
the default value of stats_enabled is N, if we set stats_enabled as Y, it will not print the log, and the tegrastats output seems the same as stats_enabled as N.
is it ok to set stats_enabled as Y at the .bashrc? is there any different when set stats_enabled as Y and N?
Hi,
if /sys/kernel/debug/pva0/stats_enabled as N, sudo tegrastats --start will print “Tegra stats are disabled” all the time.
is that ok to set /sys/kernel/debug/pva0/stats_enabled as Y in the .bashrc?
I just looked in dmesg and kernel really does not seem to like tegrastats.
This might be better than .bashrc
# Service: writes Y once
sudo tee /etc/systemd/system/pva-stats.service >/dev/null <<'EOF'
[Unit]
Description=Enable PVA stats
RequiresMountsFor=/sys/kernel/debug
ConditionPathExists=/sys/kernel/debug/pva0/stats_enabled
[Service]
Type=oneshot
ExecStart=/bin/sh -c 'echo Y > /sys/kernel/debug/pva0/stats_enabled'
EOF
# Path unit: runs the service when the file appears
sudo tee /etc/systemd/system/pva-stats.path >/dev/null <<'EOF'
[Unit]
Description=Watch for PVA stats file and enable it
[Path]
PathExists=/sys/kernel/debug/pva0/stats_enabled
[Install]
WantedBy=multi-user.target
EOF
# Enable start it now.
sudo systemctl daemon-reload
sudo systemctl enable --now pva-stats.path
# check it now or after a reboot
systemctl status pva-stats.path
sudo cat /sys/kernel/debug/pva0/stats_enabled