1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH PHP-APD 1 "January 31, 2003"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
php4-apd \- PHP code execution profiler and debugger
.SH DESCRIPTION
This manual page documents briefly the
.B php4-apd
package and
.B pprofp
command.
This manual page was written for the Debian distribution
because the original program does not have a manual page.
.PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively.
\fBphp4-apd\fP (the Advanced PHP Debugger) is a full-featured PHP
profiler/debugger that is loaded as a zend_extension. It aims to be an
analog of C's gprof or Perl's Devel::DProf, and provides PHP developers
with a number of additional functions which can be used to obtain
internal code execution details such as timing information, function
call tree and stack backtrace. This is particularly useful for
performance profiling purposes.
.PP
Once installed, APD provides a number of additional functions which you
can place in your PHP code for either profiling or debugging. The
debugging functions are:
.TP
.B array apd_callstack()
Returns the current call stack as an array (very cool).
.TP
.B apd_cluck([string warning[,string line delimiter])
Behaves like perl's Carp::cluck. Throw a warning and a callstack.
The default line delimiter is "<BR />\\n". Deprecated for users of
PHP4.3+: use the internal debug_backtrace() and debug_print_backtrace()
instead.
.TP
.B apd_croak([string error[, string line delimiter]])
Behaves like perl's Carp::croak. Throw an error, a callstack and then
exit. The default line delimiter is "<BR />\n". Deprecated for users of
PHP4.3+: use the internal debug_backtrace() and debug_print_backtrace()
instead.
.TP
.B array apd_dump_regular_resources()
Return all current regular resources as an array.
.TP
.B array apd_dump_persistent_resources()
Return all persistent resources as an array.
.TP
.B override_function(string func_name, string func_args, string func_code)
Syntax similar to create_function(). Overrides built-in functions
(replaces them in the symbol table).
.TP
.B rename_function(string orig_name, string new_name)
Renames orig_name to new_name in the global function_table. Useful
for temporarily overriding built-in functions.
.PP
The profiling functions can be placed at the start of your PHP code to
force APD to dump profiling information out to text files in the
directory defined in apd.dumpdir. These functions are:
.TP
.B apd_set_pprof_trace()
Dumps a tracefile named "pprof.<pid>" in your apd.dumpdir, which by
default is set to /var/log/php4-apd/ on Debian systems. The tracefile
is a machine parsable output file that can then be processed with the
.B pprofp <tracefile>
command. Do a 'pprofp -h' for detailed help, there are lots of options for
sorting and formatting the output. Loads of fun here if your PHP is not
running as fast as you'd like!
.TP
.B apd_set_session_trace(N)
Dumps a human-readable session trace named "apd_dump_<pid>" in your
apd.dumpdir. This is the old way of doing things, noted here just because it
still works (for now). It's been deprecated, so YMMV. Better to use a pprof
trace instead if you can. 'N' is an integer that sets what items will be
traced: just use a value of 99 for now, that'll turn on all implemented options.
.PP
More information can be found at http://pear.php.net/apd
.SH OPTIONS
At present options are configured in php.ini by setting variables that
are passed to APD at startup. This may change in future.
.TP
.B apd.dumpdir
The directory used to store output files. Set to /var/log/php4-apd/ by
default on Debian systems.
.br
.SH AUTHOR
This manual page was written by Jonathan Oxer <jon@debian.org>,
for the Debian GNU/Linux system (but may be used by others).
|