Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[eBPF] Modify the storage method of Java perf files (#4536)
* [eBPF] Modify the storage method of Java perf files Previously, we stored Java perf map files in the '/tmp' directory of the target POD container, which caused a few issues: - The target POD's '/tmp' directory might have size limitations, and storing perf files there could exceed those limits, leading to abnormalities in the target POD. - Java perf map files would persist indefinitely, potentially being seen as invasive behavior. We have made the following changes: - We modified the storage location, moving the perf map files to the '/deepflow' directory of the target POD. - After generating Java perf map files, we immediately transfer the files to the '/tmp' directory of the 'deepflow-agent' POD. - No files are left behind in the target POD. Additionally, you can use the 'deepflow-jattach clean' command within the 'deepflow-agent' POD to remove the previously resident 'perf-PID.log' and 'perf-PID.map' files in the customer's POD. * [eBPF] Add comments for 'deepflow-ebpfctl cpdbg ...' * [eBPF] Add java symbols write space limit 'java_syms_space_limit' The maximum space occupied by the Java symbol files in the target POD. Its valid range is [2, 10], which means it falls within the interval of 2Mi to 10Mi. If the configuration value is outside this range, the default value of 10(10Mi), will be used. The size of the Java perf-PID.map file, excluding the additional space occupied by 'agent.so' and log files, represents the actual limit of space occupied in the target POD's root path ('/'). The actual writing limit is controlled by the global variable 'g_java_syms_write_bytes_max', and the size (in bytes) of the Java perf-PID.map file will not exceed it. * [eBPF] Make the Java agent configurable and run successfully on the host HotSpot JVM does not support agent unloading. However, you may "attach" the same library multiple times with different arguments. The library will not be loaded again, but Agent_OnAttach will still be called multiple times with different arguments. We have achieved flexibility and configurability for the Java agent. * [eBPF] Ensure that the socket tracer has completed before the profiler parses The profiler's processing depends on probe interfaces provided by the socket tracer, such as process exit events. We want to ensure that everything is ready before the profiler performs address translation. * [eBPF] Add a configurable option 'java_update_delay' @java_update_delay To allow Java to run for an extended period and gather more symbol information, we delay symbol retrieval when encountering unknown symbols. The recommended range for values is [60, 86400], default valuse is 300. * [eBPF] Adjust the quota for Java symbol space occupancy * [eBPF] Delete old perf map files in the customer's POD * [eBPF] Adjust Java symbols delay update time * [eBPF] Add configuration options for Java ebpf profiler
- Loading branch information