56 lines
1.9 KiB
Diff
56 lines
1.9 KiB
Diff
|
diff --git a/src/lparstat.c b/src/lparstat.c
|
||
|
index 0b30fc9..e998e8c 100644
|
||
|
--- a/src/lparstat.c
|
||
|
+++ b/src/lparstat.c
|
||
|
@@ -718,6 +718,16 @@ void get_capped_mode(struct sysentry *se, char *buf)
|
||
|
sprintf(buf, "%s", value);
|
||
|
}
|
||
|
|
||
|
+void get_dedicated_mode(struct sysentry *se, char *buf)
|
||
|
+{
|
||
|
+ const char *value = "Capped";
|
||
|
+
|
||
|
+ if (se->value[0] == '1')
|
||
|
+ value = "Donating";
|
||
|
+
|
||
|
+ sprintf(buf, "%s", value);
|
||
|
+}
|
||
|
+
|
||
|
void get_percent_entry(struct sysentry *se, char *buf)
|
||
|
{
|
||
|
float value;
|
||
|
@@ -1057,7 +1067,10 @@ void print_system_configuration(void)
|
||
|
get_sysdata("shared_processor_mode", &descr, value);
|
||
|
offset = sprintf(buf, "type=%s ", value);
|
||
|
sprintf(type, "%s", value);
|
||
|
- get_sysdata("capped", &descr, value);
|
||
|
+ if (!strcmp(value, "Dedicated"))
|
||
|
+ get_sysdata("DedDonMode", &descr, value);
|
||
|
+ else
|
||
|
+ get_sysdata("capped", &descr, value);
|
||
|
offset += sprintf(buf + offset, "mode=%s ", value);
|
||
|
get_sysdata("smt_state", &descr, value);
|
||
|
offset += sprintf(buf + offset, "smt=%s ", value);
|
||
|
diff --git a/src/lparstat.h b/src/lparstat.h
|
||
|
index 26ed4ba..b7c88e9 100644
|
||
|
--- a/src/lparstat.h
|
||
|
+++ b/src/lparstat.h
|
||
|
@@ -47,6 +47,7 @@ typedef struct cpu_sysfs_file_desc cpu_sysfs_fd;
|
||
|
|
||
|
extern void get_smt_state(struct sysentry *, char *);
|
||
|
extern void get_capped_mode(struct sysentry *, char *);
|
||
|
+extern void get_dedicated_mode(struct sysentry *, char *);
|
||
|
extern void get_memory_mode(struct sysentry *, char *);
|
||
|
extern void get_percent_entry(struct sysentry *, char *);
|
||
|
extern void get_phys_cpu_percentage(struct sysentry *, char *);
|
||
|
@@ -110,7 +111,8 @@ struct sysentry system_data[] = {
|
||
|
{.name = "DesVarCapWt",
|
||
|
.descr = "Desired Variable Capacity Weight"},
|
||
|
{.name = "DedDonMode",
|
||
|
- .descr = "Dedicated Donation Mode"},
|
||
|
+ .descr = "Dedicated Donation Mode",
|
||
|
+ .get = &get_dedicated_mode},
|
||
|
{.name = "partition_entitled_capacity",
|
||
|
.descr = "Partition Entitled Capacity"},
|
||
|
{.name = "system_active_processors",
|