Skip to content

Commit 12a270f

Browse files
akavelahkok
authored andcommitted
fix bars in process graph without -F (#11)
Filtered-out processes were still painted if they had no parent. This resulted in process graph being trimmed too much. Also, fix height of the whole graph canvas (the process graph was still sometimes trimmed too much at the bottom; the reason seems to be off-by-one error when counting CPU graphs).
1 parent 17a404c commit 12a270f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/svg.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static void svg_header(FILE *of, struct list_sample_data *head, double graph_sta
9090
/* height is variable based on pss, psize, ksize */
9191
h = 400.0 + (arg_scale_y * 30.0) /* base graphs and title */
9292
+ (arg_pss ? (100.0 * arg_scale_y) + (arg_scale_y * 7.0) : 0.0) /* pss estimate */
93-
+ psize + ksize + esize + (n_cpus * 15 * arg_scale_y);
93+
+ psize + ksize + esize + ((n_cpus+1) * 15 * arg_scale_y);
9494

9595
fprintf(of, "<?xml version=\"1.0\" standalone=\"no\"?>\n");
9696
fprintf(of, "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" ");
@@ -1056,6 +1056,8 @@ static void svg_ps_bars(FILE *of,
10561056
ps->parent->pos_x,
10571057
ps->parent->pos_y);
10581058
continue;
1059+
} else {
1060+
continue;
10591061
}
10601062

10611063
endtime = ps->last->sampledata->sampletime;

0 commit comments

Comments
 (0)