diff --git a/libs/api/Verifier.cpp b/libs/api/Verifier.cpp index b012fe392..e12ec40a9 100644 --- a/libs/api/Verifier.cpp +++ b/libs/api/Verifier.cpp @@ -108,7 +108,7 @@ ebpf_api_elf_enumerate_sections( } sequence.emplace_back(tlv_pack({tlv_pack(raw_program.section.c_str()), - tlv_pack(raw_program.info.type.platform_specific_data), + tlv_pack(raw_program.info.type.name.c_str()), tlv_pack(raw_program.info.map_descriptors.size()), tlv_pack(convert_ebpf_program_to_bytes(raw_program.prog)), tlv_pack(stats_sequence)})); diff --git a/tests/end_to_end/end_to_end.cpp b/tests/end_to_end/end_to_end.cpp index cd3551673..b3b42d2e9 100644 --- a/tests/end_to_end/end_to_end.cpp +++ b/tests/end_to_end/end_to_end.cpp @@ -378,7 +378,7 @@ TEST_CASE("enum section", "[enum sections]") auto stats_secton = tlv_next(program_bytes); REQUIRE(static_cast(section_name->type) == tlv_type_t::STRING); - REQUIRE(static_cast(type->type) == tlv_type_t::UINT); + REQUIRE(static_cast(type->type) == tlv_type_t::STRING); REQUIRE(static_cast(map_count->type) == tlv_type_t::UINT); REQUIRE(static_cast(program_bytes->type) == tlv_type_t::BLOB); REQUIRE(static_cast(stats_secton->type) == tlv_type_t::SEQUENCE); diff --git a/tools/netsh/elf.cpp b/tools/netsh/elf.cpp index b19e17284..5c5d185c8 100644 --- a/tools/netsh/elf.cpp +++ b/tools/netsh/elf.cpp @@ -151,8 +151,8 @@ handle_ebpf_show_sections( if (level == VL_NORMAL) { std::cout << "\n"; - std::cout << " Section Type # Maps Size\n"; - std::cout << "==================== ====== ====== ======\n"; + std::cout << " Section Type # Maps Size\n"; + std::cout << "==================== ========= ====== ======\n"; } for (auto current_section = tlv_child(section_data); current_section != tlv_next(section_data); current_section = tlv_next(current_section)) { @@ -162,13 +162,13 @@ handle_ebpf_show_sections( auto program_bytes = tlv_next(map_count); auto stats_section = tlv_next(program_bytes); if (level == VL_NORMAL) { - std::cout << std::setw(20) << std::right << tlv_value(section_name) << " " << std::setw(6) - << tlv_value(type) << " " << std::setw(6) << tlv_value(map_count) << " " + std::cout << std::setw(20) << std::right << tlv_value(section_name) << " " << std::setw(9) + << tlv_value(type) << " " << std::setw(6) << tlv_value(map_count) << " " << std::setw(6) << (program_bytes->length - offsetof(tlv_type_length_value_t, value)) / 8 << "\n"; } else { std::cout << "\n"; std::cout << "Section : " << tlv_value(section_name) << "\n"; - std::cout << "Program Type : " << tlv_value(type) << "\n"; + std::cout << "Program Type : " << tlv_value(type) << "\n"; std::cout << "# Maps : " << tlv_value(map_count) << "\n"; std::cout << "Size : " << (program_bytes->length - offsetof(tlv_type_length_value_t, value)) / 8 << " instructions\n";