From 595217ee6088c6e0cbded90e0c19d4705ed83f96 Mon Sep 17 00:00:00 2001 From: wo_cow Date: Thu, 8 Sep 2022 17:30:56 +0800 Subject: [PATCH] ksliprobe: 1.redis_sli metric split into two tables; 2.performance optimization --- src/common/args.c | 11 +- src/common/args.h | 4 +- .../ebpf.probe/src/ksliprobe/ksliprobe.bpf.c | 230 +++++++----------- .../ebpf.probe/src/ksliprobe/ksliprobe.c | 30 ++- .../ebpf.probe/src/ksliprobe/ksliprobe.h | 41 +--- .../ebpf.probe/src/ksliprobe/ksliprobe.meta | 60 ++++- .../ebpf.probe/src/ksliprobe/tc_tstamp.bpf.c | 1 - 7 files changed, 173 insertions(+), 204 deletions(-) diff --git a/src/common/args.c b/src/common/args.c index 28baee80..6c82ec54 100644 --- a/src/common/args.c +++ b/src/common/args.c @@ -127,10 +127,8 @@ static int __period_arg_parse(char opt, char *arg, struct probe_params *params) params->load_probe = DEFAULT_LOAD_PROBE; } break; - case 'N': - if (arg != NULL) { - (void)snprintf((void *)params->proc_name, MAX_PROC_NAME_LEN, "%s", arg); - } + case 'C': + params->cycle_sampling_flag = 1; break; default: return -1; @@ -148,11 +146,6 @@ static int __args_parse(int argc, char **argv, char *opt_str, struct probe_param } while ((ch = getopt(argc, argv, opt_str)) != -1) { - if (!optarg) { - printf("optarg is null(%c).\n", ch); - return -1; - } - if (__period_arg_parse(ch, optarg, params) != 0) { return -1; } diff --git a/src/common/args.h b/src/common/args.h index 961922e4..3784c0ef 100644 --- a/src/common/args.h +++ b/src/common/args.h @@ -22,7 +22,7 @@ #define MAX_PATH_LEN 512 #define MAX_PROC_NAME_LEN 8 #define BLOCK_NAME 32 -#define __OPT_S "t:T:J:O:D:F:l:U:L:c:p:w:n:P:N:" +#define __OPT_S "t:T:J:O:D:F:lU:L:c:p:w:n:P:C" struct probe_params { unsigned int period; // [-t <>] Sampling period, unit second, default is 5 seconds unsigned int latency_thr; // [-T <>] Threshold of latency time, unit ms, default is 0 milliseconds @@ -37,11 +37,11 @@ struct probe_params { char res_percent_upper; // [-U <>] Upper limit of resource percentage, default is 0% char res_percent_lower; // [-L <>] Lower limit of resource percentage, default is 0% unsigned char cport_flag; // [-c <>] Indicates whether the probes(such as tcp) identifies the client port, default is 0 (no identify) + char cycle_sampling_flag; // [-C <>] Enables the cycle sampling, default is 0 char filter_block[BLOCK_NAME];// [-F <>] Filtering block device monitoring ranges, default is null char elf_path[MAX_PATH_LEN]; // [-p <>] Set ELF file path of the monitored software, default is null char task_whitelist[MAX_PATH_LEN]; // [-w <>] Filtering app monitoring ranges, default is null char netcard_list[MAX_PATH_LEN]; // [-n <>] Network cards that need to enable tc ingress bpf, default is null - char proc_name[MAX_PROC_NAME_LEN]; // [-N <>] Specifies the name of the monitored process, default is null }; int args_parse(int argc, char **argv, struct probe_params* params); int params_parse(char *s, struct probe_params *params); diff --git a/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.bpf.c b/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.bpf.c index c98ced47..8664216f 100644 --- a/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.bpf.c +++ b/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.bpf.c @@ -53,7 +53,6 @@ struct bpf_map_def SEC("maps") args_map = { enum samp_status_t { SAMP_INIT = 0, SAMP_READ_READY, - SAMP_WRITE_READY, SAMP_SKB_READY, SAMP_FINISHED, }; @@ -73,31 +72,6 @@ struct bpf_map_def SEC("maps") conn_samp_map = { .max_entries = MAX_CONN_LEN, }; -static __always_inline char is_redis_proc(void) -{ - u32 key = 0; - char comm[TASK_COMM_LEN] = {0}; - - struct ksli_args_s *args; - args = (struct ksli_args_s *)bpf_map_lookup_elem(&args_map, &key); - - (void)bpf_get_current_comm(&comm, TASK_COMM_LEN); - - if (args == NULL) { - if ((comm[0] == 'r') && (comm[1] == 'e') - && (comm[2] == 'd') && (comm[3] == 'i') && (comm[4] == 's')) { - return 1; - } - } else { - if ((comm[0] == args->redis_proc[0]) && (comm[1] == args->redis_proc[1]) - && (comm[2] == args->redis_proc[2]) && (comm[3] == args->redis_proc[3]) - && (comm[4] == args->redis_proc[4])) { - return 1; - } - } - - return 0; -} static __always_inline void init_conn_key(struct conn_key_t *conn_key, int fd, int tgid) { @@ -134,6 +108,28 @@ static __always_inline int init_conn_samp_data(struct sock *sk) return bpf_map_update_elem(&conn_samp_map, &sk, &csd, BPF_ANY); } +#ifndef __PERIOD +#define __PERIOD NS(30) +#endif +static __always_inline void get_args(struct conn_data_t *conn_data) +{ + u32 key = 0; + u64 period = __PERIOD; + char cycle_sampling_flag = 0; + + struct ksli_args_s *args; + args = (struct ksli_args_s *)bpf_map_lookup_elem(&args_map, &key); + if (args) { + period = args->period; + cycle_sampling_flag = args->cycle_sampling_flag; + } + + conn_data->report_period = period; + conn_data->cycle_sampling_flag = cycle_sampling_flag; + + return; +} + static __always_inline int update_conn_map_n_conn_samp_map(int fd, int tgid, struct conn_key_t *conn_key) { long err; @@ -149,9 +145,7 @@ static __always_inline int update_conn_map_n_conn_samp_map(int fd, int tgid, str return SLI_ERR; } - if (is_redis_proc()) { - conn_data.id.protocol = PROTOCOL_REDIS; - } + get_args(&conn_data); err = bpf_map_update_elem(&conn_map, conn_key, &conn_data, BPF_ANY); if (err < 0) { @@ -161,24 +155,6 @@ static __always_inline int update_conn_map_n_conn_samp_map(int fd, int tgid, str return init_conn_samp_data(sk); } -// 创建服务端 tcp 连接 -KRETPROBE(__sys_accept4, pt_regs) -{ - int fd = PT_REGS_RC(ctx); - u32 tgid = bpf_get_current_pid_tgid() >> INT_LEN; - - struct conn_key_t conn_key = {0}; - - if (fd < 0) { - return; - } - - init_conn_key(&conn_key, fd, tgid); - (void)update_conn_map_n_conn_samp_map(fd, tgid, &conn_key); - - return; -} - // 关闭 tcp 连接 KPROBE(__close_fd, pt_regs) { @@ -211,31 +187,25 @@ static __always_inline void parse_msg_to_redis_cmd(char msg_char, int *j, char * break; case FIND1_PARM_NUM: - if ((msg_char >= '0' && msg_char <= '9') || msg_char == '\r' || msg_char == '\n') { - ; - } else if (msg_char == '$') { + if (msg_char == '$') { *find_state = FIND2_CMD_LEN; - } else { - *find_state = FIND_MSG_ERR_STOP; } break; case FIND2_CMD_LEN: - if ((msg_char >= '0' && msg_char <= '9') || msg_char == '\r') { - ; - } else if (msg_char == '\n') { + if (msg_char == '\n') { *find_state = FIND3_CMD_STR; - } else { - *find_state = FIND_MSG_ERR_STOP; } break; case FIND3_CMD_STR: + if (*j == 3) { + *find_state = FIND_MSG_OK_STOP; + break; + } if (msg_char >= 'a') msg_char = msg_char - ('a'-'A'); if (msg_char >= 'A' && msg_char <= 'Z') { command[*j] = msg_char; *j = *j + 1; - } else if (msg_char == '\r' || msg_char == '\n') { - *find_state = FIND_MSG_OK_STOP; } else { *find_state = FIND_MSG_ERR_STOP; } @@ -280,43 +250,28 @@ static __always_inline int parse_req(struct conn_data_t *conn_data, const unsign // 解析请求中的command,确认协议 if (identify_protocol_redis(msg, conn_data->current.command) == SLI_OK) { + conn_data->current.command[3] = 0; return PROTOCOL_REDIS; } return PROTOCOL_UNKNOWN; } -#ifndef __PERIOD -#define __PERIOD NS(30) -#endif -static __always_inline u64 get_period() -{ - u32 key = 0; - u64 period = __PERIOD; - - struct ksli_args_s *args; - args = (struct ksli_args_s *)bpf_map_lookup_elem(&args_map, &key); - if (args) { - period = args->period; - } - - return period; // units from second to nanosecond -} - -static __always_inline void periodic_report(u64 ts_nsec, struct conn_data_t *conn_data, struct pt_regs *ctx) +static __always_inline int periodic_report(u64 ts_nsec, struct conn_data_t *conn_data, struct pt_regs *ctx) { long err; - u64 period = get_period(); + int ret = 0; + u64 period = conn_data->report_period; // 表示没有任何采样数据,不上报 if (conn_data->latency.rtt_nsec == 0) { - return; + return 0; } if (ts_nsec > conn_data->last_report_ts_nsec && ts_nsec - conn_data->last_report_ts_nsec >= period) { // rtt larger than period is considered an invalid value - if (conn_data->latency.rtt_nsec < period && conn_data->max.rtt_nsec < period) { + if (conn_data->latency.rtt_nsec < period) { struct msg_event_data_t msg_evt_data = {0}; msg_evt_data.conn_id = conn_data->id; msg_evt_data.server_ip_info = conn_data->id.server_ip_info; @@ -332,8 +287,9 @@ static __always_inline void periodic_report(u64 ts_nsec, struct conn_data_t *con conn_data->latency.rtt_nsec = 0; conn_data->max.rtt_nsec = 0; conn_data->last_report_ts_nsec = ts_nsec; + ret = 1; } - return; + return ret; } static __always_inline void sample_finished(struct conn_data_t *conn_data, struct conn_samp_data_t *csd) @@ -342,22 +298,23 @@ static __always_inline void sample_finished(struct conn_data_t *conn_data, struc conn_data->latency.rtt_nsec = csd->rtt_ts_nsec; __builtin_memcpy(&conn_data->latency.command, &csd->command, MAX_COMMAND_REQ_SIZE); } - if (conn_data->max.rtt_nsec < csd->rtt_ts_nsec) { - conn_data->max.rtt_nsec = csd->rtt_ts_nsec; - __builtin_memcpy(&conn_data->max.command, &csd->command, MAX_COMMAND_REQ_SIZE); + if (conn_data->cycle_sampling_flag) { + if (conn_data->max.rtt_nsec < csd->rtt_ts_nsec) { + conn_data->max.rtt_nsec = csd->rtt_ts_nsec; + __builtin_memcpy(&conn_data->max.command, &csd->command, MAX_COMMAND_REQ_SIZE); + } } csd->status = SAMP_INIT; } -static __always_inline void process_rdwr_msg(int fd, const char *buf, const unsigned int count, enum msg_event_rw_t rw_type, +static __always_inline void process_rdwr_msg(u32 tgid, int fd, const char *buf, const unsigned int count, struct pt_regs *ctx) { - u32 tgid = bpf_get_current_pid_tgid() >> INT_LEN; struct conn_key_t conn_key = {0}; struct conn_data_t *conn_data; u64 ts_nsec = bpf_ktime_get_ns(); struct conn_samp_data_t *csd; - int parsed = 0; + int reported = 0; init_conn_key(&conn_key, fd, tgid); conn_data = (struct conn_data_t *)bpf_map_lookup_elem(&conn_map, &conn_key); @@ -369,53 +326,68 @@ static __always_inline void process_rdwr_msg(int fd, const char *buf, const unsi return; } - if ((rw_type == MSG_READ) && (conn_data->id.protocol == PROTOCOL_UNKNOWN)) { - enum conn_protocol_t protocol = parse_req(conn_data, count, buf); - conn_data->id.protocol = protocol; - parsed = 1; + if (csd->status == SAMP_FINISHED) { + sample_finished(conn_data, csd); } - if (conn_data->id.protocol == PROTOCOL_UNKNOWN) { - return; - } + // 周期上报 + reported = periodic_report(ts_nsec, conn_data, ctx); - if (rw_type == MSG_READ) { - if (csd->status == SAMP_FINISHED) { - sample_finished(conn_data, csd); + if (csd->status != SAMP_INIT) { + // 超过采样周期,则重置采样状态,避免采样状态一直处于不可达的情况 + if (ts_nsec > csd->start_ts_nsec && + ts_nsec - csd->start_ts_nsec >= __PERIOD) { + csd->status = SAMP_INIT; } + return; + } - // 周期上报 - periodic_report(ts_nsec, conn_data, ctx); + // 非循环采样每次上报后就返回,等待下次上报周期再采样。这种方式无法获取周期内max sli。 + if (!conn_data->cycle_sampling_flag && reported) + return; - if (csd->status != SAMP_INIT) { - // 超过采样周期,则重置采样状态,避免采样状态一直处于不可达的情况 - if (ts_nsec > csd->start_ts_nsec && - ts_nsec - csd->start_ts_nsec >= __PERIOD) { - csd->status = SAMP_INIT; - } - return; - } + enum conn_protocol_t protocol = parse_req(conn_data, count, buf); + if (protocol == PROTOCOL_UNKNOWN) { + return; + } + conn_data->id.protocol = protocol; - if (!parsed) { - (void)parse_req(conn_data, count, buf); - } - __builtin_memcpy(&csd->command, conn_data->current.command, MAX_COMMAND_REQ_SIZE); + __builtin_memcpy(&csd->command, conn_data->current.command, MAX_COMMAND_REQ_SIZE); #ifndef KERNEL_SUPPORT_TSTAMP - csd->start_ts_nsec = ts_nsec; + csd->start_ts_nsec = ts_nsec; #endif - csd->status = SAMP_READ_READY; - } else { - if (csd->status == SAMP_READ_READY) { - csd->status = SAMP_WRITE_READY; - } - } + csd->status = SAMP_READ_READY; return; } +KPROBE(ksys_read, pt_regs) +{ + int fd = (int)PT_REGS_PARM1(ctx); + struct conn_key_t conn_key = {0}; + u32 tgid = bpf_get_current_pid_tgid() >> INT_LEN; + init_conn_key(&conn_key, fd, tgid); + + struct conn_data_t * conn_data = (struct conn_data_t *)bpf_map_lookup_elem(&conn_map, &conn_key); + if (conn_data == (void *)0) { + if (update_conn_map_n_conn_samp_map(fd, tgid, &conn_key) != SLI_OK) + return; + } + + if (conn_data == (void *)0) + return; + + if (!conn_data->cycle_sampling_flag) { + if (bpf_ktime_get_ns() - conn_data->last_report_ts_nsec < conn_data->report_period) + return; + } + + KPROBE_PARMS_STASH(ksys_read, ctx, CTX_USER); +} + // 跟踪连接 read 读消息 -KSLIPROBE_RET(ksys_read, pt_regs, CTX_USER) +KRETPROBE(ksys_read, pt_regs) { int fd; u32 tgid __maybe_unused = bpf_get_current_pid_tgid() >> INT_LEN; @@ -436,23 +408,7 @@ KSLIPROBE_RET(ksys_read, pt_regs, CTX_USER) fd = (int)PROBE_PARM1(val); buf = (char *)PROBE_PARM2(val); - process_rdwr_msg(fd, buf, count, MSG_READ, ctx); - - return; -} - -// 跟踪连接 write 写消息 -KPROBE(ksys_write, pt_regs) -{ - int fd; - u32 tgid __maybe_unused = bpf_get_current_pid_tgid() >> INT_LEN; - char *buf; - - fd = (int)PT_REGS_PARM1(ctx); - buf = (char *)PT_REGS_PARM2(ctx); - - // MSG_WRITE doesn't need pass count - process_rdwr_msg(fd, buf, 0, MSG_WRITE, ctx); + process_rdwr_msg(tgid, fd, buf, count, ctx); return; } @@ -469,7 +425,7 @@ KPROBE(tcp_event_new_data_sent, pt_regs) csd = (struct conn_samp_data_t *)bpf_map_lookup_elem(&conn_samp_map, &sk); if (csd != (void *)0) { - if (csd->status == SAMP_WRITE_READY) { + if (csd->status == SAMP_READ_READY) { csd->end_seq = _(TCP_SKB_CB(skb)->end_seq); csd->status = SAMP_SKB_READY; } diff --git a/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.c b/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.c index 3caa9edc..06156c5b 100644 --- a/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.c +++ b/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.c @@ -37,9 +37,10 @@ #define OO_NAME "sli" #define DEFAULT_REDIS_PROC_NAME "redis" #define SLI_TBL_NAME "redis_sli" +#define MAX_SLI_TBL_NAME "redis_max_sli" static volatile sig_atomic_t stop; -static struct probe_params params = {.period = DEFAULT_PERIOD}; +static struct probe_params params = {.period = DEFAULT_PERIOD, .cycle_sampling_flag = 0}; static void sig_int(int signo) { @@ -108,19 +109,32 @@ static void msg_event_handler(void *ctx, int cpu, void *data, unsigned int size) break; } fprintf(stdout, - "|%s|%d|%d|%s|%s|%u|%s|%u|%s|%llu|%s|%llu|\n", + "|%s|%d|%d|%s|%s|%s|%u|%s|%u|%llu|\n", SLI_TBL_NAME, msg_evt_data->conn_id.tgid, msg_evt_data->conn_id.fd, protocol, + msg_evt_data->latency.command, ser_ip_str, msg_evt_data->server_ip_info.port, cli_ip_str, ntohs(msg_evt_data->client_ip_info.port), - msg_evt_data->latency.command, - msg_evt_data->latency.rtt_nsec, + msg_evt_data->latency.rtt_nsec); + if (params.cycle_sampling_flag) { + fprintf(stdout, + "|%s|%d|%d|%s|%s|%s|%u|%s|%u|%llu|\n", + MAX_SLI_TBL_NAME, + msg_evt_data->conn_id.tgid, + msg_evt_data->conn_id.fd, + protocol, msg_evt_data->max.command, + ser_ip_str, + msg_evt_data->server_ip_info.port, + cli_ip_str, + ntohs(msg_evt_data->client_ip_info.port), msg_evt_data->max.rtt_nsec); + } + (void)fflush(stdout); return; @@ -166,12 +180,7 @@ static void load_args(int args_fd, struct probe_params* params) struct ksli_args_s args = {0}; args.period = NS(params->period); - if (strlen(params->proc_name) > 0) { - (void)snprintf(args.redis_proc, MAX_PROC_NAME_LEN, "%s", params->proc_name); - } else { - (void)snprintf(args.redis_proc, MAX_PROC_NAME_LEN, "%s", DEFAULT_REDIS_PROC_NAME); - } - args.redis_proc[MAX_REDIS_PROC_NAME_SIZE - 1] = 0; + args.cycle_sampling_flag = params->cycle_sampling_flag; (void)bpf_map_update_elem(args_fd, &key, &args, BPF_ANY); } @@ -185,6 +194,7 @@ int main(int argc, char **argv) return -1; } printf("arg parse interval time:%us\n", params.period); + printf("arg parse if cycle sampling:%s\n", params.cycle_sampling_flag ? "true": "false"); #ifdef KERNEL_SUPPORT_TSTAMP load_tc_bpf(params.netcard_list, TC_PROG, TC_TYPE_INGRESS); diff --git a/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.h b/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.h index ae40bc36..6e547a48 100644 --- a/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.h +++ b/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.h @@ -17,7 +17,7 @@ #define TC_PROG "tc_tstamp.bpf.o" -#define MAX_COMMAND_REQ_SIZE (32 - 1) +#define MAX_COMMAND_REQ_SIZE (16 - 1) #define MAX_REDIS_PROC_NAME_SIZE 8 #define FIND0_MSG_START 0 @@ -35,8 +35,8 @@ #endif struct ksli_args_s { - __u64 period; // Sampling period, unit ns - char redis_proc[MAX_REDIS_PROC_NAME_SIZE]; + __u64 period; // Sampling period, unit ns + char cycle_sampling_flag; // Enables the sampling of max sli within a period (which cause some performance degradation) }; enum msg_event_rw_t { @@ -87,6 +87,8 @@ struct conn_data_t { struct rtt_cmd_t max; struct rtt_cmd_t current; __u64 last_report_ts_nsec; // 上一次上报完成的时间点 + __u64 report_period; // 上报周期 + char cycle_sampling_flag; }; struct msg_event_data_t { @@ -96,37 +98,4 @@ struct msg_event_data_t { struct ip_info_t server_ip_info; struct ip_info_t client_ip_info; }; - -#define KSLIPROBE_RET(func, type, caller_type) \ - bpf_section("kprobe/" #func) \ - void __kprobe_bpf_##func(struct type *ctx) { \ - int ret; \ - int fd = (int)PT_REGS_PARM1(ctx); \ - struct __probe_key __key = {0}; \ - struct __probe_val __val = {0}; \ - struct conn_key_t conn_key = {0}; \ - u32 tgid = bpf_get_current_pid_tgid() >> INT_LEN; \ - init_conn_key(&conn_key, fd, tgid); \ - if ((struct conn_data_t *)bpf_map_lookup_elem(&conn_map, &conn_key) == (void *)0) { \ - if (update_conn_map_n_conn_samp_map(fd, tgid, &conn_key) != SLI_OK) \ - return; \ - } \ - __get_probe_key(&__key, (const long)PT_REGS_FP(ctx), caller_type); \ - __get_probe_val(&__val, (const long)PT_REGS_PARM1(ctx), \ - (const long)PT_REGS_PARM2(ctx), \ - (const long)PT_REGS_PARM3(ctx), \ - (const long)PT_REGS_PARM4(ctx), \ - (const long)PT_REGS_PARM5(ctx), \ - (const long)PT_REGS_PARM6(ctx)); \ - ret = __do_push_match_map(&__key, &__val); \ - if (ret < 0) { \ - bpf_printk("---KPROBE_RET[" #func "] push failed.\n"); \ - __do_pop_match_map_entry((const struct __probe_key *)&__key, \ - &__val); \ - } \ - } \ - \ - bpf_section("kretprobe/" #func) \ - void __kprobe_ret_bpf_##func(struct type *ctx) - #endif \ No newline at end of file diff --git a/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.meta b/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.meta index 640d1fa4..1ae653e8 100644 --- a/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.meta +++ b/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.meta @@ -14,12 +14,17 @@ measurements: { description: "the socket fd of client connection", type: "key", - name: "conn_fd", + name: "ins_id", }, { description: "the protocol type", - type: "label", - name: "protocol", + type: "key", + name: "app", + }, + { + description: "the cmd of req", + type: "key", + name: "method", }, { description: "the IP of server", @@ -41,20 +46,57 @@ measurements: type: "label", name: "client_port", }, + { + description: "the rtt(ns) of req", + type: "gauge", + name: "rtt_nsec", + } + ) + }, + { + table_name: "redis_max_sli", + entity_name: "sli", + fields: + ( + { + description: "the tgid of server process", + type: "key", + name: "tgid", + }, + { + description: "the socket fd of client connection", + type: "key", + name: "ins_id", + }, + { + description: "the protocol type", + type: "key", + name: "app", + }, { description: "the cmd of req", + type: "key", + name: "method", + }, + { + description: "the IP of server", type: "label", - name: "command", + name: "server_ip", }, { - description: "the rtt(ns) of req", - type: "gauge", - name: "rtt_nsec", + description: "the port of server", + type: "label", + name: "server_port", }, { - description: "the cmd of max rtt req", + description: "the IP of client", type: "label", - name: "max_command", + name: "client_ip", + }, + { + description: "the port of client", + type: "label", + name: "client_port", }, { description: "the rtt(ns) of max rtt req", diff --git a/src/probes/extends/ebpf.probe/src/ksliprobe/tc_tstamp.bpf.c b/src/probes/extends/ebpf.probe/src/ksliprobe/tc_tstamp.bpf.c index 6aefd5bc..a594b8fc 100644 --- a/src/probes/extends/ebpf.probe/src/ksliprobe/tc_tstamp.bpf.c +++ b/src/probes/extends/ebpf.probe/src/ksliprobe/tc_tstamp.bpf.c @@ -19,7 +19,6 @@ #include "bpf.h" #include -#include "ksliprobe.h" SEC("tc") int get_start_ts(struct __sk_buff *skb) -- Gitee