iostat.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * perf iostat
  4. *
  5. * Copyright (C) 2020, Intel Corporation
  6. *
  7. * Authors: Alexander Antonov <alexander.antonov@linux.intel.com>
  8. */
  9. #ifndef _IOSTAT_H
  10. #define _IOSTAT_H
  11. #include <subcmd/parse-options.h>
  12. #include "util/stat.h"
  13. #include "util/parse-events.h"
  14. #include "util/evlist.h"
  15. struct option;
  16. struct perf_stat_config;
  17. struct evlist;
  18. struct timespec;
  19. enum iostat_mode_t {
  20. IOSTAT_NONE = -1,
  21. IOSTAT_RUN = 0,
  22. IOSTAT_LIST = 1
  23. };
  24. extern enum iostat_mode_t iostat_mode;
  25. typedef void (*iostat_print_counter_t)(struct perf_stat_config *, struct evsel *, void *);
  26. int iostat_prepare(struct evlist *evlist, struct perf_stat_config *config);
  27. int iostat_parse(const struct option *opt, const char *str,
  28. int unset __maybe_unused);
  29. void iostat_list(struct evlist *evlist, struct perf_stat_config *config);
  30. void iostat_release(struct evlist *evlist);
  31. void iostat_prefix(struct evlist *evlist, struct perf_stat_config *config,
  32. char *prefix, struct timespec *ts);
  33. void iostat_print_header_prefix(struct perf_stat_config *config);
  34. void iostat_print_metric(struct perf_stat_config *config, struct evsel *evsel,
  35. struct perf_stat_output_ctx *out);
  36. void iostat_print_counters(struct evlist *evlist,
  37. struct perf_stat_config *config, struct timespec *ts,
  38. char *prefix, iostat_print_counter_t print_cnt_cb, void *arg);
  39. #endif /* _IOSTAT_H */