power: extend debugs on power instruction requests

Message ID 20190328161154.20944-1-lukaszx.krakowiak@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series power: extend debugs on power instruction requests |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing fail Performance Testing issues

Commit Message

Lukasz Krakowiak March 28, 2019, 4:11 p.m. UTC
  Extend debugs on power instruction and cmd police destroy
requests.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
---
 examples/vm_power_manager/channel_monitor.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
  

Comments

Thomas Monjalon March 29, 2019, 10:35 p.m. UTC | #1
28/03/2019 17:11, Lukasz Krakowiak:
> Extend debugs on power instruction and cmd police destroy
> requests.
> 
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>

Applied, thanks
  

Patch

diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c
index 1a3a0fa76..32865da37 100644
--- a/examples/vm_power_manager/channel_monitor.c
+++ b/examples/vm_power_manager/channel_monitor.c
@@ -630,6 +630,8 @@  apply_policy(struct policy *pol)
 static int
 process_request(struct channel_packet *pkt, struct channel_info *chan_info)
 {
+	int ret;
+
 	if (chan_info == NULL)
 		return -1;
 
@@ -645,6 +647,9 @@  process_request(struct channel_packet *pkt, struct channel_info *chan_info)
 		else
 			core_num = pkt->resource_id;
 
+		RTE_LOG(DEBUG, CHANNEL_MONITOR, "Processing requested cmd for cpu:%d\n",
+			core_num);
+
 		switch (pkt->unit) {
 		case(CPU_POWER_SCALE_MIN):
 			power_manager_scale_core_min(core_num);
@@ -677,9 +682,13 @@  process_request(struct channel_packet *pkt, struct channel_info *chan_info)
 	}
 
 	if (pkt->command == PKT_POLICY_REMOVE) {
-		RTE_LOG(INFO, CHANNEL_MONITOR,
-				 "Removing policy %s\n", pkt->vm_name);
-		remove_policy(pkt);
+		ret = remove_policy(pkt);
+		if (ret == 0)
+			RTE_LOG(INFO, CHANNEL_MONITOR,
+				 "Removed policy %s\n", pkt->vm_name);
+		else
+			RTE_LOG(INFO, CHANNEL_MONITOR,
+				 "Policy %s does not exist\n", pkt->vm_name);
 	}
 
 	/*