]> granicus.if.org Git - sysstat/commitdiff
sadf: SVG: Adjust canvas height
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 20 May 2018 15:21:13 +0000 (17:21 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 20 May 2018 15:21:13 +0000 (17:21 +0200)
Canvas height used for SVG output (sadf -g) should be adjusted if a list
of devices has been entered on the command line.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
sadf.c

diff --git a/sadf.c b/sadf.c
index 4c8ff363ec122bdffea6767ced877e96798874c1..fdba3a79c57658d011aaa272c38721e3bd749a1b 100644 (file)
--- a/sadf.c
+++ b/sadf.c
@@ -516,6 +516,19 @@ int get_svg_graph_nr(int ifd, char *file, struct file_magic *file_magic,
                if (!IS_SELECTED(act[p]->options))
                        continue;
 
+               if (((act[p]->id == A_NET_DEV) || (act[p]->id == A_NET_EDEV)) &&
+                   (dlst_iface_idx > 0) && (dlst_iface_idx < id_nr_max[p])) {
+                       id_nr_max[p] = dlst_iface_idx;
+               }
+               if ((act[p]->id == A_DISK) &&
+                   (dlst_dev_idx > 0) && (dlst_dev_idx < id_nr_max[p])) {
+                       id_nr_max[p] = dlst_dev_idx;
+               }
+               if ((act[p]->id == A_FS) &&
+                   (dlst_fs_idx > 0) && (dlst_fs_idx < id_nr_max[p])) {
+                       id_nr_max[p] = dlst_fs_idx;
+               }
+
                if (PACK_VIEWS(flags)) {
                        /* One activity = one row with multiple views */
                        n = 1;