]> granicus.if.org Git - sysstat/blobdiff - xml_stats.c
Merge branch 'scop-grep-E'
[sysstat] / xml_stats.c
index a7097c5977620ff840567bef0c8a3652aaa660ab..8d16ed7f94cd287e7ba7c1c32ea1a2ea3d8f44d6 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * xml_stats.c: Funtions used by sadf to display statistics in XML.
- * (C) 1999-2020 by Sebastien GODARD (sysstat <at> orange.fr)
+ * xml_stats.c: Functions used by sadf to display statistics in XML.
+ * (C) 1999-2021 by Sebastien GODARD (sysstat <at> orange.fr)
  *
  ***************************************************************************
  * This program is free software; you can redistribute it and/or modify it *
@@ -35,7 +35,7 @@
 #define _(string) (string)
 #endif
 
-extern unsigned int flags;
+extern uint64_t flags;
 
 /*
  ***************************************************************************
@@ -745,8 +745,9 @@ __print_funct_t xml_print_disk_stats(struct activity *a, int curr, int tab,
                }
 
                /* Get device name */
-               dev_name = get_sa_devname(sdc->major, sdc->minor,
-                                         sdc->wwn, sdc->part_nr, flags);
+               dev_name = get_device_name(sdc->major, sdc->minor, sdc->wwn, sdc->part_nr,
+                                          DISPLAY_PRETTY(flags), DISPLAY_PERSIST_NAME_S(flags),
+                                          USE_STABLE_ID(flags), NULL);
 
                if (a->item_list != NULL) {
                        /* A list of devices has been entered on the command line */
@@ -2112,17 +2113,19 @@ __print_funct_t xml_print_filesystem_stats(struct activity *a, int curr, int tab
 {
        int i;
        struct stats_filesystem *sfc;
+       char *dev_name;
 
        xprintf(tab++, "<filesystems>");
 
        for (i = 0; i < a->nr[curr]; i++) {
-
                sfc = (struct stats_filesystem *) ((char *) a->buf[curr] + i * a->msize);
 
+               /* Get name to display (persistent or standard fs name, or mount point) */
+               dev_name = get_fs_name_to_display(a, flags, sfc);
+
                if (a->item_list != NULL) {
                        /* A list of devices has been entered on the command line */
-                       if (!search_list_item(a->item_list,
-                                             DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name))
+                       if (!search_list_item(a->item_list, dev_name))
                                /* Device not found */
                                continue;
                }
@@ -2136,7 +2139,7 @@ __print_funct_t xml_print_filesystem_stats(struct activity *a, int curr, int tab
                        "Iused=\"%llu\" "
                        "Iused-percent=\"%.2f\"/>",
                        DISPLAY_MOUNT(a->opt_flags) ? "mountp" : "fsname",
-                       DISPLAY_MOUNT(a->opt_flags) ? sfc->mountp : sfc->fs_name,
+                       dev_name,
                        (double) sfc->f_bfree / 1024 / 1024,
                        (double) (sfc->f_blocks - sfc->f_bfree) / 1024 / 1024,
                        /* f_blocks is not zero. But test it anyway ;-) */