]> granicus.if.org Git - sysstat/commitdiff
sadf: CSV/ppc: Add PSI support
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 12 Apr 2020 09:03:38 +0000 (11:03 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 12 Apr 2020 09:03:38 +0000 (11:03 +0200)
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
activity.c
rndr_stats.c
rndr_stats.h

index 7a2de2dbba502389cdde8156da7d595c196d5b75..a09da59a2c3858ef7ca65b0d98d37a17748b446c 100644 (file)
@@ -1894,7 +1894,7 @@ struct activity psi_cpu_act = {
        .gtypes_nr      = {STATS_PSI_CPU_ULL, STATS_PSI_CPU_UL, STATS_PSI_CPU_U},
        .ftypes_nr      = {0, 0, 0},
 #ifdef SOURCE_SADF
-//FIXME        .f_render       = render_psicpu_stats,
+       .f_render       = render_psicpu_stats,
 //FIXME        .f_xml_print    = xml_print_psicpu_stats,
 //FIXME        .f_json_print   = json_print_psicpu_stats,
 //FIXME        .f_svg_print    = svg_print_psicpu_stats,
@@ -1940,7 +1940,7 @@ struct activity psi_io_act = {
        .gtypes_nr      = {STATS_PSI_IO_ULL, STATS_PSI_IO_UL, STATS_PSI_IO_U},
        .ftypes_nr      = {0, 0, 0},
 #ifdef SOURCE_SADF
-//FIXME        .f_render       = render_psiio_stats,
+       .f_render       = render_psiio_stats,
 //FIXME        .f_xml_print    = xml_print_psiio_stats,
 //FIXME        .f_json_print   = json_print_psiio_stats,
 //FIXME        .f_svg_print    = svg_print_psiio_stats,
@@ -1986,7 +1986,7 @@ struct activity psi_mem_act = {
        .gtypes_nr      = {STATS_PSI_MEM_ULL, STATS_PSI_MEM_UL, STATS_PSI_MEM_U},
        .ftypes_nr      = {0, 0, 0},
 #ifdef SOURCE_SADF
-//FIXME        .f_render       = render_psimem_stats,
+       .f_render       = render_psimem_stats,
 //FIXME        .f_xml_print    = xml_print_psimem_stats,
 //FIXME        .f_json_print   = json_print_psimem_stats,
 //FIXME        .f_svg_print    = svg_print_psimem_stats,
index 9d22590e658ef38c6cb3ff300a6bd694ef24542f..2cff9cc9bb11768377b84c62564cf847ffcf2c56 100644 (file)
@@ -3193,3 +3193,189 @@ __print_funct_t render_softnet_stats(struct activity *a, int isdb, char *pre,
                }
        }
 }
+
+/*
+ ***************************************************************************
+ * Display pressure-stall CPU statistics in selected format.
+ *
+ * IN:
+ * @a          Activity structure with statistics.
+ * @isdb       Flag, true if db printing, false if ppc printing.
+ * @pre                Prefix string for output entries
+ * @curr       Index in array for current sample statistics.
+ * @itv                Interval of time in 1/100th of a second.
+ ***************************************************************************
+ */
+__print_funct_t render_psicpu_stats(struct activity *a, int isdb, char *pre,
+                                   int curr, unsigned long long itv)
+{
+       struct stats_psi_cpu
+               *spic = (struct stats_psi_cpu *) a->buf[curr],
+               *spip = (struct stats_psi_cpu *) a->buf[!curr];
+       int pt_newlin
+               = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
+
+       render(isdb, pre, PT_NOFLAG,
+              "-\ts_acpu10", NULL, NULL,
+              NOVAL,
+              (double) spic->some_acpu_10 / 100,
+              NULL);
+
+       render(isdb, pre, PT_NOFLAG,
+              "-\ts_acpu60", NULL, NULL,
+              NOVAL,
+              (double) spic->some_acpu_60 / 100,
+              NULL);
+
+       render(isdb, pre, PT_NOFLAG,
+              "-\ts_acpu300", NULL, NULL,
+              NOVAL,
+              (double) spic->some_acpu_300 / 100,
+              NULL);
+
+       render(isdb, pre, pt_newlin,
+              "-\ts_tcpu/s", NULL, NULL,
+              NOVAL,
+              S_VALUE(spip->some_cpu_total, spic->some_cpu_total, itv),
+              NULL);
+}
+
+/*
+ ***************************************************************************
+ * Display pressure-stall I/O statistics in selected format.
+ *
+ * IN:
+ * @a          Activity structure with statistics.
+ * @isdb       Flag, true if db printing, false if ppc printing.
+ * @pre                Prefix string for output entries
+ * @curr       Index in array for current sample statistics.
+ * @itv                Interval of time in 1/100th of a second.
+ ***************************************************************************
+ */
+__print_funct_t render_psiio_stats(struct activity *a, int isdb, char *pre,
+                                  int curr, unsigned long long itv)
+{
+       struct stats_psi_io
+               *spic = (struct stats_psi_io *) a->buf[curr],
+               *spip = (struct stats_psi_io *) a->buf[!curr];
+       int pt_newlin
+               = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
+
+       render(isdb, pre, PT_NOFLAG,
+              "-\ts_aio10", NULL, NULL,
+              NOVAL,
+              (double) spic->some_aio_10 / 100,
+              NULL);
+
+       render(isdb, pre, PT_NOFLAG,
+              "-\ts_aio60", NULL, NULL,
+              NOVAL,
+              (double) spic->some_aio_60 / 100,
+              NULL);
+
+       render(isdb, pre, PT_NOFLAG,
+              "-\ts_aio300", NULL, NULL,
+              NOVAL,
+              (double) spic->some_aio_300 / 100,
+              NULL);
+
+       render(isdb, pre, PT_NOFLAG,
+              "-\ts_tio/s", NULL, NULL,
+              NOVAL,
+              S_VALUE(spip->some_io_total, spic->some_io_total, itv),
+              NULL);
+
+       render(isdb, pre, PT_NOFLAG,
+              "-\tf_aio10", NULL, NULL,
+              NOVAL,
+              (double) spic->full_aio_10 / 100,
+              NULL);
+
+       render(isdb, pre, PT_NOFLAG,
+              "-\tf_aio60", NULL, NULL,
+              NOVAL,
+              (double) spic->full_aio_60 / 100,
+              NULL);
+
+       render(isdb, pre, PT_NOFLAG,
+              "-\tf_aio300", NULL, NULL,
+              NOVAL,
+              (double) spic->full_aio_300 / 100,
+              NULL);
+
+       render(isdb, pre, pt_newlin,
+              "-\tf_tio/s", NULL, NULL,
+              NOVAL,
+              S_VALUE(spip->full_io_total, spic->full_io_total, itv),
+              NULL);
+}
+
+/*
+ ***************************************************************************
+ * Display pressure-stall memory statistics in selected format.
+ *
+ * IN:
+ * @a          Activity structure with statistics.
+ * @isdb       Flag, true if db printing, false if ppc printing.
+ * @pre                Prefix string for output entries
+ * @curr       Index in array for current sample statistics.
+ * @itv                Interval of time in 1/100th of a second.
+ ***************************************************************************
+ */
+__print_funct_t render_psimem_stats(struct activity *a, int isdb, char *pre,
+                                   int curr, unsigned long long itv)
+{
+       struct stats_psi_mem
+               *spic = (struct stats_psi_mem *) a->buf[curr],
+               *spip = (struct stats_psi_mem *) a->buf[!curr];
+       int pt_newlin
+               = (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN);
+
+       render(isdb, pre, PT_NOFLAG,
+              "-\ts_amem10", NULL, NULL,
+              NOVAL,
+              (double) spic->some_amem_10 / 100,
+              NULL);
+
+       render(isdb, pre, PT_NOFLAG,
+              "-\ts_amem60", NULL, NULL,
+              NOVAL,
+              (double) spic->some_amem_60 / 100,
+              NULL);
+
+       render(isdb, pre, PT_NOFLAG,
+              "-\ts_amem300", NULL, NULL,
+              NOVAL,
+              (double) spic->some_amem_300 / 100,
+              NULL);
+
+       render(isdb, pre, PT_NOFLAG,
+              "-\ts_tmem/s", NULL, NULL,
+              NOVAL,
+              S_VALUE(spip->some_mem_total, spic->some_mem_total, itv),
+              NULL);
+
+       render(isdb, pre, PT_NOFLAG,
+              "-\tf_amem10", NULL, NULL,
+              NOVAL,
+              (double) spic->full_amem_10 / 100,
+              NULL);
+
+       render(isdb, pre, PT_NOFLAG,
+              "-\tf_amem60", NULL, NULL,
+              NOVAL,
+              (double) spic->full_amem_60 / 100,
+              NULL);
+
+       render(isdb, pre, PT_NOFLAG,
+              "-\tf_amem300", NULL, NULL,
+              NOVAL,
+              (double) spic->full_amem_300 / 100,
+              NULL);
+
+       render(isdb, pre, pt_newlin,
+              "-\tf_tmem/s", NULL, NULL,
+              NOVAL,
+              S_VALUE(spip->full_mem_total, spic->full_mem_total, itv),
+              NULL);
+}
index 9136ae253c0e22736955daae6fc15300f3d98fcc..29a8cdda01be9e5e5c50bf33a18bdbe9eaa66400 100644 (file)
@@ -124,5 +124,11 @@ __print_funct_t render_fchost_stats
        (struct activity *, int, char *, int, unsigned long long);
 __print_funct_t render_softnet_stats
        (struct activity *, int, char *, int, unsigned long long);
+__print_funct_t render_psicpu_stats
+       (struct activity *, int, char *, int, unsigned long long);
+__print_funct_t render_psiio_stats
+       (struct activity *, int, char *, int, unsigned long long);
+__print_funct_t render_psimem_stats
+       (struct activity *, int, char *, int, unsigned long long);
 
 #endif /* _RNDR_STATS_H */