]> granicus.if.org Git - sysstat/commitdiff
sadf: PSI: Change metrics names and make them percent values
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 18 Apr 2020 06:23:33 +0000 (08:23 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 18 Apr 2020 06:23:33 +0000 (08:23 +0200)
Change PSI metrics names (e.g. s_acpu10 -> %scpu-10) to make clear that
they are percent values.
Also change metrics using the total number of microseconds spent stalled
on ressources to also be a percent value calculated over the past time
interval (e.g. s_tcpu/s -> %scpu).

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
activity.c
json_stats.c
pcp_def_metrics.c
pcp_stats.c
pr_stats.c
rndr_stats.c
svg_stats.c
xml_stats.c

index bbc554751ea0a6ac2f08096ccfc6b1a17b8e9eb3..8f41ce6a4a3ca6305eb87ea4e8a339fe79e657c5 100644 (file)
@@ -1889,7 +1889,7 @@ struct activity psi_cpu_act = {
        .f_print_avg    = print_avg_psicpu_stats,
 #endif
 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
-       .hdr_line       = "s_acpu10;s_acpu60;s_acpu300;s_tcpu/s",
+       .hdr_line       = "%scpu-10;%scpu-60;%scpu-300;%scpu",
 #endif
        .gtypes_nr      = {STATS_PSI_CPU_ULL, STATS_PSI_CPU_UL, STATS_PSI_CPU_U},
        .ftypes_nr      = {0, 0, 0},
@@ -1935,7 +1935,7 @@ struct activity psi_io_act = {
        .f_print_avg    = print_avg_psiio_stats,
 #endif
 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
-       .hdr_line       = "s_aio10;s_aio60;s_aio300;s_tio/s;f_aio10;f_aio60;f_aio300;f_tio/s",
+       .hdr_line       = "%sio-10;%sio-60;%sio-300;%sio;%fio-10;%fio-60;%fio-300;%fio",
 #endif
        .gtypes_nr      = {STATS_PSI_IO_ULL, STATS_PSI_IO_UL, STATS_PSI_IO_U},
        .ftypes_nr      = {0, 0, 0},
@@ -1981,7 +1981,7 @@ struct activity psi_mem_act = {
        .f_print_avg    = print_avg_psimem_stats,
 #endif
 #if defined(SOURCE_SAR) || defined(SOURCE_SADF)
-       .hdr_line       = "s_amem10;s_amem60;s_amem300;s_tmem/s;f_amem10;f_amem60;f_amem300;f_tmem/s",
+       .hdr_line       = "%smem-10;%smem-60;%smem-300;%smem;%fmem-10;%fmem-60;%fmem-300;%fmem",
 #endif
        .gtypes_nr      = {STATS_PSI_MEM_ULL, STATS_PSI_MEM_UL, STATS_PSI_MEM_U},
        .ftypes_nr      = {0, 0, 0},
index ce9c93f78a42e80179da953258fd5493ec132c34..82581ebf4b0c86cbeb99e644af7fb301d8bbd7ef 100644 (file)
@@ -2466,11 +2466,11 @@ __print_funct_t json_print_psicpu_stats(struct activity *a, int curr, int tab,
                 "\"some_avg10\": %.2f, "
                 "\"some_avg60\": %.2f, "
                 "\"some_avg300\": %.2f, "
-                "\"some_total\": %.2f}",
+                "\"some_avg\": %.2f}",
                 (double) psic->some_acpu_10  / 100,
                 (double) psic->some_acpu_60  / 100,
                 (double) psic->some_acpu_300 / 100,
-                S_VALUE(psip->some_cpu_total, psic->some_cpu_total, itv));
+                ((double) psic->some_cpu_total - psip->some_cpu_total) / (100 * itv));
        tab--;
 
 close_json_markup:
@@ -2507,19 +2507,19 @@ __print_funct_t json_print_psiio_stats(struct activity *a, int curr, int tab,
                 "\"some_avg10\": %.2f, "
                 "\"some_avg60\": %.2f, "
                 "\"some_avg300\": %.2f, "
-                "\"some_total\": %.2f, "
+                "\"some_avg\": %.2f, "
                 "\"full_avg10\": %.2f, "
                 "\"full_avg60\": %.2f, "
                 "\"full_avg300\": %.2f, "
-                "\"full_total\": %.2f}",
+                "\"full_avg\": %.2f}",
                 (double) psic->some_aio_10  / 100,
                 (double) psic->some_aio_60  / 100,
                 (double) psic->some_aio_300 / 100,
-                S_VALUE(psip->some_io_total, psic->some_io_total, itv),
+                ((double) psic->some_io_total - psip->some_io_total) / (100 * itv),
                 (double) psic->full_aio_10  / 100,
                 (double) psic->full_aio_60  / 100,
                 (double) psic->full_aio_300 / 100,
-                S_VALUE(psip->full_io_total, psic->full_io_total, itv));
+                ((double) psic->full_io_total - psip->full_io_total) / (100 * itv));
        tab--;
 
 close_json_markup:
@@ -2556,19 +2556,19 @@ __print_funct_t json_print_psimem_stats(struct activity *a, int curr, int tab,
                 "\"some_avg10\": %.2f, "
                 "\"some_avg60\": %.2f, "
                 "\"some_avg300\": %.2f, "
-                "\"some_total\": %.2f, "
+                "\"some_avg\": %.2f, "
                 "\"full_avg10\": %.2f, "
                 "\"full_avg60\": %.2f, "
                 "\"full_avg300\": %.2f, "
-                "\"full_total\": %.2f}",
+                "\"full_avg\": %.2f}",
                 (double) psic->some_amem_10  / 100,
                 (double) psic->some_amem_60  / 100,
                 (double) psic->some_amem_300 / 100,
-                S_VALUE(psip->some_mem_total, psic->some_mem_total, itv),
+                ((double) psic->some_mem_total - psip->some_mem_total) / (100 * itv),
                 (double) psic->full_amem_10  / 100,
                 (double) psic->full_amem_60  / 100,
                 (double) psic->full_amem_300 / 100,
-                S_VALUE(psip->full_mem_total, psic->full_mem_total, itv));
+                ((double) psic->full_mem_total - psip->full_mem_total) / (100 * itv));
        tab--;
 
 close_json_markup:
index b350aaa4f79a54b7e089fcd555ce8253f5b6e380..db5a705d2c1c8d66c26fe17e61f8aa324f76cf71 100644 (file)
@@ -1785,9 +1785,9 @@ void pcp_def_psi_metrics(struct activity *a)
                             PM_IN_NULL, PM_TYPE_FLOAT, indom, PM_SEM_INSTANT,
                             pmiUnits(0, 0, 0, 0, 0, 0));
 
-               pmiAddMetric("psi.cpu.some.total",
+               pmiAddMetric("psi.cpu.some.avg",
                             PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
-                            pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+                            pmiUnits(0, 0, 0, 0, 0, 0));
        }
        else if (a->id == A_PSI_IO) {
                /* Create metrics for A_PSI_IO */
@@ -1795,17 +1795,17 @@ void pcp_def_psi_metrics(struct activity *a)
                             PM_IN_NULL, PM_TYPE_FLOAT, indom, PM_SEM_INSTANT,
                             pmiUnits(0, 0, 0, 0, 0, 0));
 
-               pmiAddMetric("psi.io.some.total",
+               pmiAddMetric("psi.io.some.avg",
                             PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
-                            pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+                            pmiUnits(0, 0, 0, 0, 0, 0));
 
                pmiAddMetric("psi.io.full.trends",
                             PM_IN_NULL, PM_TYPE_FLOAT, indom, PM_SEM_INSTANT,
                             pmiUnits(0, 0, 0, 0, 0, 0));
 
-               pmiAddMetric("psi.io.full.total",
+               pmiAddMetric("psi.io.full.avg",
                             PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
-                            pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+                            pmiUnits(0, 0, 0, 0, 0, 0));
        }
        else {
                /* Create metrics for A_PSI_MEM */
@@ -1813,17 +1813,17 @@ void pcp_def_psi_metrics(struct activity *a)
                             PM_IN_NULL, PM_TYPE_FLOAT, indom, PM_SEM_INSTANT,
                             pmiUnits(0, 0, 0, 0, 0, 0));
 
-               pmiAddMetric("psi.mem.some.total",
+               pmiAddMetric("psi.mem.some.avg",
                             PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
-                            pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+                            pmiUnits(0, 0, 0, 0, 0, 0));
 
                pmiAddMetric("psi.mem.full.trends",
                             PM_IN_NULL, PM_TYPE_FLOAT, indom, PM_SEM_INSTANT,
                             pmiUnits(0, 0, 0, 0, 0, 0));
 
-               pmiAddMetric("psi.mem.full.total",
+               pmiAddMetric("psi.mem.full.avg",
                             PM_IN_NULL, PM_TYPE_FLOAT, PM_INDOM_NULL, PM_SEM_INSTANT,
-                            pmiUnits(0, -1, 1, 0, PM_TIME_SEC, PM_COUNT_ONE));
+                            pmiUnits(0, 0, 0, 0, 0, 0));
        }
 #endif /* HAVE_PCP */
 }
index b640d5e5e2c6b5d4f0677a391fd3bcd845795147..85e410123fd6c2e479550edfa9c105711a9bf5e1 100644 (file)
@@ -2273,8 +2273,8 @@ __print_funct_t pcp_print_psicpu_stats(struct activity *a, int curr, unsigned lo
        pmiPutValue("psi.cpu.some.trends", "300 sec", buf);
 
        snprintf(buf, sizeof(buf), "%f",
-                S_VALUE(psip->some_cpu_total, psic->some_cpu_total, itv));
-       pmiPutValue("psi.cpu.some.total", NULL, buf);
+                ((double) psic->some_cpu_total - psip->some_cpu_total) / (100 * itv));
+       pmiPutValue("psi.cpu.some.avg", NULL, buf);
 #endif /* HAVE_PCP */
 }
 
@@ -2308,8 +2308,8 @@ __print_funct_t pcp_print_psiio_stats(struct activity *a, int curr, unsigned lon
        pmiPutValue("psi.io.some.trends", "300 sec", buf);
 
        snprintf(buf, sizeof(buf), "%f",
-                S_VALUE(psip->some_io_total, psic->some_io_total, itv));
-       pmiPutValue("psi.io.some.total", NULL, buf);
+                ((double) psic->some_io_total - psip->some_io_total) / (100 * itv));
+       pmiPutValue("psi.io.some.avg", NULL, buf);
 
        snprintf(buf, sizeof(buf), "%f", (double) psic->full_aio_10 / 100);
        pmiPutValue("psi.io.full.trends", "10 sec", buf);
@@ -2321,8 +2321,8 @@ __print_funct_t pcp_print_psiio_stats(struct activity *a, int curr, unsigned lon
        pmiPutValue("psi.io.full.trends", "300 sec", buf);
 
        snprintf(buf, sizeof(buf), "%f",
-                S_VALUE(psip->full_io_total, psic->full_io_total, itv));
-       pmiPutValue("psi.io.full.total", NULL, buf);
+                ((double) psic->full_io_total - psip->full_io_total) / (100 * itv));
+       pmiPutValue("psi.io.full.avg", NULL, buf);
 #endif /* HAVE_PCP */
 }
 
@@ -2356,8 +2356,8 @@ __print_funct_t pcp_print_psimem_stats(struct activity *a, int curr, unsigned lo
        pmiPutValue("psi.mem.some.trends", "300 sec", buf);
 
        snprintf(buf, sizeof(buf), "%f",
-                S_VALUE(psip->some_mem_total, psic->some_mem_total, itv));
-       pmiPutValue("psi.mem.some.total", NULL, buf);
+                ((double) psic->some_mem_total - psip->some_mem_total) / (100 * itv));
+       pmiPutValue("psi.mem.some.avg", NULL, buf);
 
        snprintf(buf, sizeof(buf), "%f", (double) psic->full_amem_10 / 100);
        pmiPutValue("psi.mem.full.trends", "10 sec", buf);
@@ -2369,7 +2369,7 @@ __print_funct_t pcp_print_psimem_stats(struct activity *a, int curr, unsigned lo
        pmiPutValue("psi.mem.full.trends", "300 sec", buf);
 
        snprintf(buf, sizeof(buf), "%f",
-                S_VALUE(psip->full_mem_total, psic->full_mem_total, itv));
-       pmiPutValue("psi.mem.full.total", NULL, buf);
+                ((double) psic->full_mem_total - psip->full_mem_total) / (100 * itv));
+       pmiPutValue("psi.mem.full.avg", NULL, buf);
 #endif /* HAVE_PCP */
 }
index 8e366623b0596fdf33cb3404c59e40ec6a18ab7e..09aa04e284b1d0fa6695044228f5a39a7386214b 100644 (file)
@@ -3074,8 +3074,8 @@ void stub_print_psicpu_stats(struct activity *a, int prev, int curr, int dispavg
                s_avg10 = s_avg60 = s_avg300 = 0;
        }
 
-       cprintf_f(NO_UNIT, 1, 9, 2,
-                 S_VALUE(psip->some_cpu_total, psic->some_cpu_total, itv));
+       cprintf_pc(DISPLAY_UNIT(flags), 1, 9, 2,
+                 ((double) psic->some_cpu_total - psip->some_cpu_total) / (100 * itv));
        printf("\n");
 }
 
@@ -3169,8 +3169,8 @@ void stub_print_psiio_stats(struct activity *a, int prev, int curr, int dispavg,
                s_avg10 = s_avg60 = s_avg300 = 0;
        }
 
-       cprintf_f(NO_UNIT, 1, 9, 2,
-                 S_VALUE(psip->some_io_total, psic->some_io_total, itv));
+       cprintf_pc(DISPLAY_UNIT(flags), 1, 9, 2,
+                 ((double) psic->some_io_total - psip->some_io_total) / (100 * itv));
 
        if (!dispavg) {
                /* Display instantaneous "full" values */
@@ -3195,8 +3195,8 @@ void stub_print_psiio_stats(struct activity *a, int prev, int curr, int dispavg,
                f_avg10 = f_avg60 = f_avg300 = 0;
        }
 
-       cprintf_f(NO_UNIT, 1, 9, 2,
-                 S_VALUE(psip->full_io_total, psic->full_io_total, itv));
+       cprintf_pc(DISPLAY_UNIT(flags), 1, 9, 2,
+                 ((double) psic->full_io_total - psip->full_io_total) / (100 * itv));
        printf("\n");
 }
 
@@ -3290,8 +3290,8 @@ void stub_print_psimem_stats(struct activity *a, int prev, int curr, int dispavg
                s_avg10 = s_avg60 = s_avg300 = 0;
        }
 
-       cprintf_f(NO_UNIT, 1, 9, 2,
-                 S_VALUE(psip->some_mem_total, psic->some_mem_total, itv));
+       cprintf_pc(DISPLAY_UNIT(flags), 1, 9, 2,
+                 ((double) psic->some_mem_total - psip->some_mem_total) / (100 * itv));
 
        if (!dispavg) {
                /* Display instantaneous "full" values */
@@ -3316,8 +3316,8 @@ void stub_print_psimem_stats(struct activity *a, int prev, int curr, int dispavg
                f_avg10 = f_avg60 = f_avg300 = 0;
        }
 
-       cprintf_f(NO_UNIT, 1, 9, 2,
-                 S_VALUE(psip->full_mem_total, psic->full_mem_total, itv));
+       cprintf_pc(DISPLAY_UNIT(flags), 1, 9, 2,
+                 ((double) psic->full_mem_total - psip->full_mem_total) / (100 * itv));
        printf("\n");
 }
 
index 16389de9b8e63e6f4db91a61cae457bb010eb394..12c0a6e654423c7d7b869d2321c5caf27767582e 100644 (file)
@@ -3216,27 +3216,27 @@ __print_funct_t render_psicpu_stats(struct activity *a, int isdb, char *pre,
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
 
        render(isdb, pre, PT_NOFLAG,
-              "-\ts_acpu10", NULL, NULL,
+              "-\t%scpu-10", NULL, NULL,
               NOVAL,
               (double) psic->some_acpu_10 / 100,
               NULL);
 
        render(isdb, pre, PT_NOFLAG,
-              "-\ts_acpu60", NULL, NULL,
+              "-\t%scpu-60", NULL, NULL,
               NOVAL,
               (double) psic->some_acpu_60 / 100,
               NULL);
 
        render(isdb, pre, PT_NOFLAG,
-              "-\ts_acpu300", NULL, NULL,
+              "-\t%scpu-300", NULL, NULL,
               NOVAL,
               (double) psic->some_acpu_300 / 100,
               NULL);
 
        render(isdb, pre, pt_newlin,
-              "-\ts_tcpu/s", NULL, NULL,
+              "-\t%scpu", NULL, NULL,
               NOVAL,
-              S_VALUE(psip->some_cpu_total, psic->some_cpu_total, itv),
+              ((double) psic->some_cpu_total - psip->some_cpu_total) / (100 * itv),
               NULL);
 }
 
@@ -3262,51 +3262,51 @@ __print_funct_t render_psiio_stats(struct activity *a, int isdb, char *pre,
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
 
        render(isdb, pre, PT_NOFLAG,
-              "-\ts_aio10", NULL, NULL,
+              "-\t%sio-10", NULL, NULL,
               NOVAL,
               (double) psic->some_aio_10 / 100,
               NULL);
 
        render(isdb, pre, PT_NOFLAG,
-              "-\ts_aio60", NULL, NULL,
+              "-\t%sio-60", NULL, NULL,
               NOVAL,
               (double) psic->some_aio_60 / 100,
               NULL);
 
        render(isdb, pre, PT_NOFLAG,
-              "-\ts_aio300", NULL, NULL,
+              "-\t%sio-300", NULL, NULL,
               NOVAL,
               (double) psic->some_aio_300 / 100,
               NULL);
 
        render(isdb, pre, PT_NOFLAG,
-              "-\ts_tio/s", NULL, NULL,
+              "-\t%sio", NULL, NULL,
               NOVAL,
-              S_VALUE(psip->some_io_total, psic->some_io_total, itv),
+              ((double) psic->some_io_total - psip->some_io_total) / (100 * itv),
               NULL);
 
        render(isdb, pre, PT_NOFLAG,
-              "-\tf_aio10", NULL, NULL,
+              "-\t%fio-10", NULL, NULL,
               NOVAL,
               (double) psic->full_aio_10 / 100,
               NULL);
 
        render(isdb, pre, PT_NOFLAG,
-              "-\tf_aio60", NULL, NULL,
+              "-\t%fio-60", NULL, NULL,
               NOVAL,
               (double) psic->full_aio_60 / 100,
               NULL);
 
        render(isdb, pre, PT_NOFLAG,
-              "-\tf_aio300", NULL, NULL,
+              "-\t%fio-300", NULL, NULL,
               NOVAL,
               (double) psic->full_aio_300 / 100,
               NULL);
 
        render(isdb, pre, pt_newlin,
-              "-\tf_tio/s", NULL, NULL,
+              "-\t%fio", NULL, NULL,
               NOVAL,
-              S_VALUE(psip->full_io_total, psic->full_io_total, itv),
+              ((double) psic->full_io_total - psip->full_io_total) / (100 * itv),
               NULL);
 }
 
@@ -3332,50 +3332,50 @@ __print_funct_t render_psimem_stats(struct activity *a, int isdb, char *pre,
                = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
 
        render(isdb, pre, PT_NOFLAG,
-              "-\ts_amem10", NULL, NULL,
+              "-\t%smem-10", NULL, NULL,
               NOVAL,
               (double) psic->some_amem_10 / 100,
               NULL);
 
        render(isdb, pre, PT_NOFLAG,
-              "-\ts_amem60", NULL, NULL,
+              "-\t%smem-60", NULL, NULL,
               NOVAL,
               (double) psic->some_amem_60 / 100,
               NULL);
 
        render(isdb, pre, PT_NOFLAG,
-              "-\ts_amem300", NULL, NULL,
+              "-\t%smem-300", NULL, NULL,
               NOVAL,
               (double) psic->some_amem_300 / 100,
               NULL);
 
        render(isdb, pre, PT_NOFLAG,
-              "-\ts_tmem/s", NULL, NULL,
+              "-\t%smem", NULL, NULL,
               NOVAL,
-              S_VALUE(psip->some_mem_total, psic->some_mem_total, itv),
+              ((double) psic->some_mem_total - psip->some_mem_total) / (100 * itv),
               NULL);
 
        render(isdb, pre, PT_NOFLAG,
-              "-\tf_amem10", NULL, NULL,
+              "-\t%fmem-10", NULL, NULL,
               NOVAL,
               (double) psic->full_amem_10 / 100,
               NULL);
 
        render(isdb, pre, PT_NOFLAG,
-              "-\tf_amem60", NULL, NULL,
+              "-\t%fmem-60", NULL, NULL,
               NOVAL,
               (double) psic->full_amem_60 / 100,
               NULL);
 
        render(isdb, pre, PT_NOFLAG,
-              "-\tf_amem300", NULL, NULL,
+              "-\t%fmem-300", NULL, NULL,
               NOVAL,
               (double) psic->full_amem_300 / 100,
               NULL);
 
        render(isdb, pre, pt_newlin,
-              "-\tf_tmem/s", NULL, NULL,
+              "-\t%fmem", NULL, NULL,
               NOVAL,
-              S_VALUE(psip->full_mem_total, psic->full_mem_total, itv),
+              ((double) psic->full_mem_total - psip->full_mem_total) / (100 * itv),
               NULL);
 }
index 837e6404bd1cb01af496eca3b17a6a7c7b1cda66..fcf34f80bfb859235a6c81fbc52d5c4ff7271946 100644 (file)
@@ -5268,23 +5268,14 @@ __print_funct_t svg_print_psicpu_stats(struct activity *a, int curr, int action,
                *psic = (struct stats_psi_cpu *) a->buf[curr],
                *psip = (struct stats_psi_cpu *) a->buf[!curr];
        int group[] = {3, 1};
-       int g_type[] = {SVG_LINE_GRAPH, SVG_LINE_GRAPH};
+       int g_type[] = {SVG_LINE_GRAPH, SVG_BAR_GRAPH};
        char *title[] = {"CPU pressure trends (some tasks)", "CPU stall time (some tasks)"};
-       char *g_title[] = {"s_acpu10", "s_acpu60", "s_acpu300",
-                          "s_tcpu/s"};
-       /*
-        * s_acpu10:0, s_acpu60:1, s_acpu300:2, s_tcpu/s:3
-        * g_fields[]: metric position for each field in stats_psi_cpu structure
-        *       some_cpu_total=3  -> only s_tcpu/s will be checked in save_extrema() function.
-        *      (some_acpu_10=0)
-        *      (some_acpu_60=1)
-        *      (some_acpu_300=2)
-        */
-       int g_fields[] = {3};
-       unsigned int local_types_nr[] = {1, 0, 0};
+       char *g_title[] = {"%scpu-10", "%scpu-60", "%scpu-300",
+                          "%scpu"};
        static double *spmin, *spmax;
        static char **out;
        static int *outsize;
+       double tval;
 
        if (action & F_BEGIN) {
                /*
@@ -5295,13 +5286,7 @@ __print_funct_t svg_print_psicpu_stats(struct activity *a, int curr, int action,
        }
 
        if (action & F_MAIN) {
-               /*
-                * Check for min/max values.
-                * Don't use save_extrema() function as some values are absolute ones (s_acpu10,...)
-                * but s_tcpu/s is a per-second value.
-                */
-               save_extrema(local_types_nr, (void *) a->buf[curr], (void *) a->buf[!curr],
-                            itv, spmin, spmax, g_fields);
+               /* Check for min/max values */
                if (psic->some_acpu_10 > *spmax) {
                        *spmax = psic->some_acpu_10;
                }
@@ -5320,23 +5305,31 @@ __print_funct_t svg_print_psicpu_stats(struct activity *a, int curr, int action,
                if (psic->some_acpu_300 < *(spmin + 2)) {
                        *(spmin + 2) = psic->some_acpu_300;
                }
+               tval = ((double) psic->some_cpu_total - psip->some_cpu_total) / (100 * itv);
+               if (tval > *(spmax + 3)) {
+                       *(spmax + 3) = tval;
+               }
+               if (tval < *(spmin + 3)) {
+                       *(spmin + 3) = tval;
+               }
 
-               /* s_acpu10 */
+               /* %scpu-10 */
                lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
                         (double) psic->some_acpu_10 / 100,
                         out, outsize, svg_p->restart);
-               /* s_acpu60 */
+               /* %scpu-60 */
                lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
                         (double) psic->some_acpu_60 / 100,
                         out + 1, outsize + 1, svg_p->restart);
-               /* s_acpu300 */
+               /* %scpu-300 */
                lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
                         (double) psic->some_acpu_300 / 100,
                         out + 2, outsize + 2, svg_p->restart);
-               /* s_tcpu/s */
-               lniappend(record_hdr->ust_time - svg_p->ust_time_ref,
-                         S_VALUE(psip->some_cpu_total, psic->some_cpu_total, itv),
-                         out + 3, outsize + 3, svg_p->restart);
+               /* %scpu */
+               brappend(record_hdr->ust_time - svg_p->ust_time_ref,
+                        0.0,
+                        ((double) psic->some_cpu_total - psip->some_cpu_total) / (100 * itv),
+                        out + 3, outsize + 3, svg_p->dt);
        }
 
        if (action & F_END) {
@@ -5376,18 +5369,17 @@ __print_funct_t svg_print_psiio_stats(struct activity *a, int curr, int action,
                *psic = (struct stats_psi_io *) a->buf[curr],
                *psip = (struct stats_psi_io *) a->buf[!curr];
        int group[] = {3, 1, 3, 1};
-       int g_type[] = {SVG_LINE_GRAPH, SVG_LINE_GRAPH, SVG_LINE_GRAPH, SVG_LINE_GRAPH};
+       int g_type[] = {SVG_LINE_GRAPH, SVG_BAR_GRAPH, SVG_LINE_GRAPH, SVG_BAR_GRAPH};
        char *title[] = {"I/O pressure trends (some tasks)", "I/O stall time (some tasks)",
                         "I/O pressure trends (full)", "I/O stall time (full)"};
-       char *g_title[] = {"s_aio10", "s_aio60", "s_aio300",
-                          "s_tio/s",
-                          "f_aio10", "f_aio60", "f_aio300",
-                          "f_tio/s"};
-       int g_fields[] = {3, 7};
-       unsigned int local_types_nr[] = {2, 0, 0};
+       char *g_title[] = {"%sio-10", "%sio-60", "%sio-300",
+                          "%sio",
+                          "%fio-10", "%fio-60", "%fio-300",
+                          "%fio"};
        static double *spmin, *spmax;
        static char **out;
        static int *outsize;
+       double tval;
 
        if (action & F_BEGIN) {
                /*
@@ -5398,13 +5390,7 @@ __print_funct_t svg_print_psiio_stats(struct activity *a, int curr, int action,
        }
 
        if (action & F_MAIN) {
-               /*
-                * Check for min/max values.
-                * Don't use save_extrema() function as some values are absolute ones and others are
-                * per-second ones.
-                */
-               save_extrema(local_types_nr, (void *) a->buf[curr], (void *) a->buf[!curr],
-                            itv, spmin, spmax, g_fields);
+               /* Check for min/max values */
                if (psic->some_aio_10 > *spmax) {
                        *spmax = psic->some_aio_10;
                }
@@ -5423,6 +5409,13 @@ __print_funct_t svg_print_psiio_stats(struct activity *a, int curr, int action,
                if (psic->some_aio_300 < *(spmin + 2)) {
                        *(spmin + 2) = psic->some_aio_300;
                }
+               tval = ((double) psic->some_io_total - psip->some_io_total) / (100 * itv);
+               if (tval > *(spmax + 3)) {
+                       *(spmax + 3) = tval;
+               }
+               if (tval < *(spmin + 3)) {
+                       *(spmin + 3) = tval;
+               }
 
                if (psic->full_aio_10 > *(spmax + 4)) {
                        *(spmax + 4) = psic->full_aio_10;
@@ -5442,40 +5435,49 @@ __print_funct_t svg_print_psiio_stats(struct activity *a, int curr, int action,
                if (psic->full_aio_300 < *(spmin + 6)) {
                        *(spmin + 6) = psic->full_aio_300;
                }
+               tval = ((double) psic->full_io_total - psip->full_io_total) / (100 * itv);
+               if (tval > *(spmax + 7)) {
+                       *(spmax + 7) = tval;
+               }
+               if (tval < *(spmin + 7)) {
+                       *(spmin + 7) = tval;
+               }
 
-               /* s_aio10 */
+               /* %sio-10 */
                lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
                         (double) psic->some_aio_10 / 100,
                         out, outsize, svg_p->restart);
-               /* s_aio60 */
+               /* %sio-60 */
                lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
                         (double) psic->some_aio_60 / 100,
                         out + 1, outsize + 1, svg_p->restart);
-               /* s_aio300 */
+               /* %sio-300 */
                lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
                         (double) psic->some_aio_300 / 100,
                         out + 2, outsize + 2, svg_p->restart);
-               /* s_tio/s */
-               lniappend(record_hdr->ust_time - svg_p->ust_time_ref,
-                         S_VALUE(psip->some_io_total, psic->some_io_total, itv),
-                         out + 3, outsize + 3, svg_p->restart);
+               /* %sio */
+               brappend(record_hdr->ust_time - svg_p->ust_time_ref,
+                        0.0,
+                        ((double) psic->some_io_total - psip->some_io_total) / (100 * itv),
+                        out + 3, outsize + 3, svg_p->dt);
 
-               /* f_aio10 */
+               /* %fio-10 */
                lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
                         (double) psic->full_aio_10 / 100,
                         out + 4, outsize + 4, svg_p->restart);
-               /* f_aio60 */
+               /* %fio-60 */
                lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
                         (double) psic->full_aio_60 / 100,
                         out + 5, outsize + 5, svg_p->restart);
-               /* f_aio300 */
+               /* %fio-300 */
                lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
                         (double) psic->full_aio_300 / 100,
                         out + 6, outsize + 6, svg_p->restart);
-               /* f_tio/s */
-               lniappend(record_hdr->ust_time - svg_p->ust_time_ref,
-                         S_VALUE(psip->full_io_total, psic->full_io_total, itv),
-                         out + 7, outsize + 7, svg_p->restart);
+               /* %fio */
+               brappend(record_hdr->ust_time - svg_p->ust_time_ref,
+                        0.0,
+                        ((double) psic->full_io_total - psip->full_io_total) / (100 * itv),
+                        out + 7, outsize + 7, svg_p->dt);
        }
 
        if (action & F_END) {
@@ -5519,18 +5521,17 @@ __print_funct_t svg_print_psimem_stats(struct activity *a, int curr, int action,
                *psic = (struct stats_psi_mem *) a->buf[curr],
                *psip = (struct stats_psi_mem *) a->buf[!curr];
        int group[] = {3, 1, 3, 1};
-       int g_type[] = {SVG_LINE_GRAPH, SVG_LINE_GRAPH, SVG_LINE_GRAPH, SVG_LINE_GRAPH};
+       int g_type[] = {SVG_LINE_GRAPH, SVG_BAR_GRAPH, SVG_LINE_GRAPH, SVG_BAR_GRAPH};
        char *title[] = {"Memory pressure trends (some tasks)", "Memory stall time (some tasks)",
                         "Memory pressure trends (full)", "Memory stall time (full)"};
-       char *g_title[] = {"s_amem10", "s_amem60", "s_amem300",
-                          "s_tmem/s",
-                          "f_amem10", "f_amem60", "f_amem300",
-                          "f_tmem/s"};
-       int g_fields[] = {3, 7};
-       unsigned int local_types_nr[] = {2, 0, 0};
+       char *g_title[] = {"%smem-10", "%smem-60", "%smem-300",
+                          "%smem",
+                          "%fmem-10", "%fmem-60", "%fmem-300",
+                          "%fmem"};
        static double *spmin, *spmax;
        static char **out;
        static int *outsize;
+       double tval;
 
        if (action & F_BEGIN) {
                /*
@@ -5541,13 +5542,7 @@ __print_funct_t svg_print_psimem_stats(struct activity *a, int curr, int action,
        }
 
        if (action & F_MAIN) {
-               /*
-                * Check for min/max values.
-                * Don't use save_extrema() function as some values are absolute ones and others are
-                * per-second ones.
-                */
-               save_extrema(local_types_nr, (void *) a->buf[curr], (void *) a->buf[!curr],
-                            itv, spmin, spmax, g_fields);
+               /* Check for min/max values */
                if (psic->some_amem_10 > *spmax) {
                        *spmax = psic->some_amem_10;
                }
@@ -5566,6 +5561,13 @@ __print_funct_t svg_print_psimem_stats(struct activity *a, int curr, int action,
                if (psic->some_amem_300 < *(spmin + 2)) {
                        *(spmin + 2) = psic->some_amem_300;
                }
+               tval = ((double) psic->some_mem_total - psip->some_mem_total) / (100 * itv);
+               if (tval > *(spmax + 3)) {
+                       *(spmax + 3) = tval;
+               }
+               if (tval < *(spmin + 3)) {
+                       *(spmin + 3) = tval;
+               }
 
                if (psic->full_amem_10 > *(spmax + 4)) {
                        *(spmax + 4) = psic->full_amem_10;
@@ -5585,40 +5587,49 @@ __print_funct_t svg_print_psimem_stats(struct activity *a, int curr, int action,
                if (psic->full_amem_300 < *(spmin + 6)) {
                        *(spmin + 6) = psic->full_amem_300;
                }
+               tval = ((double) psic->full_mem_total - psip->full_mem_total) / (100 * itv);
+               if (tval > *(spmax + 7)) {
+                       *(spmax + 7) = tval;
+               }
+               if (tval < *(spmin + 7)) {
+                       *(spmin + 7) = tval;
+               }
 
-               /* s_amem10 */
+               /* %smem-10 */
                lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
                         (double) psic->some_amem_10 / 100,
                         out, outsize, svg_p->restart);
-               /* s_amem60 */
+               /* %smem-60 */
                lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
                         (double) psic->some_amem_60 / 100,
                         out + 1, outsize + 1, svg_p->restart);
-               /* s_amem300 */
+               /* %smem-300 */
                lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
                         (double) psic->some_amem_300 / 100,
                         out + 2, outsize + 2, svg_p->restart);
-               /* s_tmem/s */
-               lniappend(record_hdr->ust_time - svg_p->ust_time_ref,
-                         S_VALUE(psip->some_mem_total, psic->some_mem_total, itv),
-                         out + 3, outsize + 3, svg_p->restart);
+               /* %smem */
+               brappend(record_hdr->ust_time - svg_p->ust_time_ref,
+                        0.0,
+                        ((double) psic->some_mem_total - psip->some_mem_total) / (100 * itv),
+                        out + 3, outsize + 3, svg_p->dt);
 
-               /* f_amem10 */
+               /* %fmem-10 */
                lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
                         (double) psic->full_amem_10 / 100,
                         out + 4, outsize + 4, svg_p->restart);
-               /* f_amem60 */
+               /* %fmem-60 */
                lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
                         (double) psic->full_amem_60 / 100,
                         out + 5, outsize + 5, svg_p->restart);
-               /* f_amem300 */
+               /* %fmem-300 */
                lnappend(record_hdr->ust_time - svg_p->ust_time_ref,
                         (double) psic->full_amem_300 / 100,
                         out + 6, outsize + 6, svg_p->restart);
-               /* f_tmem/s */
-               lniappend(record_hdr->ust_time - svg_p->ust_time_ref,
-                         S_VALUE(psip->full_mem_total, psic->full_mem_total, itv),
-                         out + 7, outsize + 7, svg_p->restart);
+               /* %fmem */
+               brappend(record_hdr->ust_time - svg_p->ust_time_ref,
+                        0.0,
+                        ((double) psic->full_mem_total - psip->full_mem_total) / (100 * itv),
+                        out + 7, outsize + 7, svg_p->dt);
        }
 
        if (action & F_END) {
index 27aa31ef424903bb203a69c807c94fde64d6cb58..9b81d3971fa2183652d18ce8e9417e7fa20e38db 100644 (file)
@@ -2332,11 +2332,11 @@ __print_funct_t xml_print_psicpu_stats(struct activity *a, int curr, int tab,
                "some_avg10=\"%.2f\" "
                "some_avg60=\"%.2f\" "
                "some_avg300=\"%.2f\" "
-               "some_total=\"%.2f\"/>",
+               "some_avg=\"%.2f\"/>",
                (double) psic->some_acpu_10  / 100,
                (double) psic->some_acpu_60  / 100,
                (double) psic->some_acpu_300 / 100,
-               S_VALUE(psip->some_cpu_total, psic->some_cpu_total, itv));
+               ((double) psic->some_cpu_total - psip->some_cpu_total) / (100 * itv));
        tab--;
 
 close_xml_markup:
@@ -2373,19 +2373,19 @@ __print_funct_t xml_print_psiio_stats(struct activity *a, int curr, int tab,
                "some_avg10=\"%.2f\" "
                "some_avg60=\"%.2f\" "
                "some_avg300=\"%.2f\" "
-               "some_total=\"%.2f\" "
+               "some_avg=\"%.2f\" "
                "full_avg10=\"%.2f\" "
                "full_avg60=\"%.2f\" "
                "full_avg300=\"%.2f\" "
-               "full_total=\"%.2f\"/>",
+               "full_avg=\"%.2f\"/>",
                (double) psic->some_aio_10  / 100,
                (double) psic->some_aio_60  / 100,
                (double) psic->some_aio_300 / 100,
-               S_VALUE(psip->some_io_total, psic->some_io_total, itv),
+               ((double) psic->some_io_total - psip->some_io_total) / (100 * itv),
                (double) psic->full_aio_10  / 100,
                (double) psic->full_aio_60  / 100,
                (double) psic->full_aio_300 / 100,
-               S_VALUE(psip->full_io_total, psic->full_io_total, itv));
+               ((double) psic->full_io_total - psip->full_io_total) / (100 * itv));
        tab--;
 
 close_xml_markup:
@@ -2422,19 +2422,19 @@ __print_funct_t xml_print_psimem_stats(struct activity *a, int curr, int tab,
                "some_avg10=\"%.2f\" "
                "some_avg60=\"%.2f\" "
                "some_avg300=\"%.2f\" "
-               "some_total=\"%.2f\" "
+               "some_avg=\"%.2f\" "
                "full_avg10=\"%.2f\" "
                "full_avg60=\"%.2f\" "
                "full_avg300=\"%.2f\" "
-               "full_total=\"%.2f\"/>",
+               "full_avg=\"%.2f\"/>",
                (double) psic->some_amem_10  / 100,
                (double) psic->some_amem_60  / 100,
                (double) psic->some_amem_300 / 100,
-               S_VALUE(psip->some_mem_total, psic->some_mem_total, itv),
+               ((double) psic->some_mem_total - psip->some_mem_total) / (100 * itv),
                (double) psic->full_amem_10  / 100,
                (double) psic->full_amem_60  / 100,
                (double) psic->full_amem_300 / 100,
-               S_VALUE(psip->full_mem_total, psic->full_mem_total, itv));
+               ((double) psic->full_mem_total - psip->full_mem_total) / (100 * itv));
        tab--;
 
 close_xml_markup: