summaryrefslogtreecommitdiffstats
path: root/collectors/ebpf.plugin
diff options
context:
space:
mode:
authorthiagoftsm <thiagoftsm@gmail.com>2023-07-06 15:46:48 +0000
committerGitHub <noreply@github.com>2023-07-06 15:46:48 +0000
commite0f388c43f3144abb871cce2a7b44e85a36de48f (patch)
treecf41e5ae11ae7d0ad5ec0b49f5f4ac4531189eb3 /collectors/ebpf.plugin
parent3cc220ff5e38ef5cd96a64596c7e0c370d0fa074 (diff)
Rename generic `error` function (#15296)
Diffstat (limited to 'collectors/ebpf.plugin')
-rw-r--r--collectors/ebpf.plugin/ebpf.c26
-rw-r--r--collectors/ebpf.plugin/ebpf_apps.c26
-rw-r--r--collectors/ebpf.plugin/ebpf_cachestat.c4
-rw-r--r--collectors/ebpf.plugin/ebpf_cgroup.c6
-rw-r--r--collectors/ebpf.plugin/ebpf_dcstat.c2
-rw-r--r--collectors/ebpf.plugin/ebpf_disk.c10
-rw-r--r--collectors/ebpf.plugin/ebpf_fd.c4
-rw-r--r--collectors/ebpf.plugin/ebpf_hardirq.c2
-rw-r--r--collectors/ebpf.plugin/ebpf_mdflush.c6
-rw-r--r--collectors/ebpf.plugin/ebpf_mount.c2
-rw-r--r--collectors/ebpf.plugin/ebpf_oomkill.c2
-rw-r--r--collectors/ebpf.plugin/ebpf_process.c6
-rw-r--r--collectors/ebpf.plugin/ebpf_shm.c2
-rw-r--r--collectors/ebpf.plugin/ebpf_socket.c12
-rw-r--r--collectors/ebpf.plugin/ebpf_swap.c2
15 files changed, 56 insertions, 56 deletions
diff --git a/collectors/ebpf.plugin/ebpf.c b/collectors/ebpf.plugin/ebpf.c
index a9afad803e..238286d92f 100644
--- a/collectors/ebpf.plugin/ebpf.c
+++ b/collectors/ebpf.plugin/ebpf.c
@@ -557,7 +557,7 @@ ARAL *ebpf_allocate_pid_aral(char *name, size_t size)
{
static size_t max_elements = NETDATA_EBPF_ALLOC_MAX_PID;
if (max_elements < NETDATA_EBPF_ALLOC_MIN_ELEMENTS) {
- error("Number of elements given is too small, adjusting it for %d", NETDATA_EBPF_ALLOC_MIN_ELEMENTS);
+ netdata_log_error("Number of elements given is too small, adjusting it for %d", NETDATA_EBPF_ALLOC_MIN_ELEMENTS);
max_elements = NETDATA_EBPF_ALLOC_MIN_ELEMENTS;
}
@@ -593,7 +593,7 @@ static inline void ebpf_check_before2go()
}
if (i) {
- error("eBPF cannot unload all threads on time, but it will go away");
+ netdata_log_error("eBPF cannot unload all threads on time, but it will go away");
}
}
@@ -614,10 +614,10 @@ static void ebpf_exit()
char filename[FILENAME_MAX + 1];
ebpf_pid_file(filename, FILENAME_MAX);
if (unlink(filename))
- error("Cannot remove PID file %s", filename);
+ netdata_log_error("Cannot remove PID file %s", filename);
#ifdef NETDATA_INTERNAL_CHECKS
- error("Good bye world! I was PID %d", main_thread_id);
+ netdata_log_error("Good bye world! I was PID %d", main_thread_id);
#endif
fprintf(stdout, "EXIT\n");
fflush(stdout);
@@ -670,7 +670,7 @@ static void ebpf_unload_unique_maps()
if (ebpf_modules[i].enabled != NETDATA_THREAD_EBPF_STOPPED) {
if (ebpf_modules[i].enabled != NETDATA_THREAD_EBPF_NOT_RUNNING)
- error("Cannot unload maps for thread %s, because it is not stopped.", ebpf_modules[i].thread_name);
+ netdata_log_error("Cannot unload maps for thread %s, because it is not stopped.", ebpf_modules[i].thread_name);
continue;
}
@@ -1605,7 +1605,7 @@ static void read_local_addresses()
{
struct ifaddrs *ifaddr, *ifa;
if (getifaddrs(&ifaddr) == -1) {
- error("Cannot get the local IP addresses, it is no possible to do separation between inbound and outbound connections");
+ netdata_log_error("Cannot get the local IP addresses, it is no possible to do separation between inbound and outbound connections");
return;
}
@@ -1714,7 +1714,7 @@ static inline void how_to_load(char *ptr)
else if (!strcasecmp(ptr, EBPF_CFG_LOAD_MODE_DEFAULT))
ebpf_set_thread_mode(MODE_ENTRY);
else
- error("the option %s for \"ebpf load mode\" is not a valid option.", ptr);
+ netdata_log_error("the option %s for \"ebpf load mode\" is not a valid option.", ptr);
}
/**
@@ -2051,7 +2051,7 @@ void set_global_variables()
ebpf_nprocs = (int)sysconf(_SC_NPROCESSORS_ONLN);
if (ebpf_nprocs < 0) {
ebpf_nprocs = NETDATA_MAX_PROCESSOR;
- error("Cannot identify number of process, using default value %d", ebpf_nprocs);
+ netdata_log_error("Cannot identify number of process, using default value %d", ebpf_nprocs);
}
isrh = get_redhat_release();
@@ -2080,12 +2080,12 @@ static inline void ebpf_load_thread_config()
int ebpf_check_conditions()
{
if (!has_condition_to_run(running_on_kernel)) {
- error("The current collector cannot run on this kernel.");
+ netdata_log_error("The current collector cannot run on this kernel.");
return -1;
}
if (!am_i_running_as_root()) {
- error(
+ netdata_log_error(
"ebpf.plugin should either run as root (now running with uid %u, euid %u) or have special capabilities..",
(unsigned int)getuid(), (unsigned int)geteuid());
return -1;
@@ -2105,7 +2105,7 @@ int ebpf_adjust_memory_limit()
{
struct rlimit r = { RLIM_INFINITY, RLIM_INFINITY };
if (setrlimit(RLIMIT_MEMLOCK, &r)) {
- error("Setrlimit(RLIMIT_MEMLOCK)");
+ netdata_log_error("Setrlimit(RLIMIT_MEMLOCK)");
return -1;
}
@@ -2398,7 +2398,7 @@ unittest:
ebpf_user_config_dir, ebpf_stock_config_dir);
if (ebpf_read_apps_groups_conf(
&apps_groups_default_target, &apps_groups_root_target, ebpf_stock_config_dir, "groups")) {
- error("Cannot read process groups '%s/apps_groups.conf'. There are no internal defaults. Failing.",
+ netdata_log_error("Cannot read process groups '%s/apps_groups.conf'. There are no internal defaults. Failing.",
ebpf_stock_config_dir);
ebpf_exit();
}
@@ -2445,7 +2445,7 @@ static char *ebpf_get_process_name(pid_t pid)
procfile *ff = procfile_open(filename, " \t", PROCFILE_FLAG_DEFAULT);
if(unlikely(!ff)) {
- error("Cannot open %s", filename);
+ netdata_log_error("Cannot open %s", filename);
return name;
}
diff --git a/collectors/ebpf.plugin/ebpf_apps.c b/collectors/ebpf.plugin/ebpf_apps.c
index d3e778c866..a7091bc1c3 100644
--- a/collectors/ebpf.plugin/ebpf_apps.c
+++ b/collectors/ebpf.plugin/ebpf_apps.c
@@ -35,7 +35,7 @@ void ebpf_aral_init(void)
{
size_t max_elements = NETDATA_EBPF_ALLOC_MAX_PID;
if (max_elements < NETDATA_EBPF_ALLOC_MIN_ELEMENTS) {
- error("Number of elements given is too small, adjusting it for %d", NETDATA_EBPF_ALLOC_MIN_ELEMENTS);
+ netdata_log_error("Number of elements given is too small, adjusting it for %d", NETDATA_EBPF_ALLOC_MIN_ELEMENTS);
max_elements = NETDATA_EBPF_ALLOC_MIN_ELEMENTS;
}
@@ -652,7 +652,7 @@ int ebpf_read_apps_groups_conf(struct ebpf_target **agdt, struct ebpf_target **a
// add this target
struct ebpf_target *n = get_apps_groups_target(agrt, s, w, name);
if (!n) {
- error("Cannot create target '%s' (line %zu, word %zu)", s, line, word);
+ netdata_log_error("Cannot create target '%s' (line %zu, word %zu)", s, line, word);
continue;
}
@@ -755,32 +755,32 @@ static inline void debug_log_dummy(void)
static inline int managed_log(struct ebpf_pid_stat *p, uint32_t log, int status)
{
if (unlikely(!status)) {
- // error("command failed log %u, errno %d", log, errno);
+ // netdata_log_error("command failed log %u, errno %d", log, errno);
if (unlikely(debug_enabled || errno != ENOENT)) {
if (unlikely(debug_enabled || !(p->log_thrown & log))) {
p->log_thrown |= log;
switch (log) {
case PID_LOG_IO:
- error(
+ netdata_log_error(
"Cannot process %s/proc/%d/io (command '%s')", netdata_configured_host_prefix, p->pid,
p->comm);
break;
case PID_LOG_STATUS:
- error(
+ netdata_log_error(
"Cannot process %s/proc/%d/status (command '%s')", netdata_configured_host_prefix, p->pid,
p->comm);
break;
case PID_LOG_CMDLINE:
- error(
+ netdata_log_error(
"Cannot process %s/proc/%d/cmdline (command '%s')", netdata_configured_host_prefix, p->pid,
p->comm);
break;
case PID_LOG_FDS:
- error(
+ netdata_log_error(
"Cannot process entries in %s/proc/%d/fd (command '%s')", netdata_configured_host_prefix,
p->pid, p->comm);
break;
@@ -789,14 +789,14 @@ static inline int managed_log(struct ebpf_pid_stat *p, uint32_t log, int status)
break;
default:
- error("unhandled error for pid %d, command '%s'", p->pid, p->comm);
+ netdata_log_error("unhandled error for pid %d, command '%s'", p->pid, p->comm);
break;
}
}
}
errno = 0;
} else if (unlikely(p->log_thrown & log)) {
- // error("unsetting log %u on pid %d", log, p->pid);
+ // netdata_log_error("unsetting log %u on pid %d", log, p->pid);
p->log_thrown &= ~log;
}
@@ -1005,7 +1005,7 @@ static inline int read_proc_pid_stat(struct ebpf_pid_stat *p, void *ptr)
static inline int collect_data_for_pid(pid_t pid, void *ptr)
{
if (unlikely(pid < 0 || pid > pid_max)) {
- error("Invalid pid %d read (expected %d to %d). Ignoring process.", pid, 0, pid_max);
+ netdata_log_error("Invalid pid %d read (expected %d to %d). Ignoring process.", pid, 0, pid_max);
return 0;
}
@@ -1020,7 +1020,7 @@ static inline int collect_data_for_pid(pid_t pid, void *ptr)
// check its parent pid
if (unlikely(p->ppid < 0 || p->ppid > pid_max)) {
- error("Pid %d (command '%s') states invalid parent pid %d. Using 0.", pid, p->comm, p->ppid);
+ netdata_log_error("Pid %d (command '%s') states invalid parent pid %d. Using 0.", pid, p->comm, p->ppid);
p->ppid = 0;
}
@@ -1220,7 +1220,7 @@ static inline void del_pid_entry(pid_t pid)
struct ebpf_pid_stat *p = ebpf_all_pids[pid];
if (unlikely(!p)) {
- error("attempted to free pid %d that is not allocated.", pid);
+ netdata_log_error("attempted to free pid %d that is not allocated.", pid);
return;
}
@@ -1403,7 +1403,7 @@ static inline void aggregate_pid_on_target(struct ebpf_target *w, struct ebpf_pi
}
if (unlikely(!w)) {
- error("pid %d %s was left without a target!", p->pid, p->comm);
+ netdata_log_error("pid %d %s was left without a target!", p->pid, p->comm);
return;
}
diff --git a/collectors/ebpf.plugin/ebpf_cachestat.c b/collectors/ebpf.plugin/ebpf_cachestat.c
index c287136cfd..8008c4c55a 100644
--- a/collectors/ebpf.plugin/ebpf_cachestat.c
+++ b/collectors/ebpf.plugin/ebpf_cachestat.c
@@ -1220,7 +1220,7 @@ static int ebpf_cachestat_set_internal_value()
}
if (!address.addr) {
- error("%s cachestat.", NETDATA_EBPF_DEFAULT_FNT_NOT_FOUND);
+ netdata_log_error("%s cachestat.", NETDATA_EBPF_DEFAULT_FNT_NOT_FOUND);
return -1;
}
@@ -1261,7 +1261,7 @@ static int ebpf_cachestat_load_bpf(ebpf_module_t *em)
#endif
if (ret)
- error("%s %s", EBPF_DEFAULT_ERROR_MSG, em->thread_name);
+ netdata_log_error("%s %s", EBPF_DEFAULT_ERROR_MSG, em->thread_name);
return ret;
}
diff --git a/collectors/ebpf.plugin/ebpf_cgroup.c b/collectors/ebpf.plugin/ebpf_cgroup.c
index 92b56709fb..fd4e783db1 100644
--- a/collectors/ebpf.plugin/ebpf_cgroup.c
+++ b/collectors/ebpf.plugin/ebpf_cgroup.c
@@ -28,7 +28,7 @@ static inline void *ebpf_cgroup_map_shm_locally(int fd, size_t length)
value = mmap(NULL, length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (!value) {
- error("Cannot map shared memory used between eBPF and cgroup, integration between processes won't happen");
+ netdata_log_error("Cannot map shared memory used between eBPF and cgroup, integration between processes won't happen");
close(shm_fd_ebpf_cgroup);
shm_fd_ebpf_cgroup = -1;
shm_unlink(NETDATA_SHARED_MEMORY_EBPF_CGROUP_NAME);
@@ -71,7 +71,7 @@ void ebpf_map_cgroup_shared_memory()
shm_fd_ebpf_cgroup = shm_open(NETDATA_SHARED_MEMORY_EBPF_CGROUP_NAME, O_RDWR, 0660);
if (shm_fd_ebpf_cgroup < 0) {
if (limit_try == NETDATA_EBPF_CGROUP_MAX_TRIES)
- error("Shared memory was not initialized, integration between processes won't happen.");
+ netdata_log_error("Shared memory was not initialized, integration between processes won't happen.");
return;
}
@@ -103,7 +103,7 @@ void ebpf_map_cgroup_shared_memory()
shm_sem_ebpf_cgroup = sem_open(NETDATA_NAMED_SEMAPHORE_EBPF_CGROUP_NAME, O_CREAT, 0660, 1);
if (shm_sem_ebpf_cgroup == SEM_FAILED) {
- error("Cannot create semaphore, integration between eBPF and cgroup won't happen");
+ netdata_log_error("Cannot create semaphore, integration between eBPF and cgroup won't happen");
limit_try = NETDATA_EBPF_CGROUP_MAX_TRIES + 1;
munmap(ebpf_mapped_memory, length);
shm_ebpf_cgroup.header = NULL;
diff --git a/collectors/ebpf.plugin/ebpf_dcstat.c b/collectors/ebpf.plugin/ebpf_dcstat.c
index d3c4a530b6..cdcb55b2cd 100644
--- a/collectors/ebpf.plugin/ebpf_dcstat.c
+++ b/collectors/ebpf.plugin/ebpf_dcstat.c
@@ -1112,7 +1112,7 @@ static int ebpf_dcstat_load_bpf(ebpf_module_t *em)
#endif
if (ret)
- error("%s %s", EBPF_DEFAULT_ERROR_MSG, em->thread_name);
+ netdata_log_error("%s %s", EBPF_DEFAULT_ERROR_MSG, em->thread_name);
return ret;
}
diff --git a/collectors/ebpf.plugin/ebpf_disk.c b/collectors/ebpf.plugin/ebpf_disk.c
index 026e44ec89..9f32628a22 100644
--- a/collectors/ebpf.plugin/ebpf_disk.c
+++ b/collectors/ebpf.plugin/ebpf_disk.c
@@ -341,7 +341,7 @@ static void update_disk_table(char *name, int major, int minor, time_t current_t
netdata_ebpf_disks_t *check;
check = (netdata_ebpf_disks_t *) avl_insert_lock(&disk_tree, (avl_t *)w);
if (check != w)
- error("Internal error, cannot insert the AVL tree.");
+ netdata_log_error("Internal error, cannot insert the AVL tree.");
#ifdef NETDATA_INTERNAL_CHECKS
netdata_log_info("The Latency is monitoring the hard disk %s (Major = %d, Minor = %d, Device = %u)", name, major, minor,w->dev);
@@ -424,12 +424,12 @@ static void ebpf_disk_disable_tracepoints()
char *default_message = { "Cannot disable the tracepoint" };
if (!was_block_issue_enabled) {
if (ebpf_disable_tracing_values(tracepoint_block_type, tracepoint_block_issue))
- error("%s %s/%s.", default_message, tracepoint_block_type, tracepoint_block_issue);
+ netdata_log_error("%s %s/%s.", default_message, tracepoint_block_type, tracepoint_block_issue);
}
if (!was_block_rq_complete_enabled) {
if (ebpf_disable_tracing_values(tracepoint_block_type, tracepoint_block_rq_complete))
- error("%s %s/%s.", default_message, tracepoint_block_type, tracepoint_block_rq_complete);
+ netdata_log_error("%s %s/%s.", default_message, tracepoint_block_type, tracepoint_block_rq_complete);
}
}
@@ -814,7 +814,7 @@ static int ebpf_disk_load_bpf(ebpf_module_t *em)
#endif
if (ret)
- error("%s %s", EBPF_DEFAULT_ERROR_MSG, em->thread_name);
+ netdata_log_error("%s %s", EBPF_DEFAULT_ERROR_MSG, em->thread_name);
return ret;
}
@@ -845,7 +845,7 @@ void *ebpf_disk_thread(void *ptr)
}
if (pthread_mutex_init(&plot_mutex, NULL)) {
- error("Cannot initialize local mutex");
+ netdata_log_error("Cannot initialize local mutex");
goto enddisk;
}
diff --git a/collectors/ebpf.plugin/ebpf_fd.c b/collectors/ebpf.plugin/ebpf_fd.c
index d39e6ae20d..cd7b1086a6 100644
--- a/collectors/ebpf.plugin/ebpf_fd.c
+++ b/collectors/ebpf.plugin/ebpf_fd.c
@@ -326,7 +326,7 @@ static inline int ebpf_fd_load_and_attach(struct fd_bpf *obj, ebpf_module_t *em)
netdata_ebpf_program_loaded_t test = mt[NETDATA_FD_SYSCALL_OPEN].mode;
if (ebpf_fd_set_target_values()) {
- error("%s file descriptor.", NETDATA_EBPF_DEFAULT_FNT_NOT_FOUND);
+ netdata_log_error("%s file descriptor.", NETDATA_EBPF_DEFAULT_FNT_NOT_FOUND);
return -1;
}
@@ -1125,7 +1125,7 @@ static int ebpf_fd_load_bpf(ebpf_module_t *em)
#endif
if (ret)
- error("%s %s", EBPF_DEFAULT_ERROR_MSG, em->thread_name);
+ netdata_log_error("%s %s", EBPF_DEFAULT_ERROR_MSG, em->thread_name);
return ret;
}
diff --git a/collectors/ebpf.plugin/ebpf_hardirq.c b/collectors/ebpf.plugin/ebpf_hardirq.c
index 6dd19e313d..9a98963621 100644
--- a/collectors/ebpf.plugin/ebpf_hardirq.c
+++ b/collectors/ebpf.plugin/ebpf_hardirq.c
@@ -406,7 +406,7 @@ static int hardirq_read_latency_map(int mapfd)
avl_t *check = avl_insert_lock(&hardirq_pub, (avl_t *)v);
if (check != (avl_t *)v) {
- error("Internal error, cannot insert the AVL tree.");
+ netdata_log_error("Internal error, cannot insert the AVL tree.");
}
}
diff --git a/collectors/ebpf.plugin/ebpf_mdflush.c b/collectors/ebpf.plugin/ebpf_mdflush.c
index 7179e5e7ce..e87bff2c28 100644
--- a/collectors/ebpf.plugin/ebpf_mdflush.c
+++ b/collectors/ebpf.plugin/ebpf_mdflush.c
@@ -241,7 +241,7 @@ static void mdflush_read_count_map(int maps_per_core)
if (v_is_new) {
avl_t *check = avl_insert_lock(&mdflush_pub, (avl_t *)v);
if (check != (avl_t *)v) {
- error("Internal error, cannot insert the AVL tree.");
+ netdata_log_error("Internal error, cannot insert the AVL tree.");
}
}
}
@@ -384,7 +384,7 @@ void *ebpf_mdflush_thread(void *ptr)
char *md_flush_request = ebpf_find_symbol("md_flush_request");
if (!md_flush_request) {
- error("Cannot monitor MD devices, because md is not loaded.");
+ netdata_log_error("Cannot monitor MD devices, because md is not loaded.");
goto endmdflush;
}
@@ -393,7 +393,7 @@ void *ebpf_mdflush_thread(void *ptr)
ebpf_adjust_thread_load(em, default_btf);
#endif
if (ebpf_mdflush_load_bpf(em)) {
- error("Cannot load eBPF software.");
+ netdata_log_error("Cannot load eBPF software.");
goto endmdflush;
}
diff --git a/collectors/ebpf.plugin/ebpf_mount.c b/collectors/ebpf.plugin/ebpf_mount.c
index e48c892276..c511523993 100644
--- a/collectors/ebpf.plugin/ebpf_mount.c
+++ b/collectors/ebpf.plugin/ebpf_mount.c
@@ -408,7 +408,7 @@ static int ebpf_mount_load_bpf(ebpf_module_t *em)
#endif
if (ret)
- error("%s %s", EBPF_DEFAULT_ERROR_MSG, em->thread_name);
+ netdata_log_error("%s %s", EBPF_DEFAULT_ERROR_MSG, em->thread_name);
return ret;
}
diff --git a/collectors/ebpf.plugin/ebpf_oomkill.c b/collectors/ebpf.plugin/ebpf_oomkill.c
index 6b6f62aa35..56f637ae95 100644
--- a/collectors/ebpf.plugin/ebpf_oomkill.c
+++ b/collectors/ebpf.plugin/ebpf_oomkill.c
@@ -259,7 +259,7 @@ static uint32_t oomkill_read_data(int32_t *keys)
if (unlikely(test < 0)) {
// since there's only 1 thread doing these deletions, it should be
// impossible to get this condition.
- error("key unexpectedly not available for deletion.");
+ netdata_log_error("key unexpectedly not available for deletion.");
}
}
diff --git a/collectors/ebpf.plugin/ebpf_process.c b/collectors/ebpf.plugin/ebpf_process.c
index 17a9809d3c..c38a733dac 100644
--- a/collectors/ebpf.plugin/ebpf_process.c
+++ b/collectors/ebpf.plugin/ebpf_process.c
@@ -683,17 +683,17 @@ static void ebpf_process_disable_tracepoints()
char *default_message = { "Cannot disable the tracepoint" };
if (!was_sched_process_exit_enabled) {
if (ebpf_disable_tracing_values(tracepoint_sched_type, tracepoint_sched_process_exit))
- error("%s %s/%s.", default_message, tracepoint_sched_type, tracepoint_sched_process_exit);
+ netdata_log_error("%s %s/%s.", default_message, tracepoint_sched_type, tracepoint_sched_process_exit);
}
if (!was_sched_process_exec_enabled) {
if (ebpf_disable_tracing_values(tracepoint_sched_type, tracepoint_sched_process_exec))
- error("%s %s/%s.", default_message, tracepoint_sched_type, tracepoint_sched_process_exec);
+ netdata_log_error("%s %s/%s.", default_message, tracepoint_sched_type, tracepoint_sched_process_exec);
}
if (!was_sched_process_fork_enabled) {
if (ebpf_disable_tracing_values(tracepoint_sched_type, tracepoint_sched_process_fork))
- error("%s %s/%s.", default_message, tracepoint_sched_type, tracepoint_sched_process_fork);
+ netdata_log_error("%s %s/%s.", default_message, tracepoint_sched_type, tracepoint_sched_process_fork);
}
}
diff --git a/collectors/ebpf.plugin/ebpf_shm.c b/collectors/ebpf.plugin/ebpf_shm.c
index 94ac624b30..7e904e4b6c 100644
--- a/collectors/ebpf.plugin/ebpf_shm.c
+++ b/collectors/ebpf.plugin/ebpf_shm.c
@@ -1037,7 +1037,7 @@ static int ebpf_shm_load_bpf(ebpf_module_t *em)
if (ret)
- error("%s %s", EBPF_DEFAULT_ERROR_MSG, em->thread_name);
+ netdata_log_error("%s %s", EBPF_DEFAULT_ERROR_MSG, em->thread_name);
return ret;
}
diff --git a/collectors/ebpf.plugin/ebpf_socket.c b/collectors/ebpf.plugin/ebpf_socket.c
index 8cb5bf0dde..3e9c3036c2 100644
--- a/collectors/ebpf.plugin/ebpf_socket.c
+++ b/collectors/ebpf.plugin/ebpf_socket.c
@@ -1927,7 +1927,7 @@ static void store_socket_inside_avl(netdata_vector_plot_t *out, netdata_socket_t
netdata_socket_plot_t *check ;
check = (netdata_socket_plot_t *) avl_insert_lock(&out->tree, (avl_t *)w);
if (check != w)
- error("Internal error, cannot insert the AVL tree.");
+ netdata_log_error("Internal error, cannot insert the AVL tree.");
#ifdef NETDATA_INTERNAL_CHECKS
char iptext[INET6_ADDRSTRLEN];
@@ -3165,7 +3165,7 @@ static inline in_addr_t ipv4_network(in_addr_t addr, int prefix)
static inline int ip2nl(uint8_t *dst, char *ip, int domain, char *source)
{
if (inet_pton(domain, ip, dst) <= 0) {
- error("The address specified (%s) is invalid ", source);
+ netdata_log_error("The address specified (%s) is invalid ", source);
return -1;
}
@@ -3639,7 +3639,7 @@ static void read_max_dimension(struct config *cfg)
EBPF_MAXIMUM_DIMENSIONS,
NETDATA_NV_CAP_VALUE);
if (maxdim < 0) {
- error("'maximum dimensions = %d' must be a positive number, Netdata will change for default value %ld.",
+ netdata_log_error("'maximum dimensions = %d' must be a positive number, Netdata will change for default value %ld.",
maxdim, NETDATA_NV_CAP_VALUE);
maxdim = NETDATA_NV_CAP_VALUE;
}
@@ -3827,7 +3827,7 @@ static void link_dimension_name(char *port, uint32_t hash, char *value)
{
int test = str2i(port);
if (test < NETDATA_MINIMUM_PORT_VALUE || test > NETDATA_MAXIMUM_PORT_VALUE){
- error("The dimension given (%s = %s) has an invalid value and it will be ignored.", port, value);
+ netdata_log_error("The dimension given (%s = %s) has an invalid value and it will be ignored.", port, value);
return;
}
@@ -3950,7 +3950,7 @@ static int ebpf_socket_load_bpf(ebpf_module_t *em)
#endif
if (ret) {
- error("%s %s", EBPF_DEFAULT_ERROR_MSG, em->thread_name);
+ netdata_log_error("%s %s", EBPF_DEFAULT_ERROR_MSG, em->thread_name);
}
return ret;
@@ -3975,7 +3975,7 @@ void *ebpf_socket_thread(void *ptr)
parse_table_size_options(&socket_config);
if (pthread_mutex_init(&nv_mutex, NULL)) {
- error("Cannot initialize local mutex");
+ netdata_log_error("Cannot initialize local mutex");
goto endsocket;
}
diff --git a/collectors/ebpf.plugin/ebpf_swap.c b/collectors/ebpf.plugin/ebpf_swap.c
index 492b596782..e92a63d345 100644
--- a/collectors/ebpf.plugin/ebpf_swap.c
+++ b/collectors/ebpf.plugin/ebpf_swap.c
@@ -818,7 +818,7 @@ static int ebpf_swap_load_bpf(ebpf_module_t *em)
#endif
if (ret)
- error("%s %s", EBPF_DEFAULT_ERROR_MSG, em->thread_name);
+ netdata_log_error("%s %s", EBPF_DEFAULT_ERROR_MSG, em->thread_name);
return ret;
}