@@ -370,7 +370,7 @@ struct partition_info
370
370
371
371
struct context_health_info {
372
372
373
- static ert_ctx_health_data
373
+ static xrt_core::query::context_health_info::smi_context_health
374
374
fill_health_entry (const amdxdna_drm_hwctx_entry& entry)
375
375
{
376
376
ert_ctx_health_data new_entry{};
@@ -380,7 +380,12 @@ struct context_health_info {
380
380
new_entry.fatal_error_exception_type = entry.fatal_error_exception_type ;
381
381
new_entry.fatal_error_exception_pc = entry.fatal_error_exception_pc ;
382
382
new_entry.fatal_error_app_module = entry.fatal_error_app_module ;
383
- return new_entry;
383
+
384
+ xrt_core::query::context_health_info::smi_context_health val{};
385
+ val.ctx_id = entry.context_id ;
386
+ val.pid = entry.pid ;
387
+ val.health_data = new_entry;
388
+ return val;
384
389
}
385
390
using result_type = std::any;
386
391
@@ -589,15 +594,25 @@ struct event_trace
589
594
}
590
595
591
596
static result_type
592
- get (const xrt_core::device* device, key_type key)
597
+ get (const xrt_core::device* device, key_type key, const std::any& any )
593
598
{
594
599
switch (key) {
595
- case key_type::event_trace_data:
596
- {
597
- // static query::firmware_debug_buffer log_buffer;
598
- // TODO : implement IOCTL to get event_trace data
599
- // return log_buffer;
600
+ case key_type::event_trace_data:
601
+ {
602
+ // static query::firmware_debug_buffer log_buffer;
603
+ // TODO : implement IOCTL to get event_trace data
604
+ // return log_buffer;
605
+ }
606
+ default :
607
+ throw xrt_core::error (" Unsupported event_trace query key" );
600
608
}
609
+ // TODO : Implement IOCTL to get event_trace configuration
610
+ }
611
+
612
+ static result_type
613
+ get (const xrt_core::device* device, key_type key)
614
+ {
615
+ switch (key) {
601
616
case key_type::event_trace_version:
602
617
{
603
618
// query::event_trace_version::result_type version;
@@ -633,15 +648,26 @@ struct firmware_log
633
648
}
634
649
635
650
static result_type
636
- get (const xrt_core::device* device, key_type key)
651
+ get (const xrt_core::device* device, key_type key, const std::any& any )
637
652
{
638
653
switch (key) {
639
- case key_type::firmware_log_data:
640
- {
641
- // static query::firmware_debug_buffer log_buffer;
642
- // TODO : implement IOCTL to get firmware log data
643
- // return log_buffer;
654
+ case key_type::firmware_log_data:
655
+ {
656
+ // static query::firmware_debug_buffer log_buffer;
657
+ // TODO : implement IOCTL to get firmware_log data
658
+ // return log_buffer;
659
+ }
660
+ default :
661
+ throw xrt_core::error (" Unsupported firmware_log query key" );
644
662
}
663
+ // TODO : Implement IOCTL to get firmware_log configuration
664
+ }
665
+
666
+ static result_type
667
+ get (const xrt_core::device* device, key_type key)
668
+ {
669
+ switch (key) {
670
+
645
671
case key_type::firmware_log_version:
646
672
{
647
673
// query::firmware_log_version::result_type version;
@@ -664,6 +690,39 @@ struct firmware_log
664
690
}
665
691
};
666
692
693
+ struct archive_path
694
+ {
695
+ using result_type = query::archive_path::result_type;
696
+
697
+ static result_type
698
+ get (const xrt_core::device* device, key_type key)
699
+ {
700
+ const auto & pcie_id = xrt_core::device_query<xrt_core::query::pcie_id>(device);
701
+ xrt_core::smi::smi_hardware_config smi_hrdw;
702
+ auto hardware_type = smi_hrdw.get_hardware_type (pcie_id);
703
+
704
+ switch (key) {
705
+ case key_type::archive_path:
706
+ {
707
+ switch (hardware_type)
708
+ {
709
+ case xrt_core::smi::smi_hardware_config::hardware_type::stxA0:
710
+ case xrt_core::smi::smi_hardware_config::hardware_type::stxB0:
711
+ case xrt_core::smi::smi_hardware_config::hardware_type::stxH:
712
+ case xrt_core::smi::smi_hardware_config::hardware_type::krk1:
713
+ return std::string (get_shim_data_dir () + " bins/xrt_smi_strx.a" );
714
+ case xrt_core::smi::smi_hardware_config::hardware_type::phx:
715
+ return std::string (get_shim_data_dir () + " bins/xrt_smi_phx.a" );
716
+ default :
717
+ throw xrt_core::error (" Unsupported hardware type" );
718
+ }
719
+ }
720
+ default :
721
+ throw xrt_core::error (" Unsupported archive_path query key" );
722
+ }
723
+ }
724
+ };
725
+
667
726
struct frame_boundary_preemption
668
727
{
669
728
using result_type = query::frame_boundary_preemption::result_type;
@@ -1596,14 +1655,15 @@ initialize_query_table()
1596
1655
emplace_func0_getput<query::preemption, preemption>();
1597
1656
emplace_func0_getput<query::frame_boundary_preemption, frame_boundary_preemption>();
1598
1657
1599
- emplace_func0_request <query::event_trace_data, event_trace>();
1658
+ emplace_func1_request <query::event_trace_data, event_trace>();
1600
1659
emplace_func0_request<query::event_trace_version, event_trace>();
1601
1660
emplace_func0_request<query::event_trace_config, event_trace>();
1602
1661
emplace_func0_getput<query::event_trace_state, event_trace>();
1603
- emplace_func0_request <query::firmware_log_data, firmware_log>();
1662
+ emplace_func1_request <query::firmware_log_data, firmware_log>();
1604
1663
emplace_func0_request<query::firmware_log_version, firmware_log>();
1605
1664
emplace_func0_request<query::firmware_log_config, firmware_log>();
1606
1665
emplace_func0_getput<query::firmware_log_state, firmware_log>();
1666
+ emplace_func0_request<query::archive_path, archive_path>();
1607
1667
emplace_func0_request<query::aie_telemetry, telemetry>();
1608
1668
emplace_func0_request<query::misc_telemetry, telemetry>();
1609
1669
emplace_func0_request<query::opcode_telemetry, telemetry>();
0 commit comments