From 7cd26fa702325e527d7812b0c48f4bb7ccfb6102 Mon Sep 17 00:00:00 2001 From: xietangxin Date: Thu, 8 Jun 2023 10:58:26 +0800 Subject: [PATCH] sync bugfix (cherry picked from commit f80b9a43fd947043bd90d948c921daeabc1f3b96) --- ...egmentation-fault-of-gala-gopher-cmd.patch | 24 ++ ...issue-tracepoint-args-in-kernel-5.10.patch | 28 ++ ...x-The-log-time-is-not-the-local-time.patch | 27 ++ bugfix-fix-gala-gopher-h-print-err.patch | 46 ++ bugfix-zombie-task.patch | 79 ++++ ...e-convert-container_id-type-to-bytes.patch | 52 +++ fix-access-violation.patch | 39 ++ fix-add-default-data-of-event-conf.patch | 28 ++ fix-change-license-software-name.patch | 401 ++++++++++++++++++ fix-fix-fd-leakage-problem.patch | 96 +++++ fix-fix-install-error.patch | 36 ++ fix-httpprobe-find-libssl-path.patch | 50 +++ fix-prepare_dependence.patch | 47 ++ gala-gopher.spec | 32 +- modify-desc-from-chinese-to-english.patch | 25 ++ 15 files changed, 1009 insertions(+), 1 deletion(-) create mode 100644 Fix-segmentation-fault-of-gala-gopher-cmd.patch create mode 100644 adapt-block_rq_issue-tracepoint-args-in-kernel-5.10.patch create mode 100644 bugfix-The-log-time-is-not-the-local-time.patch create mode 100644 bugfix-fix-gala-gopher-h-print-err.patch create mode 100644 bugfix-zombie-task.patch create mode 100644 cadvisor_probe-convert-container_id-type-to-bytes.patch create mode 100644 fix-access-violation.patch create mode 100644 fix-add-default-data-of-event-conf.patch create mode 100644 fix-change-license-software-name.patch create mode 100644 fix-fix-fd-leakage-problem.patch create mode 100644 fix-fix-install-error.patch create mode 100644 fix-httpprobe-find-libssl-path.patch create mode 100644 fix-prepare_dependence.patch create mode 100644 modify-desc-from-chinese-to-english.patch diff --git a/Fix-segmentation-fault-of-gala-gopher-cmd.patch b/Fix-segmentation-fault-of-gala-gopher-cmd.patch new file mode 100644 index 0000000..d50190e --- /dev/null +++ b/Fix-segmentation-fault-of-gala-gopher-cmd.patch @@ -0,0 +1,24 @@ +From 5dca2b18cda90ef8cb66cff7b1f860062f248021 Mon Sep 17 00:00:00 2001 +From: Vchanger +Date: Wed, 19 Apr 2023 14:20:52 +0800 +Subject: [PATCH] Fix segmentation fault of gala-gopher cmd + +--- + src/daemon/main.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/daemon/main.c b/src/daemon/main.c +index 60a509c..bb39f08 100644 +--- a/src/daemon/main.c ++++ b/src/daemon/main.c +@@ -65,6 +65,7 @@ static int CmdProcessing(int argc, char *argv[]) + static struct option long_options[] = { + {"help", no_argument, 0, 'h'}, + {"config_path", required_argument, 0, 'c'}, ++ {NULL, 0, 0, NULL} + }; + + char short_options[] = { +-- +2.33.0 + diff --git a/adapt-block_rq_issue-tracepoint-args-in-kernel-5.10.patch b/adapt-block_rq_issue-tracepoint-args-in-kernel-5.10.patch new file mode 100644 index 0000000..96e8020 --- /dev/null +++ b/adapt-block_rq_issue-tracepoint-args-in-kernel-5.10.patch @@ -0,0 +1,28 @@ +From ebc4a770ef1657c93fadf48d40294d3cb7e1cb29 Mon Sep 17 00:00:00 2001 +From: xietangxin +Date: Thu, 27 Apr 2023 16:59:17 +0800 +Subject: [PATCH] adapt block_rq_issue tracepoint args in kernel-5.10 + +--- + src/probes/extends/ebpf.probe/src/ioprobe/io_trace_bpf.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/probes/extends/ebpf.probe/src/ioprobe/io_trace_bpf.h b/src/probes/extends/ebpf.probe/src/ioprobe/io_trace_bpf.h +index 2109c87..f24078d 100644 +--- a/src/probes/extends/ebpf.probe/src/ioprobe/io_trace_bpf.h ++++ b/src/probes/extends/ebpf.probe/src/ioprobe/io_trace_bpf.h +@@ -315,7 +315,11 @@ static __always_inline struct io_latency_s* get_io_latency(struct io_trace_s* io + KRAWTRACE(block_rq_issue, bpf_raw_tracepoint_args) + { + struct io_trace_s *io_trace = NULL; ++#if (CURRENT_KERNEL_VERSION >= KERNEL_VERSION(5, 10, 0)) ++ struct request* req = (struct request *)ctx->args[0]; ++#else + struct request* req = (struct request *)ctx->args[1]; ++#endif + + io_trace = get_io_trace(req); + if (io_trace == NULL) { +-- +2.33.0 + diff --git a/bugfix-The-log-time-is-not-the-local-time.patch b/bugfix-The-log-time-is-not-the-local-time.patch new file mode 100644 index 0000000..d8ebd0c --- /dev/null +++ b/bugfix-The-log-time-is-not-the-local-time.patch @@ -0,0 +1,27 @@ +From 57ab187ddd2915d0eaff2b472e22fb15e7374c09 Mon Sep 17 00:00:00 2001 +From: sjxur +Date: Sun, 23 Apr 2023 17:49:27 +0800 +Subject: [PATCH] bugfix:The log time is not the local time + +Conficts: del part of change comment code + +--- + src/common/logs.cpp | 2 +- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/common/logs.cpp b/src/common/logs.cpp +index fc338c3..f8c0c35 100644 +--- a/src/common/logs.cpp ++++ b/src/common/logs.cpp +@@ -383,7 +383,7 @@ static int append_debug_logger(struct log_mgr_s * mgr) + + SharedAppenderPtr append(new RollingFileAppender(g_debug_abs_path, DEBUG_LOGS_FILESIZE, 1, true, true)); + +- log4cplus::tstring pattern = LOG4CPLUS_TEXT("%d{%m/%d/%y %H:%M:%S} - %m"); ++ log4cplus::tstring pattern = LOG4CPLUS_TEXT("%D{%m/%d/%y %H:%M:%S} - %m"); + append->setLayout(std::unique_ptr(new log4cplus::PatternLayout(pattern))); + + g_debug_logger.addAppender(append); +-- +2.33.0 + diff --git a/bugfix-fix-gala-gopher-h-print-err.patch b/bugfix-fix-gala-gopher-h-print-err.patch new file mode 100644 index 0000000..24c7faa --- /dev/null +++ b/bugfix-fix-gala-gopher-h-print-err.patch @@ -0,0 +1,46 @@ +From 8cdc9f0c63f897240f1325faf287250c19e3b57a Mon Sep 17 00:00:00 2001 +From: xietangxin +Date: Mon, 8 May 2023 17:25:24 +0800 +Subject: [PATCH] bugfix: fix gala-gopher -h print err + +--- + res/event_multy_language.rc | 2 +- + src/daemon/main.c | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/res/event_multy_language.rc b/res/event_multy_language.rc +index 0fb255b..04d580e 100644 +--- a/res/event_multy_language.rc ++++ b/res/event_multy_language.rc +@@ -228,7 +228,7 @@ events_en_US = + } + ); + +-events_chinese = ++events_zh_CN = + ( + { + entity_name = "cpu", +diff --git a/src/daemon/main.c b/src/daemon/main.c +index bb39f08..5007486 100644 +--- a/src/daemon/main.c ++++ b/src/daemon/main.c +@@ -87,12 +87,12 @@ static int CmdProcessing(int argc, char *argv[]) + int option_index = 0; + cmd = getopt_long(argc, argv, short_options, long_options, &option_index); + if (cmd == -1) +- break; ++ return -1; + + switch (cmd) { + case 'h': +- ShowUsage(); +- break; ++ // print usage later ++ return -1; + case 'c': + ret = ParseConfigPath(optarg); + break; +-- +2.33.0 + diff --git a/bugfix-zombie-task.patch b/bugfix-zombie-task.patch new file mode 100644 index 0000000..8805d7a --- /dev/null +++ b/bugfix-zombie-task.patch @@ -0,0 +1,79 @@ +From 40c9ea4431e3e2aecfa54dcc48bef55f602be497 Mon Sep 17 00:00:00 2001 +From: luzhihao +Date: Thu, 11 May 2023 14:41:19 +0800 +Subject: [PATCH] bugfix: zombie task. + +--- + src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.c | 1 + + src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe.c | 1 + + src/probes/extends/ebpf.probe/src/sliprobe/redissli.c | 1 + + src/probes/extends/ebpf.probe/src/stackprobe/stackprobe.c | 3 +++ + 4 files changed, 6 insertions(+) + +diff --git a/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.c b/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.c +index ac8484e..8f5513f 100644 +--- a/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.c ++++ b/src/probes/extends/ebpf.probe/src/ksliprobe/ksliprobe.c +@@ -162,6 +162,7 @@ static int init_conn_mgt_process(int msg_evt_map_fd) + fprintf(stderr, "Failed to create connection read/write message event handler thread.\n"); + return -1; + } ++ (void)pthread_detach(msg_evt_hdl_thd); + printf("Connection read/write message event handler thread successfully started!\n"); + + return 0; +diff --git a/src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe.c b/src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe.c +index 34e749c..bee69b9 100644 +--- a/src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe.c ++++ b/src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe.c +@@ -194,6 +194,7 @@ static int init_conn_mgt_process(int msg_evt_map_fd) + fprintf(stderr, "Failed to create connection read/write message event handler thread.\n"); + return -1; + } ++ (void)pthread_detach(msg_evt_hdl_thd); + printf("Connection read/write message event handler thread successfully started!\n"); + + return 0; +diff --git a/src/probes/extends/ebpf.probe/src/sliprobe/redissli.c b/src/probes/extends/ebpf.probe/src/sliprobe/redissli.c +index 19c6fb7..e9b8591 100644 +--- a/src/probes/extends/ebpf.probe/src/sliprobe/redissli.c ++++ b/src/probes/extends/ebpf.probe/src/sliprobe/redissli.c +@@ -131,6 +131,7 @@ static int init_conn_mgt_process(int cmd_evt_map_fd) + fprintf(stderr, "Failed to create connection command event handler thread.\n"); + return -1; + } ++ (void)pthread_detach(cmd_evt_hdl_thd); + printf("Connection command event handler thread successfully started!\n"); + + return 0; +diff --git a/src/probes/extends/ebpf.probe/src/stackprobe/stackprobe.c b/src/probes/extends/ebpf.probe/src/stackprobe/stackprobe.c +index f050c27..41ad62e 100644 +--- a/src/probes/extends/ebpf.probe/src/stackprobe/stackprobe.c ++++ b/src/probes/extends/ebpf.probe/src/stackprobe/stackprobe.c +@@ -1386,6 +1386,7 @@ cleanup: + ERROR("[STACKPROBE]: attach memleak bpf failed %d\n", err); + return -1; + } ++ (void)pthread_detach(uprobe_attach_thd); + #endif + + INFO("[STACKPROBE]: attach memleak bpf succeed.\n"); +@@ -1576,6 +1577,7 @@ static void init_wr_flame_pthreads(struct svg_stack_trace_s *svg_st, const char + g_stop = 1; + return; + } ++ (void)pthread_detach(wr_flame_thd); + INFO("[STACKPROBE]: %s wr_flame_pthread successfully started!\n", flame_name); + + return; +@@ -1641,6 +1643,7 @@ static void init_java_support_proc(StackprobeConfig *conf) + ERROR("[STACKPROBE]: Failed to create java_support_pthread.\n"); + return; + } ++ (void)pthread_detach(attach_thd); + INFO("[STACKPROBE]: java_support_pthread successfully started!\n"); + + return; +-- +2.33.0 + diff --git a/cadvisor_probe-convert-container_id-type-to-bytes.patch b/cadvisor_probe-convert-container_id-type-to-bytes.patch new file mode 100644 index 0000000..eb0b7f1 --- /dev/null +++ b/cadvisor_probe-convert-container_id-type-to-bytes.patch @@ -0,0 +1,52 @@ +From 921f54938ae1f5b4d3d9486832c98896aaa88ddf Mon Sep 17 00:00:00 2001 +From: xietangxin +Date: Thu, 27 Apr 2023 09:24:12 +0800 +Subject: [PATCH] cadvisor_probe:convert container_id type to bytes + +--- + .../cadvisor.probe/cadvisor_probe.py | 20 +++++++++++-------- + 1 file changed, 12 insertions(+), 8 deletions(-) + +diff --git a/src/probes/extends/python.probe/cadvisor.probe/cadvisor_probe.py b/src/probes/extends/python.probe/cadvisor.probe/cadvisor_probe.py +index 81226d0..3f87134 100644 +--- a/src/probes/extends/python.probe/cadvisor.probe/cadvisor_probe.py ++++ b/src/probes/extends/python.probe/cadvisor.probe/cadvisor_probe.py +@@ -220,15 +220,17 @@ class BasicLabelProbe(Probe): + + self.get_all_containers() + for container_id in self.container_ids: ++ # ctype c_char_p is bytes in python3, convert str to bytes ++ container_id_bytes = str.encode(container_id) + g_metric[table_name][container_id] = dict() + g_metric[table_name][container_id]['container_id'] = container_id +- g_metric[table_name][container_id]['proc_id'] = self.get_container_pid(container_id) +- g_metric[table_name][container_id]['name'] = self.get_container_name(container_id) +- g_metric[table_name][container_id]['cpucg_inode'] = self.get_container_cpucg_inode(container_id) +- g_metric[table_name][container_id]['memcg_inode'] = self.get_container_memcg_inode(container_id) +- g_metric[table_name][container_id]['pidcg_inode'] = self.get_container_pidcg_inode(container_id) +- g_metric[table_name][container_id]['mnt_ns_id'] = self.get_container_mntns_id(container_id) +- g_metric[table_name][container_id]['net_ns_id'] = self.get_container_netns_id(container_id) ++ g_metric[table_name][container_id]['proc_id'] = self.get_container_pid(container_id_bytes) ++ g_metric[table_name][container_id]['name'] = self.get_container_name(container_id_bytes) ++ g_metric[table_name][container_id]['cpucg_inode'] = self.get_container_cpucg_inode(container_id_bytes) ++ g_metric[table_name][container_id]['memcg_inode'] = self.get_container_memcg_inode(container_id_bytes) ++ g_metric[table_name][container_id]['pidcg_inode'] = self.get_container_pidcg_inode(container_id_bytes) ++ g_metric[table_name][container_id]['mnt_ns_id'] = self.get_container_mntns_id(container_id_bytes) ++ g_metric[table_name][container_id]['net_ns_id'] = self.get_container_netns_id(container_id_bytes) + g_metric[table_name][container_id]['value'] = '0' + + +@@ -334,7 +336,9 @@ class CadvisorProbe(Probe): + g_metric[table_name][hashed_metric_str]['container_id'] = container_id + + metric_name = line[line.index("_") + 1:line.index("{")] +- value = line[(line.index(" ") + 1):self.find_2nd_index(line, " ")] ++ value_start_index = line.index("}") + 1 ++ value_end_index = value_start_index + self.find_2nd_index(line[value_start_index:], " ") ++ value = line[value_start_index:value_end_index] + try: + if g_meta[table_name][metric_name] == COUNTER: + if metric_name in g_metric[table_name][hashed_metric_str]: +-- +2.33.0 + diff --git a/fix-access-violation.patch b/fix-access-violation.patch new file mode 100644 index 0000000..d436299 --- /dev/null +++ b/fix-access-violation.patch @@ -0,0 +1,39 @@ +From e724fefbd1cbaa610894eab418b3721e798a9c1f Mon Sep 17 00:00:00 2001 +From: wo_cow +Date: Mon, 8 May 2023 19:41:04 +0800 +Subject: [PATCH] fix access violation + +--- + src/common/container.c | 2 +- + src/common/container.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/common/container.c b/src/common/container.c +index c7981a1..fc081d3 100644 +--- a/src/common/container.c ++++ b/src/common/container.c +@@ -486,7 +486,7 @@ int get_elf_path(unsigned int pid, char elf_path[], int max_path_len, const char + { + char cmd[COMMAND_LEN] = {0}; + char elf_relative_path[PATH_LEN] = {0}; +- char container_id[CONTAINER_ABBR_ID_LEN] = {0}; ++ char container_id[CONTAINER_ABBR_ID_LEN + 1] = {0}; + char container_path[PATH_LEN] = {0}; + + // 1. get elf_path +diff --git a/src/common/container.h b/src/common/container.h +index b2dade9..e06a64b 100644 +--- a/src/common/container.h ++++ b/src/common/container.h +@@ -29,7 +29,7 @@ enum container_status_e { + + typedef struct container_info_s { + enum container_status_e status; +- char abbrContainerId[CONTAINER_ID_LEN]; ++ char abbrContainerId[CONTAINER_ID_LEN + 1]; + } container_info; + + typedef struct container_tbl_s { +-- +2.33.0 + diff --git a/fix-add-default-data-of-event-conf.patch b/fix-add-default-data-of-event-conf.patch new file mode 100644 index 0000000..b1d234f --- /dev/null +++ b/fix-add-default-data-of-event-conf.patch @@ -0,0 +1,28 @@ +From 76b7748bd24ab02ac8f26917e590a41fd185c1e7 Mon Sep 17 00:00:00 2001 +From: xietangxin +Date: Fri, 12 May 2023 14:38:18 +0800 +Subject: [PATCH] fix:add default data of event conf + +--- + src/common/event.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/common/event.c b/src/common/event.c +index 17fda5c..af98d07 100644 +--- a/src/common/event.c ++++ b/src/common/event.c +@@ -27,9 +27,9 @@ + #endif + + static struct evt_ts_hash_t *g_evt_head = NULL; +-static unsigned int g_evt_period = 0; ++static unsigned int g_evt_period = 600; + static EventsConfig *g_evt_conf; +-static char g_lang_type[MAX_EVT_GRP_NAME_LEN]; ++static char g_lang_type[MAX_EVT_GRP_NAME_LEN] = "zh_CN"; + + static void hash_clear_older_evt(time_t cur_time); + static unsigned int hash_count_evt(void); +-- +2.33.0 + diff --git a/fix-change-license-software-name.patch b/fix-change-license-software-name.patch new file mode 100644 index 0000000..c05c79d --- /dev/null +++ b/fix-change-license-software-name.patch @@ -0,0 +1,401 @@ +From ecdfe5a9a67568bbfdd99d478ad425e66fa2d5e6 Mon Sep 17 00:00:00 2001 +From: xietangxin +Date: Tue, 9 May 2023 09:15:02 +0800 +Subject: [PATCH] fix: change license software name + +--- + src/common/event.c | 2 +- + src/common/kern_config.c | 2 +- + src/egress/egress.c | 2 +- + src/egress/egress.h | 2 +- + src/ingress/ingress.c | 2 +- + src/ingress/ingress.h | 2 +- + src/lib/base.h | 2 +- + src/lib/config/config.c | 2 +- + src/lib/config/config.h | 2 +- + src/lib/fifo/fifo.c | 2 +- + src/lib/fifo/fifo.h | 2 +- + src/lib/imdb/imdb.c | 2 +- + src/lib/imdb/imdb.h | 2 +- + src/lib/imdb/metrics.c | 2 +- + src/lib/kafka/kafka.c | 2 +- + src/lib/kafka/kafka.h | 2 +- + src/lib/meta/meta.c | 2 +- + src/lib/meta/meta.h | 2 +- + src/lib/probe/extend_probe.c | 2 +- + src/lib/probe/extend_probe.h | 2 +- + src/lib/probe/nprobe_fprintf.h | 2 +- + src/lib/probe/probe.c | 2 +- + src/lib/probe/probe.h | 2 +- + src/probes/event.probe/event.c | 2 +- + src/probes/event.probe/event.h | 2 +- + .../extends/ebpf.probe/src/stackprobe/conf/stackprobe_config.c | 2 +- + src/resource/resource.c | 2 +- + src/resource/resource.h | 2 +- + src/web_server/web_server.c | 2 +- + src/web_server/web_server.h | 2 +- + 30 files changed, 30 insertions(+), 30 deletions(-) + +diff --git a/src/common/event.c b/src/common/event.c +index 31eb899..17fda5c 100644 +--- a/src/common/event.c ++++ b/src/common/event.c +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/common/kern_config.c b/src/common/kern_config.c +index 2615652..3d8a22f 100644 +--- a/src/common/kern_config.c ++++ b/src/common/kern_config.c +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/egress/egress.c b/src/egress/egress.c +index 0935d82..ec2484b 100644 +--- a/src/egress/egress.c ++++ b/src/egress/egress.c +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/egress/egress.h b/src/egress/egress.h +index 316c1af..0c40bfe 100644 +--- a/src/egress/egress.h ++++ b/src/egress/egress.h +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/ingress/ingress.c b/src/ingress/ingress.c +index 51a17c8..d7b5f64 100644 +--- a/src/ingress/ingress.c ++++ b/src/ingress/ingress.c +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/ingress/ingress.h b/src/ingress/ingress.h +index 927b5ed..da6ee87 100644 +--- a/src/ingress/ingress.h ++++ b/src/ingress/ingress.h +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/lib/base.h b/src/lib/base.h +index a5d9c21..3d97816 100644 +--- a/src/lib/base.h ++++ b/src/lib/base.h +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/lib/config/config.c b/src/lib/config/config.c +index d8ce2a5..ac836cb 100644 +--- a/src/lib/config/config.c ++++ b/src/lib/config/config.c +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/lib/config/config.h b/src/lib/config/config.h +index 6eefc69..30af00a 100644 +--- a/src/lib/config/config.h ++++ b/src/lib/config/config.h +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/lib/fifo/fifo.c b/src/lib/fifo/fifo.c +index 7b5d784..be4a90a 100644 +--- a/src/lib/fifo/fifo.c ++++ b/src/lib/fifo/fifo.c +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/lib/fifo/fifo.h b/src/lib/fifo/fifo.h +index 88d445a..ae2b03c 100644 +--- a/src/lib/fifo/fifo.h ++++ b/src/lib/fifo/fifo.h +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/lib/imdb/imdb.c b/src/lib/imdb/imdb.c +index 453c1fe..51508b2 100644 +--- a/src/lib/imdb/imdb.c ++++ b/src/lib/imdb/imdb.c +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/lib/imdb/imdb.h b/src/lib/imdb/imdb.h +index 4d93c40..7832ea6 100644 +--- a/src/lib/imdb/imdb.h ++++ b/src/lib/imdb/imdb.h +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/lib/imdb/metrics.c b/src/lib/imdb/metrics.c +index 64f6335..89c75f5 100644 +--- a/src/lib/imdb/metrics.c ++++ b/src/lib/imdb/metrics.c +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/lib/kafka/kafka.c b/src/lib/kafka/kafka.c +index a240cd4..b6d4a4e 100644 +--- a/src/lib/kafka/kafka.c ++++ b/src/lib/kafka/kafka.c +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/lib/kafka/kafka.h b/src/lib/kafka/kafka.h +index 1e5c52a..bbe921a 100644 +--- a/src/lib/kafka/kafka.h ++++ b/src/lib/kafka/kafka.h +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/lib/meta/meta.c b/src/lib/meta/meta.c +index 12b3576..632741a 100644 +--- a/src/lib/meta/meta.c ++++ b/src/lib/meta/meta.c +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/lib/meta/meta.h b/src/lib/meta/meta.h +index 2be952d..809b8a0 100644 +--- a/src/lib/meta/meta.h ++++ b/src/lib/meta/meta.h +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/lib/probe/extend_probe.c b/src/lib/probe/extend_probe.c +index c7de9ed..8c989ce 100644 +--- a/src/lib/probe/extend_probe.c ++++ b/src/lib/probe/extend_probe.c +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/lib/probe/extend_probe.h b/src/lib/probe/extend_probe.h +index cd7721f..204e5d6 100644 +--- a/src/lib/probe/extend_probe.h ++++ b/src/lib/probe/extend_probe.h +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/lib/probe/nprobe_fprintf.h b/src/lib/probe/nprobe_fprintf.h +index 400626c..97e2f72 100644 +--- a/src/lib/probe/nprobe_fprintf.h ++++ b/src/lib/probe/nprobe_fprintf.h +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/lib/probe/probe.c b/src/lib/probe/probe.c +index fb9bfdb..ab84fd3 100644 +--- a/src/lib/probe/probe.c ++++ b/src/lib/probe/probe.c +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/lib/probe/probe.h b/src/lib/probe/probe.h +index 31fdf20..8faabca 100644 +--- a/src/lib/probe/probe.h ++++ b/src/lib/probe/probe.h +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/probes/event.probe/event.c b/src/probes/event.probe/event.c +index 37578de..7d0f8ca 100644 +--- a/src/probes/event.probe/event.c ++++ b/src/probes/event.probe/event.c +@@ -1,6 +1,6 @@ + /* + * Copyright (c) Huawei Technologies Co., Ltd. 2021-2022. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/probes/event.probe/event.h b/src/probes/event.probe/event.h +index 42fc824..b52ae86 100644 +--- a/src/probes/event.probe/event.h ++++ b/src/probes/event.probe/event.h +@@ -1,6 +1,6 @@ + /* + * Copyright (c) Huawei Technologies Co., Ltd. 2021-2022. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/probes/extends/ebpf.probe/src/stackprobe/conf/stackprobe_config.c b/src/probes/extends/ebpf.probe/src/stackprobe/conf/stackprobe_config.c +index ed6ae19..05d93fb 100644 +--- a/src/probes/extends/ebpf.probe/src/stackprobe/conf/stackprobe_config.c ++++ b/src/probes/extends/ebpf.probe/src/stackprobe/conf/stackprobe_config.c +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/resource/resource.c b/src/resource/resource.c +index 730ecd7..8d62265 100644 +--- a/src/resource/resource.c ++++ b/src/resource/resource.c +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/resource/resource.h b/src/resource/resource.h +index 4308e1e..b5f4edb 100644 +--- a/src/resource/resource.h ++++ b/src/resource/resource.h +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/web_server/web_server.c b/src/web_server/web_server.c +index d65abca..4d8141a 100644 +--- a/src/web_server/web_server.c ++++ b/src/web_server/web_server.c +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +diff --git a/src/web_server/web_server.h b/src/web_server/web_server.h +index f436988..f3c53ee 100644 +--- a/src/web_server/web_server.h ++++ b/src/web_server/web_server.h +@@ -1,6 +1,6 @@ + /****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +- * iSulad licensed under the Mulan PSL v2. ++ * gala-gopher licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 +-- +2.33.0 + diff --git a/fix-fix-fd-leakage-problem.patch b/fix-fix-fd-leakage-problem.patch new file mode 100644 index 0000000..c6aa5de --- /dev/null +++ b/fix-fix-fd-leakage-problem.patch @@ -0,0 +1,96 @@ +From 80629a576c18dbf132cd9d6a3a6bfc7ae3af516d Mon Sep 17 00:00:00 2001 +From: algorithmofdish +Date: Wed, 26 Apr 2023 16:58:02 +0800 +Subject: [PATCH] fix: fix fd leakage problem + +Conficts: src/probes/extends/ebpf.probe/src/{lib->stackprobe}/java_support.c + +--- + src/probes/extends/ebpf.probe/src/haproxyprobe/trace_haproxy.c | 4 ++++ + src/probes/extends/ebpf.probe/src/stackprobe/java_support.c | 2 ++ + test/test_probes/test_probes.c | 6 ++++++ + 3 files changed, 12 insertions(+) + +diff --git a/src/probes/extends/ebpf.probe/src/haproxyprobe/trace_haproxy.c b/src/probes/extends/ebpf.probe/src/haproxyprobe/trace_haproxy.c +index 39e1827..cc5e771 100644 +--- a/src/probes/extends/ebpf.probe/src/haproxyprobe/trace_haproxy.c ++++ b/src/probes/extends/ebpf.probe/src/haproxyprobe/trace_haproxy.c +@@ -55,8 +55,12 @@ static void get_host_ip(const unsigned char *value, unsigned short family) + } + + fp = popen(cmd, "r"); ++ if (fp == NULL) { ++ return; ++ } + if (fgets(buffer, INET6_ADDRSTRLEN, fp) == NULL) { + printf("Fail get_host_ip.\n"); ++ (void)pclose(fp); + return ; + } + (void)pclose(fp); +diff --git a/src/probes/extends/ebpf.probe/src/stackprobe/java_support.c b/src/probes/extends/ebpf.probe/src/stackprobe/java_support.c +index 1aacb99..4a2c736 100644 +--- a/src/probes/extends/ebpf.probe/src/stackprobe/java_support.c ++++ b/src/probes/extends/ebpf.probe/src/stackprobe/java_support.c +@@ -211,6 +211,7 @@ static int __check_proc_to_attach(int proc_obj_map_fd) + + while (fgets(line, sizeof(line), f)) { + if (sscanf(line, "%d", &pid) != 1) { ++ (void)pclose(f); + return -1; + } + if (proc_obj_map_fd != 0) { // whitelist_enable +@@ -241,6 +242,7 @@ static int __check_proc_to_attach(int proc_obj_map_fd) + } + + } ++ (void)pclose(f); + return ret; + } + +diff --git a/test/test_probes/test_probes.c b/test/test_probes/test_probes.c +index 6f23117..3c608ca 100644 +--- a/test/test_probes/test_probes.c ++++ b/test/test_probes/test_probes.c +@@ -332,14 +332,17 @@ void TestSystemProcProbe(void) + snprintf(cmd, COMMAND_LEN - 1, "touch /tmp/gala-gopher-app.conf"); + f = popen(cmd, "r"); + CU_ASSERT(f != NULL); ++ (void)pclose(f); + + snprintf(cmd, COMMAND_LEN - 1, "echo \'application = ({ comm = \"sleep\", cmdline = \"\"})\' >/tmp/gala-gopher-app.conf"); + f = popen(cmd, "r"); + CU_ASSERT(f != NULL); ++ (void)pclose(f); + + snprintf(cmd, COMMAND_LEN - 1, "sleep 60 &"); + f = popen(cmd, "r"); + CU_ASSERT(f != NULL); ++ (void)pclose(f); + + system_proc_init(¶ms.task_whitelist); + CU_ASSERT(¶ms.task_whitelist != NULL); +@@ -353,10 +356,12 @@ void TestSystemProcProbe(void) + snprintf(cmd, COMMAND_LEN - 1, "rm -rf /tmp/gala-gopher-app.conf"); + f = popen(cmd, "r"); + CU_ASSERT(f != NULL); ++ (void)pclose(f); + + snprintf(cmd, COMMAND_LEN - 1, "rm -rf /sys/fs/bpf/gala-gopher"); + f = popen(cmd, "r"); + CU_ASSERT(f != NULL); ++ (void)pclose(f); + + ProbeDestroy(g_probe); + system_proc_destroy(); +@@ -388,6 +393,7 @@ void TestEventProbe(void) + snprintf(cmd, COMMAND_LEN - 1, "echo \"%s\" >> /var/log/messages", EVENT_ERR_CODE); + f = popen(cmd, "r"); + CU_ASSERT(f != NULL); ++ pclose(f); + + g_probe = ProbeCreate(); + CU_ASSERT(g_probe != NULL); +-- +2.33.0 + diff --git a/fix-fix-install-error.patch b/fix-fix-install-error.patch new file mode 100644 index 0000000..b1dbe9d --- /dev/null +++ b/fix-fix-install-error.patch @@ -0,0 +1,36 @@ +From 2408b163c4c0a2fdfeac4e710b24391e87b9f6a5 Mon Sep 17 00:00:00 2001 +From: dowzyx +Date: Wed, 10 May 2023 11:20:25 +0800 +Subject: [PATCH] fix: fix install error + +--- + build/install.sh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/build/install.sh b/build/install.sh +index d92f135..fce8aeb 100755 +--- a/build/install.sh ++++ b/build/install.sh +@@ -37,7 +37,9 @@ function install_daemon_bin() + echo "${GOPHER_BIN_FILE} not exist. please check if build success." + exit 1 + fi +- ++ if [ ! -d ${GOPHER_BIN_TARGET_DIR} ]; then ++ mkdir -p ${GOPHER_BIN_TARGET_DIR} ++ fi + # install gala-gopher bin + cp -f ${GOPHER_BIN_FILE} ${GOPHER_BIN_TARGET_DIR} + echo "install ${GOPHER_BIN_FILE} success." +@@ -65,7 +67,7 @@ function install_conf() + + # install gala-gopher.conf + if [ ! -d ${GOPHER_CONF_TARGET_DIR} ]; then +- mkdir ${GOPHER_CONF_TARGET_DIR} ++ mkdir -p ${GOPHER_CONF_TARGET_DIR} + fi + cp -f ${GOPHER_CONF_FILE} ${GOPHER_CONF_TARGET_DIR} + echo "install ${GOPHER_CONF_FILE} success." +-- +2.33.0 + diff --git a/fix-httpprobe-find-libssl-path.patch b/fix-httpprobe-find-libssl-path.patch new file mode 100644 index 0000000..a95b2ba --- /dev/null +++ b/fix-httpprobe-find-libssl-path.patch @@ -0,0 +1,50 @@ +From 78afbbed90b312ff308b5be0fba24d42a3f122ca Mon Sep 17 00:00:00 2001 +From: xietangxin +Date: Thu, 13 Apr 2023 14:35:00 +0800 +Subject: [PATCH] fix httpprobe find libssl path + +--- + src/daemon/daemon.c | 2 +- + src/probes/extends/ebpf.probe/src/httpprobe/httpprobe.c | 6 ++++-- + 2 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c +index b10ca60..3b16a75 100644 +--- a/src/daemon/daemon.c ++++ b/src/daemon/daemon.c +@@ -172,7 +172,7 @@ static void DaemonKeeplive(int sig) + (void)pthread_detach(probe->tid); + + INFO("[DAEMON] keeplive create probe(%s) thread.\n", probe->name); +- break; ++ continue; + } + } + return; +diff --git a/src/probes/extends/ebpf.probe/src/httpprobe/httpprobe.c b/src/probes/extends/ebpf.probe/src/httpprobe/httpprobe.c +index 477fe43..e64a706 100644 +--- a/src/probes/extends/ebpf.probe/src/httpprobe/httpprobe.c ++++ b/src/probes/extends/ebpf.probe/src/httpprobe/httpprobe.c +@@ -42,6 +42,7 @@ + #define APACHE_PATH "which httpd" + #define NGINX_SSL_PATH "ldd $(which nginx) | grep libssl | awk '{print $3}'" + #define APACHE_SSL_PATH "ldd /etc/httpd/modules/mod_ssl.so | grep libssl | awk '{print $3}'" ++#define HTTPD_SSL_PATH "/etc/httpd/modules/mod_ssl.so" + + #define LOAD_HTTP_PROBE(probe_name, end, load) \ + OPEN(probe_name, end, load); \ +@@ -81,8 +82,9 @@ static void get_libssl_path(char *nginx_sslpath, char *apache_sslpath) + } + pclose(f1); + f1 = popen(APACHE_PATH, "r"); +- if (fgets(buf, PATH_LEN, f1) != NULL && strlen(buf) > 0 && !(buf[strlen(buf) - 1] = 0) && access(buf, F_OK) == 0) { +- if ((f2 = popen(NGINX_SSL_PATH, "r")) != NULL && fgets(apache_sslpath, PATH_LEN, f2) != NULL) { ++ if (fgets(buf, PATH_LEN, f1) != NULL && strlen(buf) > 0 && !(buf[strlen(buf) - 1] = 0) && ++ access(buf, F_OK) == 0 && access(HTTPD_SSL_PATH, F_OK) == 0) { ++ if ((f2 = popen(APACHE_SSL_PATH, "r")) != NULL && fgets(apache_sslpath, PATH_LEN, f2) != NULL) { + if (strlen(apache_sslpath) != 0) { + apache_sslpath[strlen(apache_sslpath) - 1] = 0; + } +-- +2.33.0 + diff --git a/fix-prepare_dependence.patch b/fix-prepare_dependence.patch new file mode 100644 index 0000000..b7673de --- /dev/null +++ b/fix-prepare_dependence.patch @@ -0,0 +1,47 @@ +From cabacb208974b002f01268e988a0b32062d0f730 Mon Sep 17 00:00:00 2001 +From: sjxur +Date: Wed, 19 Apr 2023 16:32:20 +0800 +Subject: [PATCH] fix prepare_dependence + +--- + build/build.sh | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/build/build.sh b/build/build.sh +index d66da9a..696a902 100755 +--- a/build/build.sh ++++ b/build/build.sh +@@ -228,6 +228,30 @@ function prepare_dependence() + return 1 + fi + ++ yum install -y libbpf-devel ++ if [ $? -ne 0 ];then ++ echo "Error: Failed to install libbpf-devel." ++ return 1 ++ fi ++ ++ yum install -y clang ++ if [ $? -ne 0 ];then ++ echo "Error: Failed to install clang." ++ return 1 ++ fi ++ ++ yum install -y llvm ++ if [ $? -ne 0 ];then ++ echo "Error: Failed to install llvm." ++ return 1 ++ fi ++ ++ yum install -y java-1.8.0-openjdk-devel ++ if [ $? -ne 0 ];then ++ echo "Error: Failed to install java-1.8.0-openjdk-devel" ++ return 1 ++ fi ++ + return 0 + } + +-- +2.33.0 + diff --git a/gala-gopher.spec b/gala-gopher.spec index c668ff3..4ac36b6 100644 --- a/gala-gopher.spec +++ b/gala-gopher.spec @@ -6,7 +6,7 @@ Summary: Intelligent ops toolkit for openEuler Name: gala-gopher Version: 1.0.2 -Release: 2 +Release: 3 License: Mulan PSL v2 URL: https://gitee.com/openeuler/gala-gopher Source: %{name}-%{version}.tar.gz @@ -27,6 +27,20 @@ Patch4: bugfix-fix-system_proc-collect-data-err.patch Patch5: Fix-for-popen-cannot-get-stderr.patch Patch6: bugfix-add-check-whether-cadvisor-is-installed.patch Patch7: stackprobe-fix-inaccurate-call-stack-count.-add-samp.patch +Patch8: fix-httpprobe-find-libssl-path.patch +Patch9: Fix-segmentation-fault-of-gala-gopher-cmd.patch +Patch10: fix-prepare_dependence.patch +Patch11: bugfix-The-log-time-is-not-the-local-time.patch +Patch12: fix-fix-fd-leakage-problem.patch +Patch13: cadvisor_probe-convert-container_id-type-to-bytes.patch +Patch14: adapt-block_rq_issue-tracepoint-args-in-kernel-5.10.patch +Patch15: modify-desc-from-chinese-to-english.patch +Patch16: bugfix-fix-gala-gopher-h-print-err.patch +Patch17: fix-change-license-software-name.patch +Patch18: fix-fix-install-error.patch +Patch19: bugfix-zombie-task.patch +Patch20: fix-add-default-data-of-event-conf.patch +Patch21: fix-access-violation.patch %description gala-gopher is a low-overhead eBPF-based probes framework @@ -86,6 +100,22 @@ fi /usr/lib/systemd/system/gala-gopher.service %changelog +* Fri Jun 9 2023 Tangxin Xie - 1.0.2-3 +- fix httpprobe find libssl path + Fix segmentation fault of gala-gopher cmd + fix prepare_dependence + bugfix:The log time is not the local time + fix: fix fd leakage problem + cadvisor_probe:convert container_id type to bytes + adapt block_rq_issue tracepoint args in kernel-5.10 + modify desc from chinese to english + bugfix: fix gala-gopher -h print err + fix: change license software name + fix: fix install error + bugfix: zombie task. + fix:add default data of event conf + fix access violation + * Fri Apr 7 2023 Tangxin Xie - 1.0.2-2 - bugfix add check whether cadvisor is installed bugfix fix system_proc collect data err diff --git a/modify-desc-from-chinese-to-english.patch b/modify-desc-from-chinese-to-english.patch new file mode 100644 index 0000000..f46aff0 --- /dev/null +++ b/modify-desc-from-chinese-to-english.patch @@ -0,0 +1,25 @@ +From c1787926da3435a53de49fc3ff70122f38509952 Mon Sep 17 00:00:00 2001 +From: dowzyx +Date: Fri, 28 Apr 2023 11:23:24 +0800 +Subject: [PATCH] modify desc from chinese to english + +--- + .../extends/java.probe/jvm.probe/src/agent/JvmProbeAgent.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/probes/extends/java.probe/jvm.probe/src/agent/JvmProbeAgent.java b/src/probes/extends/java.probe/jvm.probe/src/agent/JvmProbeAgent.java +index d7f635d..e421983 100644 +--- a/src/probes/extends/java.probe/jvm.probe/src/agent/JvmProbeAgent.java ++++ b/src/probes/extends/java.probe/jvm.probe/src/agent/JvmProbeAgent.java +@@ -72,7 +72,7 @@ public class JvmProbeAgent { + + private static void infoCollector(RuntimeMXBean runtimeBean) { + String jvmName = runtimeBean.getVmName(); +- String jvmVersion = runtimeBean.getVmVersion(); // 原始的为getSpecVersion(); ++ String jvmVersion = runtimeBean.getVmVersion(); // or getSpecVersion(); + String jvmVender = runtimeBean.getVmVendor(); + + writeMetricRecords(String.format("|jvm_info|%s|%s|%s|%s|%d|\n", pid, jvmName, jvmVender, jvmVersion, 1)); +-- +2.33.0 + -- Gitee