summaryrefslogtreecommitdiff
path: root/tools/perf/util/iostat.h
blob: a4e7299c5c2fbc7d4023deb4e0dd94384e94b526 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * perf iostat
 *
 * Copyright (C) 2020, Intel Corporation
 *
 * Authors: Alexander Antonov <alexander.antonov@linux.intel.com>
 */

#ifndef _IOSTAT_H
#define _IOSTAT_H

#include <subcmd/parse-options.h>
#include "util/stat.h"
#include "util/parse-events.h"
#include "util/evlist.h"

struct option;
struct perf_stat_config;
struct evlist;
struct timespec;

enum iostat_mode_t {
	IOSTAT_NONE		= -1,
	IOSTAT_RUN		= 0,
	IOSTAT_LIST		= 1
};

extern enum iostat_mode_t iostat_mode;

typedef void (*iostat_print_counter_t)(struct perf_stat_config *, struct evsel *, void *);

int iostat_prepare(struct evlist *evlist, struct perf_stat_config *config);
int iostat_parse(const struct option *opt, const char *str,
		 int unset __maybe_unused);
void iostat_list(struct evlist *evlist, struct perf_stat_config *config);
void iostat_release(struct evlist *evlist);
void iostat_prefix(struct evlist *evlist, struct perf_stat_config *config,
		   char *prefix, struct timespec *ts);
void iostat_print_header_prefix(struct perf_stat_config *config);
void iostat_print_metric(struct perf_stat_config *config, struct evsel *evsel,
			 struct perf_stat_output_ctx *out);
void iostat_print_counters(struct evlist *evlist,
			   struct perf_stat_config *config, struct timespec *ts,
			   char *prefix, iostat_print_counter_t print_cnt_cb, void *arg);

#endif /* _IOSTAT_H */