Signed-off-by: Alan Jowett <alanjo@microsoft.com>

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
This commit is contained in:
Alan Jowett 2021-09-13 10:54:10 -06:00 коммит произвёл GitHub
Родитель b6a0fb84b9
Коммит f661e74d82
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -15,6 +15,11 @@ test_utility_helper_functions(struct bpf_map* utility_map)
// Get a random number.
test_data.random = bpf_get_prandom_u32();
// Test assumes time stamps are ordered as follows:
// test_data[0].boot_timestamp
// test_data[0].timestamp
// test_data[1].timestamp
// test_data[1].boot_timestamp
// Get current timestamp.
test_data.boot_timestamp = bpf_ktime_get_boot_ns();
@ -31,10 +36,10 @@ test_utility_helper_functions(struct bpf_map* utility_map)
test_data.random = bpf_get_prandom_u32();
// Get current timestamp.
test_data.boot_timestamp = bpf_ktime_get_boot_ns();
test_data.timestamp = bpf_ktime_get_ns();
// Get current timestamp.
test_data.timestamp = bpf_ktime_get_ns();
test_data.boot_timestamp = bpf_ktime_get_boot_ns();
// Write into test utility_map index 1.
bpf_map_update_elem(utility_map, &keys[1], &test_data, 0);