-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add power_envelope
& soc_power
sensors
#112
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -694,6 +694,48 @@ case "$temp" in | |
;; | ||
esac | ||
|
||
################################### | ||
# Get SOC power info # | ||
################################### | ||
SOC_POWER_PATH="/sys/kernel/debug/mlxbf-ptm/monitors/status/total_power" | ||
if [ ! -f "$SOC_POWER_PATH" ]; then | ||
echo "Error: soc_power file not found try to load the driver with: modprobe mlxbf-ptm" | ||
remove_sensor "soc_power" | ||
else | ||
soc_power=$(cat "$SOC_POWER_PATH") | ||
trindenau marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#check of soc_power is decimal number. | ||
if ! [[ "$soc_power" =~ ^([0-9]+(\.[0-9]+)?|0)$ ]]; then | ||
echo "Error: soc_power is not a valid number" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @trindenau - indentation |
||
remove_sensor "soc_power" | ||
else | ||
# Remove all the number after the decimal point – it can cause issues in the ipmb | ||
soc_power=$((${soc_power%.*})) | ||
# echo the soc_power value in to /run/emu_param/soc_power | ||
echo "$soc_power" > "${EMU_PARAM_DIR}/soc_power" | ||
fi | ||
fi | ||
|
||
################################### | ||
# Get power envelope info # | ||
################################### | ||
POWER_ENVELOPE_PATH="/sys/kernel/debug/mlxbf-ptm/monitors/status/power_envelope" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @trindenau - same as above, this need to be defined in the arch There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the right path according to the arch doc |
||
if [ ! -f "$POWER_ENVELOPE_PATH" ]; then | ||
echo "Error: power_envelope file not found try to load the driver with: modprobe mlxbf-ptm" | ||
remove_sensor "power_envelope" | ||
else | ||
power_envelope=$(cat "$POWER_ENVELOPE_PATH") | ||
#check of power_envelope is decimal number. | ||
if ! [[ "$power_envelope" =~ ^-?[0-9]+(\.[0-9]+)?$ ]]; then | ||
echo "Error: power_envelope is not a valid number" | ||
remove_sensor "power_envelope" | ||
else | ||
# Remove all the number after the decimal point – it can cause issues in the ipmb | ||
power_envelope=$((${power_envelope%.*})) | ||
# echo the power_envelope value in to /run/emu_param/power_envelope | ||
echo "$power_envelope" > "${EMU_PARAM_DIR}/power_envelope" | ||
fi | ||
fi | ||
|
||
################################### | ||
# Get FW info # | ||
################################### | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trindenau - is this path defined in Yochai arch doc? if not we need to make sure he define the path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the right path according to the arch doc