Files
s390-tools/zconf/chp/chpstat/column.h
Peter Oberparleiter cb77faeae7 chpstat: add tool to display channel-path statistics
Add a new tool named chpstat that can be used to view channel-path
statistics such as utilization and I/O throughput, and to query and
control the status of the channel-path statistics function.

Note: Channel-path statistics are only available on systems running in
      an LPAR or DPM partition.

When run without further options, data for all channel-paths is
displayed repeatedly with a 5 second delay in table format.

Example output:

      CHANNEL-PATH       UTILIZATION(%)   READ(B/s)  WRITE(B/s)
  ID TYP CMG SHR SPEED  PART TOTAL  BUS  PART TOTAL  PART TOTAL
  1d  25   2   1     -  7.16  7.50 7.50  129M  129M  0.00  161K
  21  1b   2   1   32G  0.00  0.00 0.00  0.00  0.00  0.00  0.00
  34  1b   2   1   32G  0.00  0.00 0.00  0.00  0.00  0.00  0.00
  61  25   2   1     -  0.00  0.01 0.00  0.00 2.00K  0.00  307K
  63  25   2   1     -  0.00  0.01 0.00  0.00  0.00  0.00  381K
  bd  11   2   1   10G     -     -    - 529.8 532.1 616.3 616.3

Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
2024-05-27 16:52:27 +02:00

85 lines
1.7 KiB
C

/*
* Registry for supported table columns
*
* Copyright IBM Corp. 2024
*
* s390-tools is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
*/
#ifndef COLUMN_H
#define COLUMN_H
#include <stdbool.h>
enum column_id_t {
COL_NONE = -1,
COL_CHPID,
COL_TYPE,
COL_CMG,
COL_SHARED,
COL_SPEED,
COL_INTERVAL,
COL_TIMESTAMP,
COL_UTIL_PART,
COL_UTIL_TOTAL,
COL_UTIL_BUS,
COL_READ_PART,
COL_READ_TOTAL,
COL_WRITE_PART,
COL_WRITE_TOTAL,
COL_FICON_RATE,
COL_FICON_ACTIVE,
COL_FICON_DEFER,
COL_HPF_RATE,
COL_HPF_ACTIVE,
COL_HPF_DEFER,
COL_MSG_RATE_PART,
COL_MSG_RATE_TOTAL,
COL_MSG_SIZE_PART,
COL_MSG_SIZE_TOTAL,
COL_SEND_FAIL_PART,
COL_RCV_FAIL_PART,
COL_RCV_FAIL_TOTAL,
/* Special value indicating no column. */
COL_END
};
enum col_unit_t {
COL_OTHER,
COL_NUMBER,
COL_PERCENT,
COL_BPS,
};
struct column_t {
enum column_id_t id;
const char *name;
enum col_unit_t unit;
const char *desc;
const char *hdr2;
const char *hdr1_single;
char *hdr1_group;
unsigned int width;
};
#define column_for_each(c) \
for (unsigned int __i = 0; ((c) = column_get_by_index(__i, false)); \
__i++)
#define column_for_each_selected(c) \
for (unsigned int __i = 0; ((c) = column_get_by_index(__i, true)); \
__i++)
struct column_t *column_get_by_index(unsigned int i, bool selected);
struct column_t *column_get_by_name(const char *name);
void column_select(struct column_t *col);
void column_select_id_list(const int *ids);
void column_select_default(void);
void column_select_all(void);
void column_update_bps_suffix(bool auto_scale, char suffix_char);
void column_exit(void);
#endif /* COLUMN_H */