Lines Matching refs:machine
14 #include "machine.h"
107 static int dso__data_fd(struct dso *dso, struct machine *machine)
111 if (dso__data_get_fd(dso, machine, &fd))
130 struct machine machine;
137 memset(&machine, 0, sizeof(machine));
138 dsos__init(&machine.dsos);
141 TEST_ASSERT_VAL("Failed to add dso", !dsos__add(&machine.dsos, dso));
143 dso__data_fd(dso, &machine) >= 0);
152 size = dso__data_read_offset(dso, &machine, data->offset,
171 size = dso__data_read_offset(dso, &machine, 10,
186 dsos__delete(&machine.dsos);
251 struct machine machine;
258 memset(&machine, 0, sizeof(machine));
267 !dsos__create(dso_cnt, TEST_FILE_SIZE, &machine.dsos));
270 struct dso *dso = machine.dsos.dsos[i];
276 fd = dso__data_fd(dso, &machine);
284 n = dso__data_read_offset(dso, &machine, 0, buf, BUFSIZE);
290 TEST_ASSERT_VAL("dsos[0] is not open", dso__data(machine.dsos.dsos[0])->fd != -1);
293 fd = dso__data_fd(machine.dsos.dsos[i], &machine);
297 TEST_ASSERT_VAL("failed to close dsos[0]", dso__data(machine.dsos.dsos[0])->fd == -1);
300 dsos__delete(&machine.dsos);
321 struct machine machine;
325 #define dso_0 (machine.dsos.dsos[0])
326 #define dso_1 (machine.dsos.dsos[1])
327 #define dso_2 (machine.dsos.dsos[2])
332 memset(&machine, 0, sizeof(machine));
348 !dsos__create(3, TEST_FILE_SIZE, &machine.dsos));
351 fd = dso__data_fd(dso_0, &machine);
355 fd = dso__data_fd(dso_1, &machine);
366 fd = dso__data_fd(dso_2, &machine);
376 fd = dso__data_fd(dso_0, &machine);
387 dsos__delete(&machine.dsos);