Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/177607

Change subject: Fixed scopedProfileIn with xhprof by using the profile blacklist
......................................................................

Fixed scopedProfileIn with xhprof by using the profile blacklist

Change-Id: Idb3ee1f41e705cdae683f3a8f688a3d16b5451aa
---
M includes/profiler/ProfilerXhprof.php
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/07/177607/1

diff --git a/includes/profiler/ProfilerXhprof.php 
b/includes/profiler/ProfilerXhprof.php
index 808c5cd..c17ccb0 100644
--- a/includes/profiler/ProfilerXhprof.php
+++ b/includes/profiler/ProfilerXhprof.php
@@ -89,6 +89,15 @@
                        ),
                        $params
                );
+
+               // The xhprof frame method closes the last entry when a 
profiled method exits.
+               // When scopedProfileIn() exits, we *dont* want the custom 
frame to close, so
+               // don't profile that method. Also blacklist the *Out() method 
for consistency.
+               $exclude = array( __CLASS__ . '::scopedProfileIn', 
'Profiler::scopedProfileOut' );
+               $params['exclude'] = isset( $params['exclude'] )
+                       ? array_merge( $params['exclude'], $exclude )
+                       : $exclude;
+
                parent::__construct( $params );
                $this->logType = $params['log'];
                $this->visible = $params['visible'];

-- 
To view, visit https://gerrit.wikimedia.org/r/177607
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb3ee1f41e705cdae683f3a8f688a3d16b5451aa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to