c3a095a180
Updates:
* [rocm-smi] Provide a thread-safe logging feature
* [rocm-smi] Adding logrotation into install/upgrade/remove
scripts
* [rocm-smi] Updated cmake lists to include rocm_smi_logger
* [rocm-smi] Updated DEB/RPM install/remove logging file &
folder with all users having r/w privledges for
/var/log/rocm_smi_lib/ROCm-SMI-lib.log
* [rocm-smi] Added ability to do a glob search for multiple files
(globFileExists), assists doing file searches with * strings
* [rocm-smi] Added ability to log system details when RSMI_LOGGING
is turned on (getSystemDetails())
* [rocm-smi] Added logging to provide which ROCm API is being called
when RSMI_LOGGING is on
* [rocm-smi] Added logging to provide SYSFS path and read value,
when RSMI_LOGGING is on. Provides error reponse on failure.
* [rocm-smi] Added logging to provide SYSFS path and read value,
when RSMI_LOGGING is on. Provides error reponse on failure.
* [rocm-smi] Added environment variable RSMI_LOGGING to control
when logging is enabled or disabled. By default, by not
setting this env. variable, logging is turned off. When
setting RSMI_LOGGING=<any value>, logging is enabled
which is placed in /var/log/rocm_smi_lib/ROCm-SMI-lib.log file.
Setting RSMI_LOGGING is allowed in both debug and release builds.
* [rocm-smi] Removed an initialize procedure which keeps
debug_inf_loop. Seems this feature is not being used.
Change-Id: I79b48387609c6233c6f05b04fb8bba66b68c2399
Signed-off-by: Charis Poag <Charis.Poag@amd.com>
49 خطوط
1.1 KiB
Bash
Executable File
49 خطوط
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
rm_logFolder() {
|
|
sudo rm -rf /var/log/rocm_smi_lib
|
|
}
|
|
|
|
return_logrotateToOrigConfig() {
|
|
if [ -f /etc/logrotate.d/rocm_smi.conf ]; then
|
|
sudo rm -rf /etc/logrotate.d/rocm_smi.conf
|
|
fi
|
|
if [ -f /etc/cron.hourly/logrotate ]; then
|
|
sudo mv /etc/cron.hourly/logrotate /etc/cron.daily/logrotate
|
|
fi
|
|
if [ -f /lib/systemd/system/logrotate.timer.backup ]; then
|
|
sudo cp /lib/systemd/system/logrotate.timer.backup /lib/systemd/system/logrotate.timer
|
|
sudo rm -rf /lib/systemd/system/logrotate.timer.backup
|
|
sudo systemctl reenable --now logrotate.timer
|
|
fi
|
|
}
|
|
|
|
rm_ldconfig() {
|
|
# left-hand term originates from ENABLE_LDCONFIG = ON/OFF at package build
|
|
if [ "@ENABLE_LDCONFIG@" == "ON" ]; then
|
|
rm -f /etc/ld.so.conf.d/x86_64-librocm_smi_lib.conf
|
|
ldconfig
|
|
fi
|
|
}
|
|
|
|
rm_pyc() {
|
|
# remove pyc file generated by python
|
|
rm -rf @CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/rocm_smi/__pycache__
|
|
}
|
|
|
|
case "$1" in
|
|
( remove | upgrade)
|
|
rm_ldconfig
|
|
rm_pyc
|
|
rm_logFolder
|
|
return_logrotateToOrigConfig
|
|
;;
|
|
( purge )
|
|
;;
|
|
( * )
|
|
exit 0
|
|
;;
|
|
esac
|