From c8d0f3a61c3551806c287ef37d6334de9348d41f Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Mon, 8 Jan 2024 17:34:44 +0900 Subject: [PATCH] tools: resource-monitor: Add hal-api-foo test code Change-Id: If356674e4b45826846243a3a1e6c77f07b32321e Signed-off-by: Chanwoo Choi --- packaging/pass.spec | 1 + tools/resource-monitor/CMakeLists.txt | 1 + tools/resource-monitor/resource-monitor.c | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/packaging/pass.spec b/packaging/pass.spec index f2384f2..b77fb29 100644 --- a/packaging/pass.spec +++ b/packaging/pass.spec @@ -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) diff --git a/tools/resource-monitor/CMakeLists.txt b/tools/resource-monitor/CMakeLists.txt index 8746e13..a45a93b 100644 --- a/tools/resource-monitor/CMakeLists.txt +++ b/tools/resource-monitor/CMakeLists.txt @@ -20,6 +20,7 @@ pkg_check_modules(gtest_pkgs REQUIRED json-c cynara-client cynara-session + hal-api-foo ) FOREACH(flag ${gtest_pkgs_CFLAGS}) diff --git a/tools/resource-monitor/resource-monitor.c b/tools/resource-monitor/resource-monitor.c index 47dba1e..8ce6856 100644 --- a/tools/resource-monitor/resource-monitor.c +++ b/tools/resource-monitor/resource-monitor.c @@ -32,6 +32,8 @@ #include "resource-monitor.h" +#include + #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); } -- 2.7.4