Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: agent - eBPF Random time to process symbol table creation #8283

Merged
merged 1 commit into from
Oct 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions agent/src/ebpf/user/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ static inline bool is_existed_in_exit_cache(struct symbolizer_cache_kvp *kv)
vec_foreach(kv_tmp, pids_cache.exit_pids_cache) {
if ((int)kv_tmp->k.pid == kv->k.pid) {
struct symbolizer_proc_info *list_p =
(struct symbolizer_proc_info *)kv_tmp->v.
proc_info_p;
(struct symbolizer_proc_info *)kv_tmp->
v.proc_info_p;
struct symbolizer_proc_info *curr_p =
(struct symbolizer_proc_info *)kv->v.proc_info_p;
ebpf_warning
Expand Down Expand Up @@ -249,8 +249,8 @@ static inline bool is_existed_in_exec_cache(struct symbolizer_cache_kvp *kv)
vec_foreach(kv_tmp, pids_cache.exec_pids_cache) {
if ((int)kv_tmp->k.pid == kv->k.pid) {
struct symbolizer_proc_info *list_p =
(struct symbolizer_proc_info *)kv_tmp->v.
proc_info_p;
(struct symbolizer_proc_info *)kv_tmp->
v.proc_info_p;
struct symbolizer_proc_info *curr_p =
(struct symbolizer_proc_info *)kv->v.proc_info_p;
if (curr_p != 0 && list_p != 0) {
Expand Down Expand Up @@ -770,19 +770,20 @@ void *get_symbol_cache(pid_t pid, bool new_cache)
p->update_syms_table_time =
curr_time +
get_java_syms_fetch_delay();
} else {
p->update_syms_table_time = curr_time;
}

/*
* When the deepflow-agent is started, to avoid the sudden
* generation of Java symbol tables, additional random value
* for each java process's delay.
* The same applies to non-Java processes, which also perform
* random symbol table loading within one minute.
*/
if (p->syms_cache == 0
&& !p->gen_java_syms_file_err) {
p->update_syms_table_time =
generate_random_integer
(PROFILER_DEFER_RANDOM_MAX);
}
p->update_syms_table_time +=
generate_random_integer
(PROFILER_DEFER_RANDOM_MAX);
}

if (p->update_syms_table_time > 0
Expand Down
Loading