Lines Matching refs:machine
107 static int dso__data_fd(struct dso *dso, struct machine *machine) in dso__data_fd() argument
109 int fd = dso__data_get_fd(dso, machine); in dso__data_fd()
119 struct machine machine; in test__dso_data() local
126 memset(&machine, 0, sizeof(machine)); in test__dso_data()
127 dsos__init(&machine.dsos); in test__dso_data()
130 TEST_ASSERT_VAL("Failed to add dso", !dsos__add(&machine.dsos, dso)); in test__dso_data()
132 dso__data_fd(dso, &machine) >= 0); in test__dso_data()
141 size = dso__data_read_offset(dso, &machine, data->offset, in test__dso_data()
160 size = dso__data_read_offset(dso, &machine, 10, in test__dso_data()
175 dsos__exit(&machine.dsos); in test__dso_data()
251 struct machine machine; in test__dso_data_cache() local
258 memset(&machine, 0, sizeof(machine)); in test__dso_data_cache()
267 !dsos__create(dso_cnt, TEST_FILE_SIZE, &machine.dsos)); in test__dso_data_cache()
270 struct dso *dso = machine.dsos.dsos[i]; in test__dso_data_cache()
276 fd = dso__data_fd(dso, &machine); in test__dso_data_cache()
284 n = dso__data_read_offset(dso, &machine, 0, buf, BUFSIZE); 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()
300 dsos__delete(&machine.dsos); in test__dso_data_cache()
321 struct machine machine; in test__dso_data_reopen() local
325 #define dso_0 (machine.dsos.dsos[0]) in test__dso_data_reopen()
326 #define dso_1 (machine.dsos.dsos[1]) in test__dso_data_reopen()
327 #define dso_2 (machine.dsos.dsos[2]) in test__dso_data_reopen()
332 memset(&machine, 0, sizeof(machine)); in test__dso_data_reopen()
348 !dsos__create(3, TEST_FILE_SIZE, &machine.dsos)); in test__dso_data_reopen()
351 fd = dso__data_fd(dso_0, &machine); in test__dso_data_reopen()
355 fd = dso__data_fd(dso_1, &machine); in test__dso_data_reopen()
366 fd = dso__data_fd(dso_2, &machine); in test__dso_data_reopen()
376 fd = dso__data_fd(dso_0, &machine); in test__dso_data_reopen()
387 dsos__delete(&machine.dsos); in test__dso_data_reopen()