Manual talk:How to debug
- There is also the useful '$wgDebugComments' variable. [user:jldupont] 14:11, 1 July 2007 (UTC)
When I try to browse to /profileinfo.php, I get a blank page. Judging by the source of said file, even if profiling is disabled, there should still be something there. I don't even get any HTML let alone visible content. Any ideas? --Egingell (talk) 11:16, 9 August 2007 (UTC)
- See Manual:Errors and Symptoms#You see a Blank Page. Is that the problem? --Cneubauer 19:55, 29 May 2008 (UTC)
Stack Backtrace 
- You can use the wfDebug functions
wfDebugBacktrace. You basically put those in your code somewhere to get your backtrace. If you use the Die one, it will error out to the screen. The other writes to your debug log. See GlobalFunctions.php for more information. --Cneubauer 19:52, 29 May 2008 (UTC)
What are these table columns? 
Has anyone ever bothered to document these table columns somewhere?:
Calls Total Each % Mem (and three more without headings)
- Is Calls DB calls, function calls, something else?
- Total what?
- What is the content of the three unlabelled columns?
--Michael Daly 06:18, 13 April 2008 (UTC)
- Just taking a shot at this, but it looks like Calls is the number of times a code block that is surrounded by a wfProfileIn/wfProfileOut pair is encountered. This roughly translates to function calls but in some cases may be smaller pieces like loops within functions that someone chose to add profile info to.
- Total is the time that it took to run through that part of the code. Not sure what the units are. Maybe microseconds as the profiler uses microtime. Each is the amount of time spent in one visit to that code. So Calls * Each = Total. % is the percent of total code execution spent in that code block. Mem is the amount of memory used in the code block? I get negative numbers for some of that column though so...
- The two numbers in parens seem to be the min and max of something. Possibly the min and max execution time for all runs through that Call. The last number is the overhead of something. Maybe of running the profiler? It would be great if the developers took time to write up some documentation on things like this but they are unfortunately pretty universally of the school that coding is more important then documenting. --Cneubauer 19:48, 29 May 2008 (UTC)
Missing information 
- Shouldn't this article (rather than the talk page) include reference to
wfDebugBacktrace? I knew about the former but only discovered the latter from this talk page.
- And 09:10, 5 February 2009 (UTC) Hmmm - perhaps I'm not doing something quite right, but
wfDebugBacktrace()produced absolutely no output at all for me.
Not working for me at all 
I added the calls to localsettings but when I go to profileinfo.php I keep getting the message "query failed: Table 'cojoilustrado.wiki_profiling' doesn't exist"
By what I got from the instructions information can be logged in a file, but profileinfo keeps asking for a table in a database even though I disabled database logging. Here's what I added to localsettings:
$wgShowSQLErrors = true; $wgDebugDumpSql = true; $wgDebugLogFile = "$IP/stats/debug_log.txt"; $wgEnableProfileInfo = true; $wgDebugLogFile = "$IP/stats/log_info.txt"; /** Only record profiling info for pages that took longer than this */ $wgProfileLimit = 0.1; /** Don't put non-profiling info into log file */ $wgProfileOnly = false; /** Log sums from profiling into "profiling" table in db. */ $wgProfileToDatabase = false; /** If true, print a raw call tree instead of per-function report */ $wgProfileCallTree = false; /** Should application server host be put into profiling table */ $wgProfilePerHost = false; /** Detects non-matching wfProfileIn/wfProfileOut calls */ $wgDebugProfiling = false; /** Output debug message on every wfProfileIn/wfProfileOut */ $wgDebugFunctionEntry = 0;
Am I missing something? Thanks in advance for you help. --Mark 20:11, 2 December 2009 (UTC)
Our documentation here on how to setup StartProfiler looks out of date. I believe we use the autoloader now. Daniel Friesen (Dantman) 17:21, 29 November 2011 (UTC)
Debug Toolbar 
which was a nice feature. After an update to the most recent version of MediaWiki the debug messages that were generated using
wfDebugLog( "modulename","message" );
didn't show up any more. (I'm not sure if the problem is caused by the update, or if there is an other reason for that.) Is there a way to re-enable this nice feature? --Schubi87 (talk) 15:02, 17 October 2012 (UTC)