Is it just me? I have the xhprof_disable_admin_paths variable's checkbox checked, and yet XHProf still generates a profile log file and still shows "XHProf output" at the bottom of every screen, admin included. I have hardcoded a return FALSE in xhprof_is_enabled(), and that does silence the thing.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

texas-bronius created an issue. See original summary.

Elijah Lynn’s picture

Same here. Doing a quick debug it looks like it may be honoring it on the first request. But then admin_menu does an XHR and it get's generated for that request. This is because it checks arg(0) == 'admin...

if (arg(0) == 'admin' && variable_get('xhprof_disable_admin_paths', TRUE)) {
  $enabled = FALSE;
}

This maybe needs to be updated to have a checkbox to also ignore admin menu requests too?

texas-bronius’s picture

I see what you're saying and can corroborate your theory: When I disabled the admin_menu module, the superfluous XHProf link at the bottom of the generated page no longer shows on /admin pages.

thePanz’s picture

Title: XHProf doesn't seem to be ignoring administrative paths as preference is set in admin settings » XHProf doesn't seem to be ignoring administrative paths if admin_menu is enabled
Status: Active » Needs review
FileSize
1.46 KB

Patch attached, new setting (enabled by default) to avoid profiling admin_menu XHR calls.

Elijah Lynn’s picture

Quick review and it looks good @thePanz! Didn't test yet so I won't RTBC yet but just wanted to leave that feedback.

jstoller’s picture

Status: Needs review » Reviewed & tested by the community

Works great! Thanks!

osopolar’s picture

Works for me too. Thanks thePanz.

andypost’s picture

FileSize
421 bytes

On commit I've added uninstall of variable after #2892127: Configuration not deleted on uninstall

  • andypost committed 856456d on 7.x-1.x authored by thePanz
    Issue #2631144 by thePanz, andypost: XHProf doesn't seem to be ignoring...
andypost’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.