Lines Matching +full:i +full:- +full:leak +full:- +full:current
1 // SPDX-License-Identifier: GPL-2.0
21 #define TEMPL "/tmp/perf-test-XXXXXX" in test_file()
24 int fd, i; in test_file() local
42 for (i = 0; i < size; i++) in test_file()
43 buf[i] = (unsigned char) ((int) i % 10); in test_file()
76 .offset = DSO__DATA_CACHE_SIZE - DSO__DATA_CACHE_SIZE % 10,
82 .offset = DSO__DATA_CACHE_SIZE - DSO__DATA_CACHE_SIZE % 10,
88 .offset = TEST_FILE_SIZE - 10,
94 .offset = TEST_FILE_SIZE - 10,
100 .offset = TEST_FILE_SIZE - 3,
122 size_t i; in test__dso_data() local
135 for (i = 0; i < ARRAY_SIZE(offsets); i++) { in test__dso_data()
136 struct test_data_offset *data = &offsets[i]; in test__dso_data()
141 size = dso__data_read_offset(dso, &machine, data->offset, in test__dso_data()
144 TEST_ASSERT_VAL("Wrong size", size == data->size); in test__dso_data()
145 TEST_ASSERT_VAL("Wrong data", !memcmp(buf, data->data, 10)); in test__dso_data()
164 size == (TEST_FILE_SIZE - 10)); in test__dso_data()
166 for (i = 0; i < (size_t)size; i++) in test__dso_data()
168 buf[i] == (i % 10)); in test__dso_data()
194 if (!strcmp(dent->d_name, ".") || in open_files_cnt()
195 !strcmp(dent->d_name, "..")) in open_files_cnt()
202 return nr - 1; in open_files_cnt()
207 int i; in dsos__create() local
211 for (i = 0; i < cnt; i++) { in dsos__create()
227 for (unsigned int i = 0; i < dsos->cnt; i++) { in dsos__delete() local
228 struct dso *dso = dsos->dsos[i]; in dsos__delete()
241 return -1; in set_fd_limit()
253 int dso_cnt, limit, i, fd; in test__dso_data_cache() local
269 for (i = 0; i < (dso_cnt - 1); i++) { in test__dso_data_cache()
270 struct dso *dso = machine.dsos.dsos[i]; in test__dso_data_cache()
279 if (i % 2) { in test__dso_data_cache()
290 TEST_ASSERT_VAL("dsos[0] is not open", dso__data(machine.dsos.dsos[0])->fd != -1); in test__dso_data_cache()
293 fd = dso__data_fd(machine.dsos.dsos[i], &machine); in test__dso_data_cache()
297 TEST_ASSERT_VAL("failed to close dsos[0]", dso__data(machine.dsos.dsos[0])->fd == -1); in test__dso_data_cache()
302 /* Make sure we did not leak any file descriptor. */ in test__dso_data_cache()
314 ret = new_limit(--count); in new_limit()
336 * - create 3 dso objects in test__dso_data_reopen()
337 * - set process file descriptor limit to current in test__dso_data_reopen()
339 * - test that the first dso gets closed when we in test__dso_data_reopen()
373 TEST_ASSERT_VAL("failed to close dso_0", dso__data(dso_0)->fd == -1); in test__dso_data_reopen()
383 TEST_ASSERT_VAL("failed to close dso_1", dso__data(dso_1)->fd == -1); in test__dso_data_reopen()
389 /* Make sure we did not leak any file descriptor. */ in test__dso_data_reopen()