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

Add support for collapsing PHP Xdebug traces #253

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9073857
Rewrite stackcollapse-xdebug.php into Rust
daniellockyer Feb 7, 2019
30b6536
Prepare for multicore collapsing
daniellockyer Sep 2, 2019
174510a
Merge branch 'master' into collapse-xdebug
Jun 20, 2022
d44c761
Fix typo and three suggestions from Clippy.
Jun 20, 2022
b6b17c0
Remove irrelevant after_help information.
Jun 20, 2022
9ff782a
Clarify purpose of scale factor constant.
Jun 20, 2022
1a31666
Remove unneeded CALLS slice.
Jun 20, 2022
bb06c97
Derive Default on xdebug Folder to fix benches.
Jun 20, 2022
8bd8dc6
Reimplement for Xdebug version 3
Jun 21, 2022
8130fc9
Reduce the number of string allocations in stack gathering.
Jun 21, 2022
f578ce4
Fix correctness of stack reconstruction with multiple paths to the sa…
Jun 21, 2022
5c127cc
Tidy up and clarify some comments.
Jun 21, 2022
ce8ad4e
Tidy up parsing of stats line.
Jun 21, 2022
51cfd55
Handle multiple separate function calls correctly.
Jun 21, 2022
7c59715
Implement parsing and validating header.
Jun 21, 2022
422b2fb
Always produce occurrence, not only for leaf nodes.
Jun 21, 2022
46fdf38
Use time spent in ms as "number" of occurrences.
Jun 21, 2022
f065826
Fix tests producing temporary files that are never cleaned up.
Jun 21, 2022
4c61db6
Remove no longer used hashbrown dependency.
Jun 21, 2022
7d53ade
Remove unneeded explicit return statement.
Jun 21, 2022
c7aaf89
Fix calls registering as WithoutPath if the path was previously recor…
Jun 22, 2022
bab7d3e
Add some xdebug tests, and fix path for xdebug bench.
Jun 22, 2022
45bde9f
Add sample file for xdebug benchmark.
Jun 22, 2022
edf08a2
Fix xdebug format guessing.
Jun 22, 2022
0be09fd
Fix formatting error from merge commit.
Jun 23, 2022
0dccda7
Fix build on minimal versions of dependencies.
Jun 23, 2022
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
Prev Previous commit
Next Next commit
Always produce occurrence, not only for leaf nodes.
Maarten Staa committed Jun 22, 2022
commit 422b2fb2a4d56330effe6e6fceaeec3bf18f2549
14 changes: 4 additions & 10 deletions src/collapse/xdebug.rs
Original file line number Diff line number Diff line change
@@ -382,11 +382,6 @@ impl Function {
}
}

/// Does this function call no other functions?
fn is_tail(&self) -> bool {
self.calls.is_empty()
}

/// Push a `call` line that is called by this function.
pub fn call(&mut self, function: Function) {
self.calls.push(function);
@@ -418,11 +413,10 @@ impl Function {
}
key.push_str(&self.function.as_str(folder));

if self.is_tail() {
occurrences.insert_or_add(key.clone(), 1);
key.truncate(old_prefix_len);
return;
}
occurrences.insert_or_add(
key.clone(),
(time_ns + self.self_time_ns) / SCALE_FACTOR as usize,
);

for call in &self.calls {
let func_id = call.function.get_function_id();