162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * perf iostat 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Copyright (C) 2020, Intel Corporation 662306a36Sopenharmony_ci * 762306a36Sopenharmony_ci * Authors: Alexander Antonov <alexander.antonov@linux.intel.com> 862306a36Sopenharmony_ci */ 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#ifndef _IOSTAT_H 1162306a36Sopenharmony_ci#define _IOSTAT_H 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci#include <subcmd/parse-options.h> 1462306a36Sopenharmony_ci#include "util/stat.h" 1562306a36Sopenharmony_ci#include "util/parse-events.h" 1662306a36Sopenharmony_ci#include "util/evlist.h" 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_cistruct option; 1962306a36Sopenharmony_cistruct perf_stat_config; 2062306a36Sopenharmony_cistruct evlist; 2162306a36Sopenharmony_cistruct timespec; 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_cienum iostat_mode_t { 2462306a36Sopenharmony_ci IOSTAT_NONE = -1, 2562306a36Sopenharmony_ci IOSTAT_RUN = 0, 2662306a36Sopenharmony_ci IOSTAT_LIST = 1 2762306a36Sopenharmony_ci}; 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ciextern enum iostat_mode_t iostat_mode; 3062306a36Sopenharmony_ci 3162306a36Sopenharmony_citypedef void (*iostat_print_counter_t)(struct perf_stat_config *, struct evsel *, void *); 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ciint iostat_prepare(struct evlist *evlist, struct perf_stat_config *config); 3462306a36Sopenharmony_ciint iostat_parse(const struct option *opt, const char *str, 3562306a36Sopenharmony_ci int unset __maybe_unused); 3662306a36Sopenharmony_civoid iostat_list(struct evlist *evlist, struct perf_stat_config *config); 3762306a36Sopenharmony_civoid iostat_release(struct evlist *evlist); 3862306a36Sopenharmony_civoid iostat_prefix(struct evlist *evlist, struct perf_stat_config *config, 3962306a36Sopenharmony_ci char *prefix, struct timespec *ts); 4062306a36Sopenharmony_civoid iostat_print_header_prefix(struct perf_stat_config *config); 4162306a36Sopenharmony_civoid iostat_print_metric(struct perf_stat_config *config, struct evsel *evsel, 4262306a36Sopenharmony_ci struct perf_stat_output_ctx *out); 4362306a36Sopenharmony_civoid iostat_print_counters(struct evlist *evlist, 4462306a36Sopenharmony_ci struct perf_stat_config *config, struct timespec *ts, 4562306a36Sopenharmony_ci char *prefix, iostat_print_counter_t print_cnt_cb, void *arg); 4662306a36Sopenharmony_ci 4762306a36Sopenharmony_ci#endif /* _IOSTAT_H */ 48