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