Skip to content

Commit

Permalink
feat(profiling): keep string cache data alive longer (#2668)
Browse files Browse the repository at this point in the history
We still have to re-establish the link in the run time cache, but the
string set itself will keep the sets and data alive.

---------

Co-authored-by: Florian Engelhardt <[email protected]>
  • Loading branch information
morrisonlevi and realFlowControl authored Jun 12, 2024
1 parent f0b3801 commit 9f4a6a5
Show file tree
Hide file tree
Showing 9 changed files with 459 additions and 333 deletions.
65 changes: 3 additions & 62 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
5 changes: 2 additions & 3 deletions profiling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ bench = false # disables cargo build in libtest bench
# Avoid ahash 0.8.7 we run into https://github.com/tkaitchuck/aHash/issues/195.
ahash = { version = "0.8.11" }
anyhow = { version = "1.0" }
# v3.15 bumps MSRV to Rust 1.73
bumpalo = { version = "=3.14.0", features = ["collections"] }
cfg-if = { version = "1.0" }
cpu-time = { version = "1.0" }
chrono = { version = "0.4" }
crossbeam-channel = { version = "0.5", default-features = false, features = ["std"] }
datadog-alloc = { git = "https://github.com/DataDog/libdatadog", tag = "v10.0.0" }
datadog-profiling = { git = "https://github.com/DataDog/libdatadog", tag = "v10.0.0" }
ddcommon = { git = "https://github.com/DataDog/libdatadog", tag = "v10.0.0" }
env_logger = { version = "0.11", default-features = false }
Expand All @@ -30,10 +29,10 @@ libc = "0.2"
# TRACE set to max to support runtime configuration.
log = { version = "0.4", features = ["max_level_trace", "release_max_level_trace"]}
once_cell = { version = "1.12" }
ouroboros = { version = "0.18" }
serde_json = {version = "1.0"}
rand = { version = "0.8.5" }
rand_distr = { version = "0.4.3" }
rustc-hash = "1.1.0"
uuid = { version = "1.0", features = ["v4"] }

[dev-dependencies]
Expand Down
6 changes: 3 additions & 3 deletions profiling/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ mod logging;
mod pcntl;
pub mod profiling;
mod sapi;
mod thin_str;
mod wall_time;

#[cfg(php_run_time_cache)]
mod string_table;
mod string_set;

#[cfg(feature = "allocation_profiling")]
mod allocation;
Expand All @@ -19,8 +21,6 @@ mod exception;
#[cfg(feature = "timeline")]
mod timeline;

mod wall_time;

use crate::config::{SystemSettings, INITIAL_SYSTEM_SETTINGS};
use bindings::{
self as zend, ddog_php_prof_php_version, ddog_php_prof_php_version_id, ZendExtension,
Expand Down
3 changes: 3 additions & 0 deletions profiling/src/profiling/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,9 @@ pub enum UploadMessage {
Upload(Box<UploadRequest>),
}

#[cfg(feature = "timeline")]
const COW_EVAL: Cow<str> = Cow::Borrowed("[eval]");

impl Profiler {
pub fn new(system_settings: &SystemSettings) -> Self {
let fork_barrier = Arc::new(Barrier::new(3));
Expand Down
Loading

0 comments on commit 9f4a6a5

Please sign in to comment.