tools: resource-monitor: Add hal-api-foo test code sandbox/chanwoochoi/hal-api-foo-test
authorChanwoo Choi <cw00.choi@samsung.com>
Mon, 8 Jan 2024 08:34:44 +0000 (17:34 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 8 Jan 2024 08:34:44 +0000 (17:34 +0900)
Change-Id: If356674e4b45826846243a3a1e6c77f07b32321e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
packaging/pass.spec
tools/resource-monitor/CMakeLists.txt
tools/resource-monitor/resource-monitor.c

index f2384f2..b77fb29 100644 (file)
@@ -31,6 +31,7 @@ BuildRequires:  pkgconfig(json-c)
 BuildRequires:  pkgconfig(hal-api-power)
 BuildRequires:  pkgconfig(cynara-client)
 BuildRequires:  pkgconfig(cynara-session)
+BuildRequires:  pkgconfig(hal-api-foo)
 
 %description
 PASS  (Power-Aware System Service)
index 8746e13..a45a93b 100644 (file)
@@ -20,6 +20,7 @@ pkg_check_modules(gtest_pkgs REQUIRED
        json-c
        cynara-client
        cynara-session
+       hal-api-foo
 )
 
 FOREACH(flag ${gtest_pkgs_CFLAGS})
index 47dba1e..8ce6856 100644 (file)
@@ -32,6 +32,8 @@
 
 #include "resource-monitor.h"
 
+#include <hal/hal-foo.h>
+
 #define BUFF_MAX       255
 #define MAX_RESOURCE   100
 #define MAX_ATTR       64
@@ -528,6 +530,8 @@ static void resource_monitor(void)
        int count = 0;
        int i, j;
 
+       hal_foo_get_backend();
+
        while (1) {
                if (g_data.max != -1 && g_data.max <= count++)
                        break;
@@ -551,7 +555,13 @@ static void resource_monitor(void)
                        printf("\n");
                }
                sleep(g_data.secs);
+
+               printf("hal_foo_start() : %d\n", hal_foo_start());
+               printf("hal_foo_stop()  : %d\n", hal_foo_stop());
        }
+
+       hal_foo_put_backend();
+
        resource_monitor_exit(0);
 }