-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathlibprobe.h
More file actions
43 lines (33 loc) · 1.21 KB
/
libprobe.h
File metadata and controls
43 lines (33 loc) · 1.21 KB
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
#ifndef HEADER_LIBPROBE_H
#define HEADER_LIBPROBE_H
#include <stdint.h>
#include "libutils.h"
#include "libdevs.h"
/* Provide an upper bound on the number of blocks that will be written when
* probe_device(dev) is called.
*
* Notice that probe_device() may read more blocks than it writes.
* For example, the helper function find_wrap() only writes 1 block,
* but reads multiple blocks.
*/
uint64_t probe_max_written_blocks(const struct device *dev);
void report_probed_size(unsigned int indent, progress_cb cb,
const char *prefix, uint64_t bytes, int block_order);
void report_probed_order(unsigned int indent, progress_cb cb,
const char *prefix, int order);
void report_probed_cache(unsigned int indent, progress_cb cb,
const char *prefix, uint64_t cache_size_block, int block_order);
struct probe_results {
uint64_t real_size_byte;
uint64_t announced_size_byte;
int wrap;
uint64_t cache_size_block;
int block_order;
uint64_t seqw_blocks, seqw_time_ns;
uint64_t randw_blocks, randw_time_ns;
uint64_t randr_blocks, randr_time_ns;
};
int probe_device(struct device *dev, struct probe_results *results,
progress_cb cb, int show_progress,
long max_read_rate, long max_write_rate);
#endif /* HEADER_LIBPROBE_H */