Skip to content

Commit ee918f8

Browse files
mchinthlijinxia
authored andcommitted
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 <manisha.chinthapally@intel.com>
1 parent 7f57a74 commit ee918f8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

hypervisor/debug/profiling.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ static int profiling_generate_data(int32_t collector, uint32_t type)
336336
pkt_header.collector_id = collector;
337337
pkt_header.cpu_id = get_cpu_id();
338338
pkt_header.data_type = 1U << type;
339+
pkt_header.reserved = MAGIC_NUMBER;
339340

340341
switch (type) {
341342
case CORE_PMU_SAMPLING:
@@ -534,7 +535,7 @@ static void profiling_handle_msrops(void)
534535
* if 'param' is 0, then skip generating a sample since it is
535536
* an immediate MSR read operation.
536537
*/
537-
if (my_msr_node->entries[0].param == 0UL) {
538+
if (my_msr_node->entries[0].param != 0UL) {
538539
for (j = 0U; j < my_msr_node->num_entries; ++j) {
539540
sw_msrop->core_msr[j]
540541
= my_msr_node->entries[j].value;

hypervisor/include/debug/profiling_internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define SEP_BUF_ENTRY_SIZE 32U
2222
#define SOCWATCH_MSR_OP 100U
2323

24+
#define MAGIC_NUMBER 0x99999988U
2425
enum MSR_CMD_STATUS {
2526
MSR_OP_READY = 0,
2627
MSR_OP_REQUESTED,

0 commit comments

Comments
 (0)