From 34a2d2bdbe5d8106e51b66005e805d20a6e6a311 Mon Sep 17 00:00:00 2001 From: William Dean Date: Thu, 23 Jun 2022 01:11:46 +0800 Subject: [PATCH] detect/net: Code format clean up Replace tab by 4 spaces, in order to make code more readable. Signed-off-by: William Dean --- .../PingTrace/src/bpf_prog/ecs_receiver.bpf.c | 8 ++--- .../src/bpf_prog/ecs_receiver_compat.bpf.c | 8 ++--- .../PingTrace/src/bpf_prog/ecs_sender.bpf.c | 32 +++++++++---------- .../src/bpf_prog/ecs_sender_compat.bpf.c | 32 +++++++++---------- .../PingTrace/src/bpf_prog/ns_receiver.bpf.c | 16 +++++----- .../PingTrace/src/bpf_prog/ns_sender.bpf.c | 16 +++++----- 6 files changed, 56 insertions(+), 56 deletions(-) diff --git a/source/tools/detect/net/PingTrace/src/bpf_prog/ecs_receiver.bpf.c b/source/tools/detect/net/PingTrace/src/bpf_prog/ecs_receiver.bpf.c index ba91ac44..5a964e8a 100644 --- a/source/tools/detect/net/PingTrace/src/bpf_prog/ecs_receiver.bpf.c +++ b/source/tools/detect/net/PingTrace/src/bpf_prog/ecs_receiver.bpf.c @@ -2,10 +2,10 @@ #include "bpf_common.h" struct bpf_map_def SEC("maps") pt_map = { - .type = BPF_MAP_TYPE_LRU_HASH, - .key_size = sizeof(struct pingtrace_map_key), - .value_size = sizeof(struct pingtrace_map_value), - .max_entries = 100, + .type = BPF_MAP_TYPE_LRU_HASH, + .key_size = sizeof(struct pingtrace_map_key), + .value_size = sizeof(struct pingtrace_map_value), + .max_entries = 100, }; SEC("kprobe/icmp_rcv") diff --git a/source/tools/detect/net/PingTrace/src/bpf_prog/ecs_receiver_compat.bpf.c b/source/tools/detect/net/PingTrace/src/bpf_prog/ecs_receiver_compat.bpf.c index 2ae792fa..41f75ceb 100644 --- a/source/tools/detect/net/PingTrace/src/bpf_prog/ecs_receiver_compat.bpf.c +++ b/source/tools/detect/net/PingTrace/src/bpf_prog/ecs_receiver_compat.bpf.c @@ -4,10 +4,10 @@ ID_MAP_DEFINITION(id_map); struct bpf_map_def SEC("maps") pt_map = { - .type = BPF_MAP_TYPE_HASH, - .key_size = sizeof(struct pingtrace_map_key), - .value_size = sizeof(struct pingtrace_map_value), - .max_entries = 100, + .type = BPF_MAP_TYPE_HASH, + .key_size = sizeof(struct pingtrace_map_key), + .value_size = sizeof(struct pingtrace_map_value), + .max_entries = 100, }; SEC("kprobe/icmp_rcv") diff --git a/source/tools/detect/net/PingTrace/src/bpf_prog/ecs_sender.bpf.c b/source/tools/detect/net/PingTrace/src/bpf_prog/ecs_sender.bpf.c index b24ab6f6..54fc5e07 100644 --- a/source/tools/detect/net/PingTrace/src/bpf_prog/ecs_sender.bpf.c +++ b/source/tools/detect/net/PingTrace/src/bpf_prog/ecs_sender.bpf.c @@ -3,10 +3,10 @@ #include "map_define.h" struct bpf_map_def SEC("maps") sched_map = { - .type = BPF_MAP_TYPE_ARRAY, - .key_size = sizeof(uint32_t), - .value_size = sizeof(uint64_t), - .max_entries = PT_SCHED_NUM, + .type = BPF_MAP_TYPE_ARRAY, + .key_size = sizeof(uint32_t), + .value_size = sizeof(uint64_t), + .max_entries = PT_SCHED_NUM, }; struct sched_wakeup_args @@ -33,10 +33,10 @@ int sched_wakeup_trace(struct sched_wakeup_args *args) } struct bpf_map_def SEC("maps") irq_map = { - .type = BPF_MAP_TYPE_ARRAY, - .key_size = sizeof(uint32_t), - .value_size = sizeof(uint64_t), - .max_entries = PT_IRQ_MAP_ENTRY_NUM, + .type = BPF_MAP_TYPE_ARRAY, + .key_size = sizeof(uint32_t), + .value_size = sizeof(uint64_t), + .max_entries = PT_IRQ_MAP_ENTRY_NUM, }; struct softirq_entry_args @@ -61,17 +61,17 @@ int softirq_hook(struct softirq_entry_args *args) } struct bpf_map_def SEC("maps") tx_map = { - .type = BPF_MAP_TYPE_LRU_HASH, - .key_size = sizeof(struct pingtrace_map_key), - .value_size = sizeof(struct pingtrace_map_value), - .max_entries = 100, + .type = BPF_MAP_TYPE_LRU_HASH, + .key_size = sizeof(struct pingtrace_map_key), + .value_size = sizeof(struct pingtrace_map_value), + .max_entries = 100, }; struct bpf_map_def SEC("maps") rx_map = { - .type = BPF_MAP_TYPE_LRU_HASH, - .key_size = sizeof(struct pingtrace_map_key), - .value_size = sizeof(struct pingtrace_map_value), - .max_entries = 100, + .type = BPF_MAP_TYPE_LRU_HASH, + .key_size = sizeof(struct pingtrace_map_key), + .value_size = sizeof(struct pingtrace_map_value), + .max_entries = 100, }; SEC("kprobe/raw_local_deliver") diff --git a/source/tools/detect/net/PingTrace/src/bpf_prog/ecs_sender_compat.bpf.c b/source/tools/detect/net/PingTrace/src/bpf_prog/ecs_sender_compat.bpf.c index 8fe119db..b309bfd9 100644 --- a/source/tools/detect/net/PingTrace/src/bpf_prog/ecs_sender_compat.bpf.c +++ b/source/tools/detect/net/PingTrace/src/bpf_prog/ecs_sender_compat.bpf.c @@ -1,10 +1,10 @@ #include "bpf_common_compat.h" struct bpf_map_def SEC("maps") sched_map = { - .type = BPF_MAP_TYPE_ARRAY, - .key_size = sizeof(uint32_t), - .value_size = sizeof(uint64_t), - .max_entries = PT_SCHED_NUM, + .type = BPF_MAP_TYPE_ARRAY, + .key_size = sizeof(uint32_t), + .value_size = sizeof(uint64_t), + .max_entries = PT_SCHED_NUM, }; struct sched_wakeup_args @@ -31,10 +31,10 @@ int sched_wakeup_trace(struct sched_wakeup_args *args) } struct bpf_map_def SEC("maps") irq_map = { - .type = BPF_MAP_TYPE_ARRAY, - .key_size = sizeof(uint32_t), - .value_size = sizeof(uint64_t), - .max_entries = PT_IRQ_MAP_ENTRY_NUM, + .type = BPF_MAP_TYPE_ARRAY, + .key_size = sizeof(uint32_t), + .value_size = sizeof(uint64_t), + .max_entries = PT_IRQ_MAP_ENTRY_NUM, }; struct softirq_entry_args @@ -59,17 +59,17 @@ int softirq_hook(struct softirq_entry_args *args) } struct bpf_map_def SEC("maps") tx_map = { - .type = BPF_MAP_TYPE_HASH, - .key_size = sizeof(struct pingtrace_map_key), - .value_size = sizeof(struct pingtrace_map_value), - .max_entries = 100, + .type = BPF_MAP_TYPE_HASH, + .key_size = sizeof(struct pingtrace_map_key), + .value_size = sizeof(struct pingtrace_map_value), + .max_entries = 100, }; struct bpf_map_def SEC("maps") rx_map = { - .type = BPF_MAP_TYPE_HASH, - .key_size = sizeof(struct pingtrace_map_key), - .value_size = sizeof(struct pingtrace_map_value), - .max_entries = 100, + .type = BPF_MAP_TYPE_HASH, + .key_size = sizeof(struct pingtrace_map_key), + .value_size = sizeof(struct pingtrace_map_value), + .max_entries = 100, }; ID_MAP_DEFINITION(id_map); diff --git a/source/tools/detect/net/PingTrace/src/bpf_prog/ns_receiver.bpf.c b/source/tools/detect/net/PingTrace/src/bpf_prog/ns_receiver.bpf.c index ea7b1e8a..8224ad84 100644 --- a/source/tools/detect/net/PingTrace/src/bpf_prog/ns_receiver.bpf.c +++ b/source/tools/detect/net/PingTrace/src/bpf_prog/ns_receiver.bpf.c @@ -2,17 +2,17 @@ #include "bpf_common.h" struct bpf_map_def SEC("maps") tx_map = { - .type = BPF_MAP_TYPE_LRU_HASH, - .key_size = sizeof(struct pingtrace_map_key), - .value_size = sizeof(struct pingtrace_map_value), - .max_entries = 100, + .type = BPF_MAP_TYPE_LRU_HASH, + .key_size = sizeof(struct pingtrace_map_key), + .value_size = sizeof(struct pingtrace_map_value), + .max_entries = 100, }; struct bpf_map_def SEC("maps") rx_map = { - .type = BPF_MAP_TYPE_LRU_HASH, - .key_size = sizeof(struct pingtrace_map_key), - .value_size = sizeof(struct pingtrace_map_value), - .max_entries = 100, + .type = BPF_MAP_TYPE_LRU_HASH, + .key_size = sizeof(struct pingtrace_map_key), + .value_size = sizeof(struct pingtrace_map_value), + .max_entries = 100, }; SEC("kprobe/dev_hard_start_xmit") diff --git a/source/tools/detect/net/PingTrace/src/bpf_prog/ns_sender.bpf.c b/source/tools/detect/net/PingTrace/src/bpf_prog/ns_sender.bpf.c index bdb0df72..74d837ef 100644 --- a/source/tools/detect/net/PingTrace/src/bpf_prog/ns_sender.bpf.c +++ b/source/tools/detect/net/PingTrace/src/bpf_prog/ns_sender.bpf.c @@ -2,17 +2,17 @@ #include "bpf_common.h" struct bpf_map_def SEC("maps") tx_map = { - .type = BPF_MAP_TYPE_LRU_HASH, - .key_size = sizeof(struct pingtrace_map_key), - .value_size = sizeof(struct pingtrace_map_value), - .max_entries = 100, + .type = BPF_MAP_TYPE_LRU_HASH, + .key_size = sizeof(struct pingtrace_map_key), + .value_size = sizeof(struct pingtrace_map_value), + .max_entries = 100, }; struct bpf_map_def SEC("maps") rx_map = { - .type = BPF_MAP_TYPE_LRU_HASH, - .key_size = sizeof(struct pingtrace_map_key), - .value_size = sizeof(struct pingtrace_map_value), - .max_entries = 100, + .type = BPF_MAP_TYPE_LRU_HASH, + .key_size = sizeof(struct pingtrace_map_key), + .value_size = sizeof(struct pingtrace_map_value), + .max_entries = 100, }; struct net_dev_xmit_args -- Gitee