mirror of
https://github.com/moodle/moodle.git
synced 2025-08-03 08:09:47 +02:00
MDL-60313 libraries: xhprof upgraded to 0.9.4
This commit is contained in:
parent
23ab0d7788
commit
ffb41a8f8f
11 changed files with 17 additions and 18 deletions
|
@ -193,7 +193,7 @@
|
||||||
<location>xhprof</location>
|
<location>xhprof</location>
|
||||||
<name>XHProf</name>
|
<name>XHProf</name>
|
||||||
<license>Apache</license>
|
<license>Apache</license>
|
||||||
<version>0.9.2</version>
|
<version>0.9.4</version>
|
||||||
<licenseversion>2.0</licenseversion>
|
<licenseversion>2.0</licenseversion>
|
||||||
</library>
|
</library>
|
||||||
<library>
|
<library>
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
Originally developed at Facebook, XHProf was open sourced in Mar, 2009.
|
Originally developed at Facebook, XHProf was open sourced in Mar, 2009.
|
||||||
|
|
||||||
|
XHProf is now maintained by Phacility.
|
||||||
|
|
||||||
Creators:
|
Creators:
|
||||||
Changhao Jiang
|
Changhao Jiang
|
||||||
Kannan Muthukkaruppan
|
Kannan Muthukkaruppan
|
||||||
|
@ -9,4 +11,3 @@ Creators:
|
||||||
Additional Contributors:
|
Additional Contributors:
|
||||||
George Cabrera - UI enhancements
|
George Cabrera - UI enhancements
|
||||||
Paul Saab - FreeBSD port
|
Paul Saab - FreeBSD port
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
Apache License
|
Apache License
|
||||||
Version 2.0, January 2004
|
Version 2.0, January 2004
|
||||||
http://www.apache.org/licenses/
|
http://www.apache.org/licenses/
|
||||||
|
|
|
@ -3,5 +3,3 @@ For installation and usage notes refer to:
|
||||||
|
|
||||||
To view the latest version of the doc, go to:
|
To view the latest version of the doc, go to:
|
||||||
http://pecl.php.net/package/xhprof ---> [View Documentation]
|
http://pecl.php.net/package/xhprof ---> [View Documentation]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Description of XHProf 0.9.2 library/viewer import into Moodle
|
Description of XHProf 0.9.4 library/viewer import into Moodle
|
||||||
|
|
||||||
Removed (commit #1):
|
Removed (commit #1):
|
||||||
* .arcconfig - Definitions for arcanist/phabricator removed completely
|
* .arcconfig - Definitions for arcanist/phabricator removed completely
|
||||||
|
@ -37,3 +37,4 @@ TODO:
|
||||||
20110318 - MDL-26891 - Eloy Lafuente (stronk7): Implemented earlier profiling runs
|
20110318 - MDL-26891 - Eloy Lafuente (stronk7): Implemented earlier profiling runs
|
||||||
20130621 - MDL-39733 - Eloy Lafuente (stronk7): Export & import of profiling runs
|
20130621 - MDL-39733 - Eloy Lafuente (stronk7): Export & import of profiling runs
|
||||||
20160721 - MDL-55292 - Russell Smith (mr-russ): Add support for tideways profiler collection for PHP7
|
20160721 - MDL-55292 - Russell Smith (mr-russ): Add support for tideways profiler collection for PHP7
|
||||||
|
20171002 - MDL-60313 - Marina Glancy (marinaglancy): Upgrade to 0.9.4 release
|
|
@ -85,4 +85,3 @@ ul.xhprof_actions li a:hover {
|
||||||
background:#3B5998 none repeat scroll 0 0;
|
background:#3B5998 none repeat scroll 0 0;
|
||||||
color:#FFFFFF;
|
color:#FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,4 +77,3 @@ if (in_array($q, $functions)) {
|
||||||
foreach ($functions as $f) {
|
foreach ($functions as $f) {
|
||||||
echo $f."\n";
|
echo $f."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ require_once $GLOBALS['XHPROF_LIB_ROOT'].'/utils/xhprof_runs.php';
|
||||||
* Our coding convention disallows relative paths in hrefs.
|
* Our coding convention disallows relative paths in hrefs.
|
||||||
* Get the base URL path from the SCRIPT_NAME.
|
* Get the base URL path from the SCRIPT_NAME.
|
||||||
*/
|
*/
|
||||||
$base_path = rtrim(dirname($_SERVER['SCRIPT_NAME']), "/");
|
$base_path = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -58,7 +58,7 @@ $base_path = rtrim(dirname($_SERVER['SCRIPT_NAME']), "/");
|
||||||
function xhprof_include_js_css($ui_dir_url_path = null) {
|
function xhprof_include_js_css($ui_dir_url_path = null) {
|
||||||
|
|
||||||
if (empty($ui_dir_url_path)) {
|
if (empty($ui_dir_url_path)) {
|
||||||
$ui_dir_url_path = rtrim(dirname($_SERVER['SCRIPT_NAME']), "/");
|
$ui_dir_url_path = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\');
|
||||||
}
|
}
|
||||||
|
|
||||||
// style sheets
|
// style sheets
|
||||||
|
@ -621,7 +621,7 @@ function print_td_num($num, $fmt_func, $bold=false, $attributes=null) {
|
||||||
|
|
||||||
$class = get_print_class($num, $bold);
|
$class = get_print_class($num, $bold);
|
||||||
|
|
||||||
if (!empty($fmt_func)) {
|
if (!empty($fmt_func) && is_numeric($num) ) {
|
||||||
$num = call_user_func($fmt_func, $num);
|
$num = call_user_func($fmt_func, $num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1003,7 +1003,7 @@ function print_pc_array($url_params, $results, $base_ct, $base_info, $parent,
|
||||||
|
|
||||||
function print_source_link($info) {
|
function print_source_link($info) {
|
||||||
if (strncmp($info['fn'], 'run_init', 8) && $info['fn'] !== 'main()') {
|
if (strncmp($info['fn'], 'run_init', 8) && $info['fn'] !== 'main()') {
|
||||||
if (defined('XHPROF_SYMBOL_LOOKUP_URL')) {
|
if (defined('XHPROF_SYMBOL_LOOKUP_URL')) {
|
||||||
$link = xhprof_render_link(
|
$link = xhprof_render_link(
|
||||||
'source',
|
'source',
|
||||||
XHPROF_SYMBOL_LOOKUP_URL . '?symbol='.rawurlencode($info["fn"]));
|
XHPROF_SYMBOL_LOOKUP_URL . '?symbol='.rawurlencode($info["fn"]));
|
||||||
|
|
|
@ -113,7 +113,7 @@ function xhprof_generate_image_by_dot($dot_script, $type) {
|
||||||
$cmd = (!empty($CFG->pathtodot) ? $CFG->pathtodot : 'dot') . ' -T' . $type;
|
$cmd = (!empty($CFG->pathtodot) ? $CFG->pathtodot : 'dot') . ' -T' . $type;
|
||||||
// End moodle modification.
|
// End moodle modification.
|
||||||
|
|
||||||
$process = proc_open($cmd, $descriptorspec, $pipes, "/tmp", array());
|
$process = proc_open( $cmd, $descriptorspec, $pipes, sys_get_temp_dir(), array( 'PATH' => getenv( 'PATH' ) ) );
|
||||||
if (is_resource($process)) {
|
if (is_resource($process)) {
|
||||||
fwrite($pipes[0], $dot_script);
|
fwrite($pipes[0], $dot_script);
|
||||||
fclose($pipes[0]);
|
fclose($pipes[0]);
|
||||||
|
@ -382,7 +382,7 @@ function xhprof_generate_dot_script($raw_data, $threshold, $source, $page,
|
||||||
|
|
||||||
$result .= "N" . $sym_table[$parent]["id"] . " -> N"
|
$result .= "N" . $sym_table[$parent]["id"] . " -> N"
|
||||||
. $sym_table[$child]["id"];
|
. $sym_table[$child]["id"];
|
||||||
$result .= "[arrowsize=$arrow_size, style=\"setlinewidth($linewidth)\","
|
$result .= "[arrowsize=$arrow_size, color=grey, style=\"setlinewidth($linewidth)\","
|
||||||
." label=\""
|
." label=\""
|
||||||
.$label."\", headlabel=\"".$headlabel
|
.$label."\", headlabel=\"".$headlabel
|
||||||
."\", taillabel=\"".$taillabel."\" ]";
|
."\", taillabel=\"".$taillabel."\" ]";
|
||||||
|
|
|
@ -98,7 +98,7 @@ function init_metrics($xhprof_data, $rep_symbol, $sort, $diff_report = false) {
|
||||||
|
|
||||||
$pc_stats = $stats;
|
$pc_stats = $stats;
|
||||||
|
|
||||||
$possible_metrics = xhprof_get_possible_metrics($xhprof_data);
|
$possible_metrics = xhprof_get_possible_metrics();
|
||||||
foreach ($possible_metrics as $metric => $desc) {
|
foreach ($possible_metrics as $metric => $desc) {
|
||||||
if (isset($xhprof_data["main()"][$metric])) {
|
if (isset($xhprof_data["main()"][$metric])) {
|
||||||
$metrics[] = $metric;
|
$metrics[] = $metric;
|
||||||
|
@ -905,6 +905,10 @@ function xhprof_param_init($params) {
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($k === 'run') {
|
||||||
|
$p = implode(',', array_filter(explode(',', $p), 'ctype_xdigit'));
|
||||||
|
}
|
||||||
|
|
||||||
// create a global variable using the parameter name.
|
// create a global variable using the parameter name.
|
||||||
$GLOBALS[$k] = $p;
|
$GLOBALS[$k] = $p;
|
||||||
}
|
}
|
||||||
|
@ -939,4 +943,3 @@ function xhprof_get_matching_functions($q, $xhprof_data) {
|
||||||
|
|
||||||
return ($res);
|
return ($res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,8 +95,7 @@ class XHProfRuns_Default implements iXHProfRuns {
|
||||||
$dir = ini_get("xhprof.output_dir");
|
$dir = ini_get("xhprof.output_dir");
|
||||||
if (empty($dir)) {
|
if (empty($dir)) {
|
||||||
|
|
||||||
// some default that at least works on unix...
|
$dir = sys_get_temp_dir();
|
||||||
$dir = "/tmp";
|
|
||||||
|
|
||||||
xhprof_error("Warning: Must specify directory location for XHProf runs. ".
|
xhprof_error("Warning: Must specify directory location for XHProf runs. ".
|
||||||
"Trying {$dir} as default. You can either pass the " .
|
"Trying {$dir} as default. You can either pass the " .
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue