Skip to content

Commit

Permalink
Remove params with default values
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <[email protected]>
  • Loading branch information
Alan Jowett committed Nov 21, 2024
1 parent b742962 commit e46f1b4
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/upload-perf-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
export PGUSER=$(cat ${{github.workspace}}/PGUSER)
export PGPORT=$(cat ${{github.workspace}}/PGPORT)
export PGDATABASE=$(cat ${{github.workspace}}/PGDATABASE)
psql -f /mnt/d/bpf_performance/scripts/check_perf_results.sql -v platform='${{inputs.platform}}' -v max_sigma=2 -v look_back='30 days' -v repository=microsoft/ebpf-for-windows --csv > ${{github.workspace}}/results/regression_results.csv
psql -f /mnt/d/bpf_performance/scripts/check_perf_results.sql -v platform='${{inputs.platform}}' --csv > ${{github.workspace}}/results/regression_results.csv
- name: Upload regression results
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
Expand Down
43 changes: 43 additions & 0 deletions tests/sample/undocked/ringbuf_in_map_btf.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright (c) eBPF for Windows contributors
// SPDX-License-Identifier: MIT

// Whenever this sample program changes, bpf2c_tests will fail unless the
// expected files in tests\bpf2c_tests\expected are updated. The following
// script can be used to regenerate the expected files:
// generate_expected_bpf2c_output.ps1
//
// Usage:
// .\scripts\generate_expected_bpf2c_output.ps1 <build_output_path>
// Example:
// .\scripts\generate_expected_bpf2c_output.ps1 .\x64\Debug\
#include "bpf_helpers.h"
#include "sample_ext_helpers.h"

struct
{
__uint(type, BPF_MAP_TYPE_RINGBUF);
__uint(max_entries, 64 * 1024);
} inner_map SEC(".maps");

struct
{
__uint(type, BPF_MAP_TYPE_ARRAY_OF_MAPS);
__type(key, uint32_t);
__type(value, uint32_t);
__uint(max_entries, 1);
__array(values, inner_map);
} outer_map SEC(".maps");

SEC("sample_ext") int lookup(sample_program_context_t* ctx)
{
uint8_t sample[] = "Hello, world!";
// Publish sample to per-cpu ringbuf
uint32_t key = bpf_get_smp_processor_id();
struct bpf_map* map = bpf_map_lookup_elem(&outer_map, &key);
if (map) {
(void)bpf_ringbuf_output(map, sample, sizeof(sample), 0);
}

return 0;
}

0 comments on commit e46f1b4

Please sign in to comment.