From ee918f85339ff214d2effdd14f4f956fe37b7bee Mon Sep 17 00:00:00 2001 From: Manisha Chinthapally Date: Thu, 1 Nov 2018 09:51:32 -0700 Subject: [PATCH] HV:debug:profiling Fixed inappropriate condition check Fixed the condition to be able to collect MSR sample data Also populating addition information to help identifity appropriate data Tracked-On: #1693 Signed-off-by: Manisha Chinthapally --- hypervisor/debug/profiling.c | 3 ++- hypervisor/include/debug/profiling_internal.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hypervisor/debug/profiling.c b/hypervisor/debug/profiling.c index 9ee02036b..431512ed7 100644 --- a/hypervisor/debug/profiling.c +++ b/hypervisor/debug/profiling.c @@ -336,6 +336,7 @@ static int profiling_generate_data(int32_t collector, uint32_t type) pkt_header.collector_id = collector; pkt_header.cpu_id = get_cpu_id(); pkt_header.data_type = 1U << type; + pkt_header.reserved = MAGIC_NUMBER; switch (type) { case CORE_PMU_SAMPLING: @@ -534,7 +535,7 @@ static void profiling_handle_msrops(void) * if 'param' is 0, then skip generating a sample since it is * an immediate MSR read operation. */ - if (my_msr_node->entries[0].param == 0UL) { + if (my_msr_node->entries[0].param != 0UL) { for (j = 0U; j < my_msr_node->num_entries; ++j) { sw_msrop->core_msr[j] = my_msr_node->entries[j].value; diff --git a/hypervisor/include/debug/profiling_internal.h b/hypervisor/include/debug/profiling_internal.h index dcb1d985b..09d178f69 100644 --- a/hypervisor/include/debug/profiling_internal.h +++ b/hypervisor/include/debug/profiling_internal.h @@ -21,6 +21,7 @@ #define SEP_BUF_ENTRY_SIZE 32U #define SOCWATCH_MSR_OP 100U +#define MAGIC_NUMBER 0x99999988U enum MSR_CMD_STATUS { MSR_OP_READY = 0, MSR_OP_REQUESTED,