File tree Expand file tree Collapse file tree 4 files changed +47
-7
lines changed Expand file tree Collapse file tree 4 files changed +47
-7
lines changed Original file line number Diff line number Diff line change 34
34
<li>click a function name to collapse all calls to the same function</li>
35
35
<li>click the parameter list to expand it</li>
36
36
<li>click the return list to expand it</li>
37
- <li>use the checkbox to hide all PHP internal functions</li>
37
+ <li>click the time to mark the line important</li>
38
+ <li>use checkboxes to hide all PHP internal functions or limit to important lines</li>
38
39
</ul>
39
40
40
41
<form class="options">
41
- <input type="checkbox" value="1" checked="checked" id="internal"><label for="internal">Show internal
42
- functions</label>
42
+ <input type="checkbox" value="1" checked="checked" id="internal">
43
+ <label for="internal">Show internal functions</label>
44
+
45
+ <input type="checkbox" value="1" id="marked">
46
+ <label for="marked">Show important only (slow)</label>
43
47
</form>
44
48
45
49
Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ function getTraceHTML()
92
92
echo '<div class="f header"> ' ;
93
93
echo '<div class="func">Function Call</div> ' ;
94
94
echo '<div class="data"> ' ;
95
+ echo '<span class="file">File:Line</span> ' ;
95
96
echo '<span class="timediff">ΔTime</span> ' ;
96
97
echo '<span class="memorydiff">ΔMemory</span> ' ;
97
98
echo '<span class="time">Time</span> ' ;
@@ -128,6 +129,7 @@ function getTraceHTML()
128
129
echo '</div> ' ;
129
130
130
131
echo '<div class="data"> ' ;
132
+ echo '<span class="file" title=" ' .htmlspecialchars ($ func ['file ' ].': ' .$ func ['line ' ]).'"> ' .htmlspecialchars (basename ($ func ['file ' ]).': ' .$ func ['line ' ]).'</span> ' ;
131
133
echo '<span class="timediff"> ' . sprintf ('%f ' , $ func ['time.diff ' ]) . '</span> ' ;
132
134
echo '<span class="memorydiff"> ' . sprintf ('%d ' , $ func ['memory.diff ' ]) . '</span> ' ;
133
135
echo '<span class="time"> ' . sprintf ('%f ' , $ func ['time.enter ' ]) . '</span> ' ;
Original file line number Diff line number Diff line change 1
1
$ ( function ( ) {
2
2
3
-
3
+ /* hide blocks */
4
4
$ ( 'div.d, div.f' ) . click ( function ( e ) {
5
5
if ( e . target !== this ) return ;
6
6
$ ( this ) . toggleClass ( 'hide' ) ;
7
7
e . preventDefault ( ) ;
8
8
e . stopPropagation ( ) ;
9
9
} ) ;
10
10
11
+ /* collapse parameters */
11
12
$ ( 'span.params, span.return' ) . click ( function ( e ) {
12
13
if ( e . target !== this ) return ;
13
14
$ ( this ) . toggleClass ( 'short' ) ;
14
15
e . preventDefault ( ) ;
15
16
e . stopPropagation ( ) ;
16
17
} ) ;
17
18
19
+ /* hide internal funcs */
18
20
$ ( '#internal' ) . change ( function ( ) {
19
21
$ ( 'div.i' ) . toggle ( ) ;
20
22
} ) ;
21
23
24
+ /* hide functions */
22
25
$ ( 'span.name' ) . click ( function ( e ) {
23
26
if ( e . target !== this ) return ;
24
27
@@ -29,4 +32,20 @@ $(function(){
29
32
e . preventDefault ( ) ;
30
33
e . stopPropagation ( ) ;
31
34
} ) ;
35
+
36
+ /* mark important */
37
+ $ ( 'span.time' ) . click ( function ( e ) {
38
+ if ( e . target !== this ) return ;
39
+
40
+ $ ( this ) . closest ( 'div.f' ) . toggleClass ( 'mark' ) ;
41
+
42
+ e . preventDefault ( ) ;
43
+ e . stopPropagation ( ) ;
44
+ } ) ;
45
+
46
+ /* hide internal funcs */
47
+ $ ( '#marked' ) . change ( function ( ) {
48
+ $ ( 'div.f' ) . toggle ( ) ;
49
+ $ ( 'div.f.mark' ) . show ( ) ;
50
+ } ) ;
32
51
} ) ;
Original file line number Diff line number Diff line change
1
+ label {
2
+ cursor : pointer;
3
+ }
4
+
1
5
div .d {
2
6
padding-left : 2em ;
3
7
border-left : 1px solid # ccc ;
@@ -32,6 +36,10 @@ div.f.hide * {
32
36
display : none;
33
37
}
34
38
39
+ div .f .mark {
40
+ background-color : # ffeced ;
41
+ }
42
+
35
43
div .f div {
36
44
padding : 5px 0 ;
37
45
@@ -43,9 +51,9 @@ div.f div.func {
43
51
44
52
div .f div .data {
45
53
flex-grow : 0 ;
46
- width : 450 px ;
47
- min-width : 450 px ;
48
- max-width : 450 px ;
54
+ width : 600 px ;
55
+ min-width : 600 px ;
56
+ max-width : 600 px ;
49
57
}
50
58
51
59
span {
57
65
span .short {
58
66
max-height : 1.1em ;
59
67
overflow : hidden;
68
+ word-break : break-all;
60
69
}
61
70
62
71
span .name {
@@ -74,14 +83,20 @@ span.return {
74
83
cursor : pointer;
75
84
}
76
85
86
+ span .file ,
77
87
span .time ,
78
88
span .memorydiff ,
79
89
span .timediff {
90
+ overflow : hidden;
80
91
width : 150px ;
81
92
text-align : right;
82
93
white-space : nowrap;
83
94
}
84
95
96
+ span .time {
97
+ cursor : pointer;
98
+ }
99
+
85
100
div .header {
86
101
width : 100% ;
87
102
font-weight : bold;
You can’t perform that action at this time.
0 commit comments