Skip to content

Commit

Permalink
Merge pull request #40 from joular/develop
Browse files Browse the repository at this point in the history
0.7.1
  • Loading branch information
adelnoureddine authored Jan 30, 2024
2 parents 92d4a0e + 13031a2 commit 7b30c9e
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 36 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ We currently support the following Raspberry Pi and Asus Tinker Board models:
- Model 3 B+ (rev 1.3), for 32 bits OS
- Model 4 B (rev 1.1, and rev 1.2), for both 32 bits and 64 bits OS
- Model 400 (rev 1.0), for 64 bits OS
- Model 5 B (rev 1.0), for 64 bits OS
- Asus Tinker Board (S)

## :package: Installation
Expand Down Expand Up @@ -167,4 +168,4 @@ PowerJoular is licensed under the GNU GPL 3 license only (GPL-3.0-only).
Copyright (c) 2020-2023, Adel Noureddine, Université de Pau et des Pays de l'Adour.
All rights reserved. This program and the accompanying materials are made available under the terms of the GNU General Public License v3.0 only (GPL-3.0-only) which accompanies this distribution, and is available at: https://www.gnu.org/licenses/gpl-3.0.en.html

Author : Adel Noureddine
Author : Adel Noureddine
2 changes: 1 addition & 1 deletion alire.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "powerjoular"
description = "Monitoring the power consumption of multiple platforms and processes"
version = "0.7.0"
version = "0.7.1"

authors = ["Adel Noureddine"]
maintainers = ["Adel Noureddine <adel.noureddine@univ-pau.fr>"]
Expand Down
2 changes: 1 addition & 1 deletion installer/debian-control-amd64.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: powerjoular
Version: 0.7
Version: 0.7.1
Maintainer: Adel Noureddine
Architecture: amd64
Description: PowerJoular allows monitoring power consumption of multiple platforms and processes.
2 changes: 1 addition & 1 deletion installer/debian-control-arm64.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: powerjoular
Version: 0.7
Version: 0.7.1
Maintainer: Adel Noureddine
Architecture: arm64
Description: PowerJoular allows monitoring power consumption of multiple platforms and processes.
2 changes: 1 addition & 1 deletion installer/debian-control-armhf.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: powerjoular
Version: 0.7
Version: 0.7.1
Maintainer: Adel Noureddine
Architecture: armhf
Description: PowerJoular allows monitoring power consumption of multiple platforms and processes.
11 changes: 0 additions & 11 deletions installer/debian/create_deb.sh

This file was deleted.

5 changes: 0 additions & 5 deletions installer/debian/powerjoular/DEBIAN/control

This file was deleted.

This file was deleted.

Binary file removed installer/debian/powerjoular/usr/bin/powerjoular
Binary file not shown.
5 changes: 4 additions & 1 deletion powerjoular.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ project Powerjoular is
package Binder is
for Switches ("Ada") use ("-static");
end Binder;
package Compiler is
for Switches ("Ada") use ("-O3");
end Compiler;
for Create_Missing_Dirs use "True";
for Source_Dirs use ("src");
for Object_Dir use "obj";
for Main use ("powerjoular.adb");
end Powerjoular;
end Powerjoular;
4 changes: 2 additions & 2 deletions src/help_info.adb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
package body Help_Info is

procedure Show_Help is
Version_Number : constant String := "0.7.0";
Version_Number : constant String := "0.7.1";
begin
Put_Line (ESC & "[93m" & "~~ PowerJoular ~~" & ESC & "[0m");
Put_Line ("Version " & Version_Number);
Expand Down Expand Up @@ -52,7 +52,7 @@ package body Help_Info is
end;

procedure Show_Version is
Version_Number : constant String := "0.7.0";
Version_Number : constant String := "0.7.1";
begin
Put_Line (Version_Number);
end;
Expand Down
18 changes: 17 additions & 1 deletion src/os_utils.adb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ package body OS_Utils is
-- Check if platform supports Raspberry Pi
function Check_Raspberry_Pi_Supported_System (Platform_Name : in String) return Boolean is
begin
return Platform_Name in "rbp4001.0-64" | "rbp4b1.2" | "rbp4b1.2-64" | "rbp4b1.1" | "rbp4b1.1-64" | "rbp3b+1.3" | "rbp3b1.2" | "rbp2b1.1" | "rbp1b+1.2" | "rbp1b2" | "rbpzw1.1" | "asustbs";
return Platform_Name in "rbp5b1.0-64" | "rbp4001.0-64" | "rbp4b1.2" | "rbp4b1.2-64" | "rbp4b1.1" | "rbp4b1.1-64" | "rbp3b+1.3" | "rbp3b1.2" | "rbp2b1.1" | "rbp1b+1.2" | "rbp1b2" | "rbpzw1.1" | "asustbs";
end;

-- Get architecture name (uname -m)
Expand Down Expand Up @@ -67,6 +67,14 @@ package body OS_Utils is
Line_String := To_Unbounded_String (Get_Line (F_Name));

-- Specific model used to train the energy models

-- Raspberry Pi 5B 1.0
Index_Search := Index (To_String (Line_String), "Raspberry Pi 5 Model B Rev 1.0");
if (Index_Search > 0) then
if (Architecture_Name = "aarch64") then
return "rbp5b1.0-64";
end if;
end if;

-- Raspberry Pi 400 1.0
Index_Search := Index (To_String (Line_String), "Raspberry Pi 400 Rev 1.0");
Expand Down Expand Up @@ -140,6 +148,14 @@ package body OS_Utils is

-- Supporting other revisions where specific energy models were not generated
-- In this case, we use the model of the same RPi model but different revision

-- Raspberry Pi 5B
Index_Search := Index (To_String (Line_String), "Raspberry Pi 5 Model B");
if (Index_Search > 0) then
if (Architecture_Name = "aarch64") then
return "rbp5b1.0-64";
end if;
end if;

-- Raspberry Pi 400
Index_Search := Index (To_String (Line_String), "Raspberry Pi 400");
Expand Down
18 changes: 18 additions & 0 deletions src/raspberry_pi_cpu_formula.adb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@ package body Raspberry_Pi_CPU_Formula is
begin
-- Formulas are based on empirical experimentation and linear/polynomial regression

if (Platform_Name = "rbp51.0-64") then
if (Algorithm_Name = "linear") then
return (3.457855981342954 * CPU_Utilization) + 4.403192179893827;
elsif (Algorithm_Name = "polynomial") then
return 8.71648242592654 + (-186.5634686 * (CPU_Utilization ** 1)) +
(2676.08397456 * (CPU_Utilization ** 2)) +
(-18839.18873015 * (CPU_Utilization ** 3)) +
(75110.3949109 * (CPU_Utilization ** 4)) +
(-180373.73562042 * (CPU_Utilization ** 5)) +
(267380.23597063 * (CPU_Utilization ** 6)) +
(-240403.81341249 * (CPU_Utilization ** 7)) +
(120509.01405772 * (CPU_Utilization ** 8)) +
(-25877.41360901 * (CPU_Utilization ** 9));
else
return 0.0;
end if;
end if;

if (Platform_Name = "rbp4001.0-64") then
if (Algorithm_Name = "linear") then
return (5.025368568347057 * CPU_Utilization) + 1.8221330203847232;
Expand Down

0 comments on commit 7b30c9e

Please sign in to comment.