Commit Graph

10 Commits

Author SHA1 Message Date
Mete Durlu
84738668ca hyptop/helper: fix smt utilization calculation
When calculating smt utiliziation field, subresults are capped to a
minimum value of zero to prevent wrap around while converting values
from signed to unsigned integers. The capping of subresults cause slight
inaccuracies therefore capping has been moved from intermediate steps
and done at the end.

Fixes: 0209c11bc1 ("hyptop: Add real SMT utilization field")

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-08-21 17:07:44 +02:00
Mete Durlu
ea3529e624 hyptop: allow users to set speedup factor
While calculating real CPU SMT utilization, the SMT speedup factor needs
to be taken into account. Speedup factor depends on machine generations
and variations on workload the machine has. The users should be able to
determine the value according to their needs.

Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-07-20 21:45:22 +02:00
Mete Durlu
0209c11bc1 hyptop: Add real SMT utilization field
By using core utilization, thread utilization, and management
utilization, it is possible to determine how much capacity is left or
how much the real CPU SMT utilization is on lpars. Extending hyptop
with this new field provides useful information.

For more info about real CPU SMT utilization:
https://linux.mainframe.blog/smt_utilization/

Briefly:
ur = real SMT util
uc = core util
ut = thread util
um = *management util
s  = **speedup factor

	ur = ((uc * per_core_thr_count) - ut) / s + (ut - uc) + um

* management utilization:
logical core time spent on hypervisor instead of logical partition.
** speedup factor:
metric used to calculate the SMT utilization on that logical core. This
value varies depending on the workload and the machine generation due
to hardware optimization level.

Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-07-20 21:45:16 +02:00
Mete Durlu
2b2c111af4 hyptop: Show thread util by default
Since SMT is being used by default on z systems, hyptop should show
thread utilization by default on both system and system list window.

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2023-05-26 12:18:08 +02:00
Mete Durlu
80e54ac888 hyptop: increase initial update interval
Increase initial update interval from 200ms to 1 seconds to avoid
fluctuations on the initial data output.

Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2022-06-20 13:14:05 +02:00
Jan Höppner
84623f39dc hyptop: Fix -Wrestrict warning
Make sure there are two different buffers passed to iconv() to get rid
of the following GCC8 compile warning:

helper.c: In function ‘ht_ebcdic_to_ascii’:
helper.c:103:30: warning: passing argument 2 to restrict-qualified
parameter aliases with argument 4 [-Wrestrict]
  iconv(l_iconv_ebcdic_ascii, &inout, &len, &inout, &len);
                              ^~~~~~        ~~~~~~
helper.c:103:38: warning: passing argument 3 to restrict-qualified
parameter aliases with argument 5 [-Wrestrict]
  iconv(l_iconv_ebcdic_ascii, &inout, &len, &inout, &len);
                                      ^~~~          ~~~~

Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2018-12-11 15:52:07 +01:00
Jan Höppner
637750f299 hyptop: Replace strncpy() with util_strlcpy()
Ensure that strings are copied correctly by using util_strlcpy() rather
than strncpy().

This fixes the following GCC8 compile warnings:

sd_core.c: In function ‘sd_cpu_new’:
sd_core.c:222:2: warning: ‘strncpy’ specified bound 9 equals destination
size [-Wstringop-truncation]
  strncpy(cpu->id, id, sizeof(cpu->id));
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sd_core.c: In function ‘sd_sys_new’:
sd_core.c:254:2: warning: ‘strncpy’ specified bound 9 equals destination
size [-Wstringop-truncation]
  strncpy(sys_new->id, id, sizeof(sys_new->id));
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tbox.c:160:2: warning: ‘strncpy’ specified bound 121 equals destination
size [-Wstringop-truncation]
  strncpy(line_cpy, line, sizeof(line_cpy));
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

win_sys.c: In function ‘win_sys_set’:
win_sys.c:329:2: warning: ‘strncpy’ specified bound 9 equals destination
size [-Wstringop-truncation]
  strncpy(l_sys_id, sys_id, sizeof(l_sys_id));
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2018-11-16 15:19:48 +01:00
Jan Höppner
a17b52a043 hyptop: Remove unused function sd_cpu_real_type_set()
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2018-11-16 15:19:48 +01:00
Michael Holzheu
221e74c27c Get rid of gcc 7 "fall through" warnings
With gcc 7 we get warnings like the following:

 fdasd.c: In function 'main':
 fdasd.c:3055:4: warning: this statement may fall through
                          [-Wimplicit-fallthrough=]
     fdasd_exit(&anchor, 0);
     ^~~~~~~~~~~~~~~~~~~~~~
 fdasd.c:3056:3: note: here
    default:
    ^~~~~~~

Fix this by marking functions with "__noreturn" to help gcc.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
2017-09-06 13:05:01 +02:00
Michael Holzheu
b627b8d8e1 Initial s390-tools-2.0.0 import
This commit is based on the s390-tools-1.39.0 version.

Changes on top of s390-tools-1.39.0:

 - Add MIT license to all source files
 - Add LICENSE file
 - Transform REAMDE to README.md (markdown)
 - Add AUTHORS.md file
 - Add CONTRIBUTING.md file
 - Move changelog from README to CHANGELOG.md file

Reviewed-by: Stefan Haberland <sth@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
2017-08-21 10:55:40 +02:00