Added option -H to sar to display hugepages utilization statistics.
Sar manual page updated.
DTD and XSD documents updated (v2.9)
Changes:
xxxx/xx/xx: Version 9.1.6 - Sebastien Godard (sysstat <at> orange.fr)
+ * Added hugepages utilization statistics to sar.
+ * sar manual page updated.
+ * DTD and XSD documents updated.
* Made sysstat git aware.
2010/09/12: Version 9.1.5 - Sebastien Godard (sysstat <at> orange.fr)
.f_xml_print = xml_print_memory_stats,
.hdr_line = "frmpg/s;bufpg/s;campg/s|"
"kbmemfree;kbmemused;%memused;kbbuffers;kbcached;kbcommit;%commit|"
- "kbswpfree;kbswpused;%swpused;kbswpcad;%swpcad",
+ "kbswpfree;kbswpused;%swpused;kbswpcad;%swpcad|"
+ "kbhugfree;kbhugused;%hugused",
.name = "A_MEMORY",
#endif
.nr = 1,
-.TH SAR 1 "AUGUST 2010" Linux "Linux User's Manual" -*- nroff -*-
+.TH SAR 1 "SEPTEMBER 2010" Linux "Linux User's Manual" -*- nroff -*-
.SH NAME
sar \- Collect, report, or save system activity information.
.SH SYNOPSIS
-.B sar [ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -i
+.B sar [ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -H ] [ -i
.I interval
.B ] [ -p ] [ -q ] [ -r ] [ -R ] [ -S ] [ -t ] [ -u [ ALL ] ]
[ -v ] [ -V ] [ -w ] [ -W ] [ -y ]
.SH OPTIONS
.IP -A
This is equivalent to specifying
-.BR "-bBdqrRSuvwWy -I SUM -I XALL -n ALL -u ALL -P ALL".
+.BR "-bBdHqrRSuvwWy -I SUM -I XALL -n ALL -u ALL -P ALL".
.IP -b
Report I/O and transfer rate statistics.
The following values are displayed:
file. The -f option is exclusive of the -o option.
.IP -h
Display a short help message then exit.
+.IP -H
+Report hugepages utilization statistics.
+The following values are displayed:
+
+.B kbhugfree
+.RS
+.RS
+Amount of hugepages memory in kilobytes that is not yet allocated.
+.RE
+
+.B kbhugused
+.RS
+Amount of hugepages memory in kilobytes that has been allocated.
+.RE
+
+.B %hugused
+.RS
+Percentage of total hugepages memory that has been allocated.
+.RE
+.RE
.IP "-i interval"
Select data records at seconds as close as possible to the number specified
by the
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: sysstat <at> orange.fr\n"
-"POT-Creation-Date: 2010-09-04 08:21+0200\n"
+"POT-Creation-Date: 2010-09-18 15:03+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "sysstat version %s\n"
msgstr ""
-#: ioconf.c:490 rd_stats.c:72 rd_stats.c:1831 sa_common.c:1052 sadc.c:593
+#: ioconf.c:490 rd_stats.c:72 rd_stats.c:1848 sa_common.c:1052 sadc.c:593
#: sadc.c:602 sadc.c:662
#, c-format
msgid "Cannot open %s: %s\n"
"ALL } ] [ -V ]\n"
msgstr ""
-#: mpstat.c:530 pidstat.c:1806 sar.c:360
+#: mpstat.c:530 pidstat.c:1806 sar.c:361
msgid "Average:"
msgstr ""
"[ -p { <pid> [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n"
msgstr ""
-#: pidstat.c:199 sar.c:978
+#: pidstat.c:199 sar.c:979
#, c-format
msgid "Requested activities not available\n"
msgstr ""
-#: rd_stats.c:1877
+#: rd_stats.c:1894
#, c-format
msgid "Cannot handle so many processors!\n"
msgstr ""
#, c-format
msgid ""
"Options are:\n"
-"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n"
+"[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -H ] [ -p ] [ -q ] [ -r ]\n"
"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n"
"[ -I { <int> [,...] | SUM | ALL | XALL } ] [ -P { <cpu> [,...] | ALL } ]\n"
"[ -m { <keyword> [,...] | ALL } ] [ -n { <keyword> [,...] | ALL } ]\n"
#: sar.c:130
#, c-format
+msgid "\t-H\tHugepages utilization statistics\n"
+msgstr ""
+
+#: sar.c:131
+#, c-format
msgid ""
"\t-I { <int> | SUM | ALL | XALL }\n"
"\t\tInterrupts statistics\n"
msgstr ""
-#: sar.c:132
+#: sar.c:133
#, c-format
msgid ""
"\t-m { <keyword> [,...] | ALL }\n"
"\t\tTEMP\tDevices temperature\n"
msgstr ""
-#: sar.c:139
+#: sar.c:140
#, c-format
msgid ""
"\t-n { <keyword> [,...] | ALL }\n"
"\t\tUDP6\tUDP traffic\t(v6)\n"
msgstr ""
-#: sar.c:160
+#: sar.c:161
#, c-format
msgid "\t-q\tQueue length and load average statistics\n"
msgstr ""
-#: sar.c:161
+#: sar.c:162
#, c-format
msgid "\t-r\tMemory utilization statistics\n"
msgstr ""
-#: sar.c:162
+#: sar.c:163
#, c-format
msgid "\t-R\tMemory statistics\n"
msgstr ""
-#: sar.c:163
+#: sar.c:164
#, c-format
msgid "\t-S\tSwap space utilization statistics\n"
msgstr ""
-#: sar.c:164
+#: sar.c:165
#, c-format
msgid ""
"\t-u [ ALL ]\n"
"\t\tCPU utilization statistics\n"
msgstr ""
-#: sar.c:166
+#: sar.c:167
#, c-format
msgid "\t-v\tKernel table statistics\n"
msgstr ""
-#: sar.c:167
+#: sar.c:168
#, c-format
msgid "\t-w\tTask creation and system switching statistics\n"
msgstr ""
-#: sar.c:168
+#: sar.c:169
#, c-format
msgid "\t-W\tSwapping statistics\n"
msgstr ""
-#: sar.c:169
+#: sar.c:170
#, c-format
msgid "\t-y\tTTY device statistics\n"
msgstr ""
-#: sar.c:212
+#: sar.c:213
#, c-format
msgid "End of data collecting unexpected\n"
msgstr ""
-#: sar.c:780
+#: sar.c:781
#, c-format
msgid "Invalid data format\n"
msgstr ""
-#: sar.c:784
+#: sar.c:785
#, c-format
msgid "Using a wrong data collector from a different sysstat version\n"
msgstr ""
-#: sar.c:804
+#: sar.c:805
#, c-format
msgid "Inconsistent input data\n"
msgstr ""
-#: sar.c:1225
+#: sar.c:1226
#, c-format
msgid "-f and -o options are mutually exclusive\n"
msgstr ""
-#: sar.c:1231
+#: sar.c:1232
#, c-format
msgid "Not reading from a system activity file (use -f option)\n"
msgstr ""
-#: sar.c:1332
+#: sar.c:1333
#, c-format
msgid "Cannot find the data collector (%s)\n"
msgstr ""
/*
***************************************************************************
- * Display memory and swap statistics. This function is used to display
- * instantaneous and average statistics.
+ * Display memory, swap and huge pages statistics. This function is used to
+ * display instantaneous and average statistics.
*
* IN:
* @a Activity structure with statistics.
avg_frskb = 0,
avg_tlskb = 0,
avg_caskb = 0;
+ static unsigned long long
+ avg_frhkb = 0,
+ avg_tlhkb = 0;
if (DISPLAY_MEMORY(a->opt_flags)) {
if (dis) {
avg_frskb = avg_tlskb = avg_caskb = 0;
}
}
+
+ if (DISPLAY_HUGE(a->opt_flags)) {
+ if (dis) {
+ printf("\n%-11s kbhugfree kbhugused %%hugused\n",
+ timestamp[!curr]);
+ }
+
+ if (!dispavg) {
+ /* Display instantaneous values */
+ printf("%-11s %9lu %9lu %6.2f\n",
+ timestamp[curr],
+ smc->frhkb,
+ smc->tlhkb - smc->frhkb,
+ smc->tlhkb ?
+ SP_VALUE(smc->frhkb, smc->tlhkb, smc->tlhkb) : 0.0);
+
+ /* Will be used to compute the average */
+ avg_frhkb += smc->frhkb;
+ avg_tlhkb += smc->tlhkb;
+ }
+ else {
+ /* Display average values */
+ printf("%-11s %9.0f %9.0f %6.2f\n",
+ timestamp[curr],
+ (double) avg_frhkb / avg_count,
+ ((double) avg_tlhkb / avg_count) -
+ ((double) avg_frhkb / avg_count),
+ ((double) (avg_tlhkb / avg_count)) ?
+ SP_VALUE((double) (avg_frhkb / avg_count),
+ (double) (avg_tlhkb / avg_count),
+ (double) (avg_tlhkb / avg_count)) :
+ 0.0);
+
+ /* Reset average counters */
+ avg_frhkb = avg_tlhkb = 0;
+ }
+ }
}
/*
/*
***************************************************************************
- * Display memory and swap statistics in selected format.
+ * Display memory, swap and huge pages statistics in selected format.
*
* IN:
* @a Activity structure with statistics.
SP_VALUE(0, smc->caskb, smc->tlskb - smc->frskb) :
0.0);
}
+
+ if (DISPLAY_HUGE(a->opt_flags)) {
+
+ render(isdb, pre, PT_USEINT,
+ "-\tkbhugfree", NULL, NULL,
+ smc->frhkb, DNOVAL);
+
+ render(isdb, pre, PT_USEINT,
+ "-\tkbhugused", NULL, NULL,
+ smc->tlhkb - smc->frhkb, DNOVAL);
+
+ render(isdb, pre, pt_newlin,
+ "-\t%%hugused", NULL, NULL, NOVAL,
+ smc->tlhkb ?
+ SP_VALUE(smc->frhkb, smc->tlhkb, smc->tlhkb) :
+ 0.0);
+ }
}
/*
SP_VALUE(0, smc->comkb, smc->tlmkb + smc->tlskb) :
0.0);
}
-
+
if (DISPLAY_SWAP(a->opt_flags)) {
xprintf(++tab, "<swpfree>%lu</swpfree>",
0.0);
}
+ if (DISPLAY_HUGE(a->opt_flags)) {
+
+ xprintf(++tab, "<hugfree>%lu</hugfree>",
+ smc->frhkb);
+
+ xprintf(tab, "<hugused>%lu</hugused>",
+ smc->tlhkb - smc->frhkb);
+
+ xprintf(tab, "<hugused-percent>%.2f</hugused-percent>",
+ smc->tlhkb ?
+ SP_VALUE(smc->frhkb, smc->tlhkb, smc->tlhkb) :
+ 0.0);
+ }
+
if (DISPLAY_MEMORY(a->opt_flags)) {
xprintf(++tab, "<frmpg>%.2f</frmpg>",
{
FILE *fp;
char line[128];
+ unsigned long szhkb = 0;
if ((fp = fopen(MEMINFO, "r")) == NULL)
return;
/* Read the amount of commited memory in kB */
sscanf(line + 13, "%lu", &st_memory->comkb);
}
+ else if (!strncmp(line, "HugePages_Total:", 16)) {
+ /* Read the total number of huge pages */
+ sscanf(line + 16, "%lu", &st_memory->tlhkb);
+ }
+ else if (!strncmp(line, "HugePages_Free:", 15)) {
+ /* Read the number of free huge pages */
+ sscanf(line + 15, "%lu", &st_memory->frhkb);
+ }
+ else if (!strncmp(line, "Hugepagesize:", 13)) {
+ /* Read the default size of a huge page in kB */
+ sscanf(line + 13, "%lu", &szhkb);
+ }
}
fclose(fp);
+
+ /* We want huge pages stats in kB and not expressed in a number of pages */
+ st_memory->tlhkb *= szhkb;
+ st_memory->frhkb *= szhkb;
}
/*
unsigned long tlskb __attribute__ ((aligned (8)));
unsigned long caskb __attribute__ ((aligned (8)));
unsigned long comkb __attribute__ ((aligned (8)));
+ unsigned long frhkb __attribute__ ((aligned (8)));
+ unsigned long tlhkb __attribute__ ((aligned (8)));
};
#define STATS_MEMORY_SIZE (sizeof(struct stats_memory))
#define DISPLAY_HORIZONTALLY(m) (((m) & S_F_HORIZONTALLY) == S_F_HORIZONTALLY)
#define DISPLAY_COMMENT(m) (((m) & S_F_COMMENT) == S_F_COMMENT)
-/* Output flags for options -R / -r / -S */
+/* Output flags for options -R / -r / -S / -H */
#define AO_F_MEM_DIA 0x00000001
#define AO_F_MEM_AMT 0x00000002
#define AO_F_MEM_SWAP 0x00000004
+#define AO_F_MEM_HUGE 0x00000008
#define DISPLAY_MEMORY(m) (((m) & AO_F_MEM_DIA) == AO_F_MEM_DIA)
#define DISPLAY_MEM_AMT(m) (((m) & AO_F_MEM_AMT) == AO_F_MEM_AMT)
#define DISPLAY_SWAP(m) (((m) & AO_F_MEM_SWAP) == AO_F_MEM_SWAP)
+#define DISPLAY_HUGE(m) (((m) & AO_F_MEM_HUGE) == AO_F_MEM_HUGE)
/* Output flags for option -u [ ALL ] */
#define AO_F_CPU_DEF 0x00000001
*flags |= S_F_PER_PROC;
p = get_activity_position(act, A_MEMORY);
- act[p]->opt_flags |= AO_F_MEM_AMT + AO_F_MEM_DIA + AO_F_MEM_SWAP;
+ act[p]->opt_flags |= AO_F_MEM_AMT + AO_F_MEM_DIA +
+ AO_F_MEM_SWAP + AO_F_MEM_HUGE;
p = get_activity_position(act, A_IRQ);
set_bitmap(act[p]->bitmap->b_array, ~0,
SELECT_ACTIVITY(A_DISK);
break;
+ case 'H':
+ p = get_activity_position(act, A_MEMORY);
+ act[p]->options |= AO_SELECTED;
+ act[p]->opt_flags |= AO_F_MEM_HUGE;
+ break;
+
case 'p':
*flags |= S_F_DEV_PRETTY;
break;
#define S_O_DBD_OPTION 5
/* DTD version for XML output */
-#define XML_DTD_VERSION "2.8"
+#define XML_DTD_VERSION "2.9"
#endif /* _SADF_H */
print_usage_title(progname);
fprintf(stderr, _("Options are:\n"
- "[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -p ] [ -q ] [ -r ]\n"
+ "[ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -H ] [ -p ] [ -q ] [ -r ]\n"
"[ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]\n"
"[ -I { <int> [,...] | SUM | ALL | XALL } ] [ -P { <cpu> [,...] | ALL } ]\n"
"[ -m { <keyword> [,...] | ALL } ] [ -n { <keyword> [,...] | ALL } ]\n"
fprintf(stderr, _("\t-b\tI/O and transfer rate statistics\n"));
fprintf(stderr, _("\t-B\tPaging statistics\n"));
fprintf(stderr, _("\t-d\tBlock device statistics\n"));
+ fprintf(stderr, _("\t-H\tHugepages utilization statistics\n"));
fprintf(stderr, _("\t-I { <int> | SUM | ALL | XALL }\n"
"\t\tInterrupts statistics\n"));
fprintf(stderr, _("\t-m { <keyword> [,...] | ALL }\n"
<?xml version="1.0" encoding="UTF-8"?>
-<!--DTD v2.8 for sysstat. See sadf.h -->
+<!--DTD v2.9 for sysstat. See sadf.h -->
<!ELEMENT boot EMPTY>
<!ATTLIST boot
date CDATA #REQUIRED
pty-nr CDATA #REQUIRED
>
<!ELEMENT memfree (#PCDATA)>
-<!ELEMENT memory (memfree, memused, memused-percent, buffers, cached, commit, commit-percent, swpfree, swpused, swpused-percent, swpcad, swpcad-percent, frmpg, bufpg, campg)>
+<!ELEMENT memory (memfree, memused, memused-percent, buffers, cached, commit, commit-percent, swpfree, swpused, swpused-percent, swpcad, swpcad-percent, hugfree, hugused, hugused-percent, frmpg, bufpg, campg)>
<!ATTLIST memory
per CDATA #REQUIRED
unit CDATA #REQUIRED
<!ELEMENT swpfree (#PCDATA)>
<!ELEMENT swpused (#PCDATA)>
<!ELEMENT swpused-percent (#PCDATA)>
+<!ELEMENT hugfree (#PCDATA)>
+<!ELEMENT hugused (#PCDATA)>
+<!ELEMENT hugused-percent (#PCDATA)>
<!ELEMENT sysdata-version (#PCDATA)>
<!ELEMENT sysname (#PCDATA)>
<!ELEMENT machine (#PCDATA)>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://pagesperso-orange.fr/sebastien.godard/sysstat" targetNamespace="http://pagesperso-orange.fr/sebastien.godard/sysstat" elementFormDefault="qualified">
-<xs:annotation><xs:appinfo>-- XML Schema v2.8 for sysstat. See sadf.h --</xs:appinfo></xs:annotation>
+<xs:annotation><xs:appinfo>-- XML Schema v2.9 for sysstat. See sadf.h --</xs:appinfo></xs:annotation>
<xs:element name="queue" type="queue-type"></xs:element>
<xs:element name="swpused-percent" type="hundredth-type"></xs:element>
<xs:element name="swpcad" type="xs:nonNegativeInteger"></xs:element>
<xs:element name="swpcad-percent" type="hundredth-type"></xs:element>
+ <xs:element name="hugfree" type="xs:nonNegativeInteger"></xs:element>
+ <xs:element name="hugused" type="xs:nonNegativeInteger"></xs:element>
+ <xs:element name="hugused-percent" type="hundredth-type"></xs:element>
<xs:element name="frmpg" type="hundredth-type"></xs:element>
<xs:element name="bufpg" type="hundredth-type"></xs:element>
<xs:element name="campg" type="hundredth-type"></xs:element>