Lines Matching +full:1 +full:- +full:d
1 // SPDX-License-Identifier: GPL-2.0
6 #include "time-utils.h"
21 pr_debug("error %d\n", err); in test__parse_nsec_time()
45 pr_debug("Error %d\n", err); in test__perf_time__parse_str()
70 static bool test__perf_time__parse_for_ranges(struct test_data *d) in test__perf_time__parse_for_ranges() argument
73 .first_sample_time = d->first, in test__perf_time__parse_for_ranges()
74 .last_sample_time = d->last, in test__perf_time__parse_for_ranges()
82 pr_debug("\nperf_time__parse_for_ranges(\"%s\")\n", d->str); in test__perf_time__parse_for_ranges()
84 if (strchr(d->str, '%')) in test__perf_time__parse_for_ranges()
86 d->first, d->last); in test__perf_time__parse_for_ranges()
88 err = perf_time__parse_for_ranges(d->str, &session, &ptime, &range_size, in test__perf_time__parse_for_ranges()
91 pr_debug("error %d\n", err); in test__perf_time__parse_for_ranges()
95 if (range_size < d->num || range_num != d->num) { in test__perf_time__parse_for_ranges()
96 pr_debug("bad size: range_size %d range_num %d expected num %d\n", in test__perf_time__parse_for_ranges()
97 range_size, range_num, d->num); in test__perf_time__parse_for_ranges()
101 for (i = 0; i < d->num; i++) { in test__perf_time__parse_for_ranges()
102 if (ptime[i].start != d->ptime[i].start || in test__perf_time__parse_for_ranges()
103 ptime[i].end != d->ptime[i].end) { in test__perf_time__parse_for_ranges()
104 pr_debug("bad range %d expected %" PRIu64 " to %" PRIu64 "\n", in test__perf_time__parse_for_ranges()
105 i, d->ptime[i].start, d->ptime[i].end); in test__perf_time__parse_for_ranges()
110 if (perf_time__ranges_skip_sample(ptime, d->num, 0)) { in test__perf_time__parse_for_ranges()
116 if (d->skip[i] && in test__perf_time__parse_for_ranges()
117 !perf_time__ranges_skip_sample(ptime, d->num, d->skip[i])) { in test__perf_time__parse_for_ranges()
118 pr_debug("failed to skip %" PRIu64 "\n", d->skip[i]); in test__perf_time__parse_for_ranges()
121 if (d->noskip[i] && in test__perf_time__parse_for_ranges()
122 perf_time__ranges_skip_sample(ptime, d->num, d->noskip[i])) { in test__perf_time__parse_for_ranges()
123 pr_debug("failed to keep %" PRIu64 "\n", d->noskip[i]); in test__perf_time__parse_for_ranges()
139 pass &= test__parse_nsec_time("1", 1000000000ULL); in test__time_utils()
140 pass &= test__parse_nsec_time("0.000000001", 1); in test__time_utils()
160 struct test_data d = { in test__time_utils() local
162 .ptime = { {b, b + 1}, }, in test__time_utils()
163 .num = 1, in test__time_utils()
164 .skip = { b - 1, b + 2, }, in test__time_utils()
165 .noskip = { b, b + 1, }, in test__time_utils()
168 pass &= test__perf_time__parse_for_ranges(&d); in test__time_utils()
175 struct test_data d = { in test__time_utils() local
179 .ptime = { {b, b + 1}, {c, c + 123}, {e, e + 5}, }, in test__time_utils()
181 .skip = { b - 1, b + 2, c - 1, c + 124, e - 1, e + 6 }, in test__time_utils()
182 .noskip = { b, b + 1, c, c + 123, e, e + 5 }, in test__time_utils()
185 pass &= test__perf_time__parse_for_ranges(&d); in test__time_utils()
190 struct test_data d = { in test__time_utils() local
191 .str = "10%/1", in test__time_utils()
195 .num = 1, in test__time_utils()
196 .skip = { b - 1, b + 10, }, in test__time_utils()
200 pass &= test__perf_time__parse_for_ranges(&d); in test__time_utils()
205 struct test_data d = { in test__time_utils() local
210 .num = 1, in test__time_utils()
215 pass &= test__perf_time__parse_for_ranges(&d); in test__time_utils()
220 struct test_data d = { in test__time_utils() local
221 .str = "10%/1,10%/2", in test__time_utils()
226 .skip = { b - 1, b + 20, }, in test__time_utils()
230 pass &= test__perf_time__parse_for_ranges(&d); in test__time_utils()
235 struct test_data d = { in test__time_utils() local
236 .str = "10%/1,10%/3,10%/10", in test__time_utils()
241 .skip = { b - 1, b + 10, b + 19, b + 30, b + 89, b + 101 }, in test__time_utils()
245 pass &= test__perf_time__parse_for_ranges(&d); in test__time_utils()