-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): check epc size instructions and script (#342)
* add script for checking epc size * add instructions in doc * more info
- Loading branch information
1 parent
f396354
commit 4235d32
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Run dmesg and filter for EPC section | ||
epc_line=$(sudo dmesg | fgrep EPC) | ||
|
||
# Extract the start and end addresses using regex | ||
if [[ $epc_line =~ 0x([0-9a-fA-F]+)-0x([0-9a-fA-F]+) ]]; then | ||
start_address=0x${BASH_REMATCH[1]} | ||
end_address=0x${BASH_REMATCH[2]} | ||
|
||
# Calculate the EPC size in GB using Python | ||
epc_size_gb=$(python3 -c "print(($end_address - $start_address) / 1024 ** 3)") | ||
|
||
echo "EPC Size: $epc_size_gb GB" | ||
else | ||
echo "EPC section not found in dmesg output." | ||
fi |