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

There may or may not be a readable ZEND_TRACE_OP_INFO() #2942

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

bwoebi
Copy link
Collaborator

@bwoebi bwoebi commented Nov 11, 2024

Maybe I don't understand the code well enough, but I don't think it should happen. We had crashes there though, so that should probably should mitigate them.

@bwoebi bwoebi requested a review from a team as a code owner November 11, 2024 16:14
@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.97%. Comparing base (7b487bd) to head (cbb2609).
Report is 19 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (7b487bd) and HEAD (cbb2609). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (7b487bd) HEAD (cbb2609)
tracer-php 12 11
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2942      +/-   ##
============================================
- Coverage     82.10%   73.97%   -8.13%     
  Complexity     2527     2527              
============================================
  Files           108      108              
  Lines         10360    10360              
============================================
- Hits           8506     7664     -842     
- Misses         1854     2696     +842     
Flag Coverage Δ
tracer-php 73.97% <ø> (-8.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b487bd...cbb2609. Read the comment docs.

@pr-commenter
Copy link

pr-commenter bot commented Nov 11, 2024

Benchmarks [ tracer ]

Benchmark execution time: 2024-11-13 16:22:13

Comparing candidate commit 0950a08 in PR branch bob/check-opcache-trace-readable with baseline commit 7b487bd in branch master.

Found 4 performance improvements and 2 performance regressions! Performance is the same for 172 metrics, 0 unstable metrics.

scenario:HookBench/benchWithoutHook

  • 🟥 execution_time [+3.418µs; +6.008µs] or [+4.220%; +7.416%]

scenario:LogsInjectionBench/benchLogsInfoInjection-opcache

  • 🟥 execution_time [+1.118µs; +1.465µs] or [+14.168%; +18.567%]

scenario:SamplingRuleMatchingBench/benchRegexMatching1

  • 🟩 execution_time [-619.287ns; -205.513ns] or [-8.347%; -2.770%]

scenario:SamplingRuleMatchingBench/benchRegexMatching3-opcache

  • 🟩 execution_time [-518.473ns; -157.527ns] or [-7.141%; -2.170%]

scenario:SamplingRuleMatchingBench/benchRegexMatching4-opcache

  • 🟩 execution_time [-532.842ns; -214.558ns] or [-7.334%; -2.953%]

scenario:TraceSerializationBench/benchSerializeTrace

  • 🟩 execution_time [-8.301µs; -4.399µs] or [-4.352%; -2.306%]

Maybe I don't understand the code well enough, but I don't think it should happen. We had crashes there though, so that should probably should mitigate them.

Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi force-pushed the bob/check-opcache-trace-readable branch from d785ced to 0950a08 Compare November 13, 2024 15:56
Comment on lines +214 to +217
if (write(dd_probe_pipes[1], ZEND_OP_TRACE_INFO(opline, offset), sizeof(zend_op_trace_info)) < 0) {
return;
}
read(dd_probe_pipes[0], dummy_buf, sizeof(zend_op_trace_info));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I came across the mincore function; could it be a simpler alternative?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish I could use it, but it requires glibc 2.19. Whereas we currently target 2.17.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something, something, drop CentOS 7... :D

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use syscall directly and reference the syscall numbers and parameters in this table.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cataphract I suppose that will work, but using write() has the advantage of not being linux specific either.

Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi merged commit 811d899 into master Nov 15, 2024
745 of 792 checks passed
@bwoebi bwoebi deleted the bob/check-opcache-trace-readable branch November 15, 2024 17:47
@github-actions github-actions bot added this to the 1.5.0 milestone Nov 15, 2024
@cataphract cataphract mentioned this pull request Nov 22, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants