From 03b6da2ab2a8d755a944759e7b0661ded5051c14 Mon Sep 17 00:00:00 2001 From: Sharmi Date: Mon, 25 Nov 2024 16:44:22 -0600 Subject: [PATCH] Add EBPF_LOG_MAP_OPERATION in ebpf_map find, update and delete function (#4032) * Add EBPF_LOG_MAP_OPERATION in find,update and delete function * expand stack to 16KB. --------- Co-authored-by: Alan Jowett Co-authored-by: Shankar Seal --- libs/execution_context/ebpf_maps.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/execution_context/ebpf_maps.c b/libs/execution_context/ebpf_maps.c index 54d3b3dc89..4f064716ed 100644 --- a/libs/execution_context/ebpf_maps.c +++ b/libs/execution_context/ebpf_maps.c @@ -2576,6 +2576,8 @@ ebpf_map_find_entry( return EBPF_OPERATION_NOT_SUPPORTED; } + EBPF_LOG_MAP_OPERATION(flags, "find", map, key); + if ((flags & EBPF_MAP_FLAG_HELPER) && (table->get_object_from_entry != NULL)) { // Disallow reads to prog array maps from this helper call for now. @@ -2708,6 +2710,8 @@ ebpf_map_update_entry( return EBPF_OPERATION_NOT_SUPPORTED; } + EBPF_LOG_MAP_OPERATION(flags, "update", map, key); + if ((flags & EBPF_MAP_FLAG_HELPER) && (table->update_entry_per_cpu != NULL)) { result = table->update_entry_per_cpu(map, key, value, option); } else { @@ -2773,6 +2777,8 @@ ebpf_map_delete_entry(_In_ ebpf_map_t* map, size_t key_size, _In_reads_(key_size return EBPF_OPERATION_NOT_SUPPORTED; } + EBPF_LOG_MAP_OPERATION(flags, "delete", map, key); + ebpf_result_t result = table->delete_entry(map, key); return result; }