-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathframetest.h
75 lines (63 loc) · 1.74 KB
/
frametest.h
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
* This file is part of tframetest.
*
* Copyright (c) 2023 Tuxera Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef FRAMETEST_FRAMETEST_H
#define FRAMETEST_FRAMETEST_H
#include "profile.h"
#include "frame.h"
#define SEC_IN_NS 1000000000UL
#define SEC_IN_MS (SEC_IN_NS / 1000UL)
enum TestMode {
TEST_WRITE = 1 << 0,
TEST_READ = 1 << 1,
TEST_EMPTY = 1 << 2,
};
typedef struct opts_t {
enum TestMode mode;
enum ProfileType prof;
size_t write_size;
profile_t profile;
frame_t *frm;
const char *path;
size_t threads;
size_t frames;
size_t fps;
size_t header_size;
unsigned int reverse : 1;
unsigned int random : 1;
unsigned int csv : 1;
unsigned int no_csv_header : 1;
unsigned int times : 1;
unsigned int frametimes : 1;
unsigned int histogram : 1;
} opts_t;
typedef struct test_completion_t {
uint64_t start;
uint64_t open;
uint64_t io;
uint64_t close;
uint64_t frame;
} test_completion_t;
typedef struct test_result_t {
uint64_t frames_written;
uint64_t bytes_written;
uint64_t time_taken_ns;
test_completion_t *completion;
} test_result_t;
#endif