integration-test: clang-format C files

reviewable/pr638/r29
Tamir Duberstein 1 year ago
parent bcbb7e08fa
commit 72afd877b5
No known key found for this signature in database

@ -1,10 +1,9 @@
// clang-format off
#include <linux/bpf.h> #include <linux/bpf.h>
#include <bpf/bpf_helpers.h> #include <bpf/bpf_helpers.h>
// clang-format on
SEC("xdp") SEC("xdp")
int xdp_drop(struct xdp_md *ctx) int xdp_drop(struct xdp_md *ctx) { return XDP_DROP; }
{
return XDP_DROP;
}
char _license[] SEC("license") = "GPL"; char _license[] SEC("license") = "GPL";

@ -1,10 +1,9 @@
// clang-format off
#include <linux/bpf.h> #include <linux/bpf.h>
#include <bpf/bpf_helpers.h> #include <bpf/bpf_helpers.h>
// clang-format on
SEC("xdp") SEC("xdp")
int xdp_pass(struct xdp_md *ctx) int xdp_pass(struct xdp_md *ctx) { return XDP_PASS; }
{
return XDP_PASS;
}
char _license[] SEC("license") = "GPL"; char _license[] SEC("license") = "GPL";

@ -1,5 +1,7 @@
// clang-format off
#include <linux/bpf.h> #include <linux/bpf.h>
#include <bpf/bpf_helpers.h> #include <bpf/bpf_helpers.h>
// clang-format on
struct { struct {
__uint(type, BPF_MAP_TYPE_ARRAY); __uint(type, BPF_MAP_TYPE_ARRAY);
@ -15,10 +17,8 @@ struct {
__uint(max_entries, 1); __uint(max_entries, 1);
} map_2 SEC(".maps"); } map_2 SEC(".maps");
SEC("tracepoint") SEC("tracepoint")
int bpf_prog(void *ctx) int bpf_prog(void *ctx) {
{
__u32 key = 0; __u32 key = 0;
__u64 twenty_four = 24; __u64 twenty_four = 24;
__u64 forty_two = 42; __u64 forty_two = 42;

@ -1,5 +1,7 @@
// clang-format off
#include <linux/bpf.h> #include <linux/bpf.h>
#include <bpf/bpf_helpers.h> #include <bpf/bpf_helpers.h>
// clang-format on
char _license[] SEC("license") = "GPL"; char _license[] SEC("license") = "GPL";
@ -10,19 +12,14 @@ struct {
__uint(max_entries, 2); __uint(max_entries, 2);
} RESULTS SEC(".maps"); } RESULTS SEC(".maps");
static __u64 static __u64 inc_cb(void *map, __u32 *key, void *val, void *data) {
inc_cb(void *map, __u32 *key, void *val,
void *data)
{
__u64 *value = val; __u64 *value = val;
*value += 1; *value += 1;
return 0; return 0;
} }
SEC("uprobe/test_text_64_64_reloc") SEC("uprobe/test_text_64_64_reloc")
int test_text_64_64_reloc(struct pt_regs *ctx) int test_text_64_64_reloc(struct pt_regs *ctx) {
{
bpf_for_each_map_elem(&RESULTS, inc_cb, NULL, 0); bpf_for_each_map_elem(&RESULTS, inc_cb, NULL, 0);
return 0; return 0;
} }

Loading…
Cancel
Save