Home
last modified time | relevance | path

Searched refs:fda (Results 1 – 6 of 6) sorted by relevance

/linux/tools/lib/api/fd/
H A Darray.c13 void fdarray__init(struct fdarray *fda, int nr_autogrow) in fdarray__init() argument
15 fda->entries = NULL; in fdarray__init()
16 fda->priv = NULL; in fdarray__init()
17 fda->nr = fda->nr_alloc = 0; in fdarray__init()
18 fda->nr_autogrow = nr_autogrow; in fdarray__init()
21 int fdarray__grow(struct fdarray *fda, int nr) in fdarray__grow() argument
24 int nr_alloc = fda->nr_alloc + nr; in fdarray__grow()
25 size_t psize = sizeof(fda->priv[0]) * nr_alloc; in fdarray__grow()
27 struct pollfd *entries = realloc(fda->entries, size); in fdarray__grow()
32 priv = realloc(fda->priv, psize); in fdarray__grow()
[all …]
H A Darray.h39 void fdarray__init(struct fdarray *fda, int nr_autogrow);
40 void fdarray__exit(struct fdarray *fda);
43 void fdarray__delete(struct fdarray *fda);
45 int fdarray__add(struct fdarray *fda, int fd, short revents, enum fdarray_flags flags);
46 int fdarray__dup_entry_from(struct fdarray *fda, int pos, struct fdarray *from);
47 int fdarray__poll(struct fdarray *fda, int timeout);
48 int fdarray__filter(struct fdarray *fda, short revents,
49 void (*entry_destructor)(struct fdarray *fda, int fd, void *arg),
51 int fdarray__grow(struct fdarray *fda, int extra);
52 int fdarray__fprintf(struct fdarray *fda, FILE *fp);
[all …]
/linux/tools/perf/tests/
H A Dfdarray.c7 static void fdarray__init_revents(struct fdarray *fda, short revents) in fdarray__init_revents() argument
11 fda->nr = fda->nr_alloc; in fdarray__init_revents()
13 for (fd = 0; fd < fda->nr; ++fd) { in fdarray__init_revents()
14 fda->entries[fd].fd = fda->nr - fd; in fdarray__init_revents()
15 fda->entries[fd].events = revents; in fdarray__init_revents()
16 fda->entries[fd].revents = revents; in fdarray__init_revents()
20 static int fdarray__fprintf_prefix(struct fdarray *fda, const char *prefix, FILE *fp) in fdarray__fprintf_prefix() argument
28 return printed + fdarray__fprintf(fda, fp); in fdarray__fprintf_prefix()
34 struct fdarray *fda = fdarray__new(5, 5); in test__fdarray__filter() local
36 if (fda == NULL) { in test__fdarray__filter()
[all …]
/linux/tools/perf/
H A Dbuiltin-daemon.c1258 struct fdarray fda; in __cmd_start() local
1294 fdarray__init(&fda, 3); in __cmd_start()
1308 sock_pos = fdarray__add(&fda, sock_fd, POLLIN|POLLERR|POLLHUP, 0); in __cmd_start()
1312 file_pos = fdarray__add(&fda, conf_fd, POLLIN|POLLERR|POLLHUP, 0); in __cmd_start()
1316 signal_pos = fdarray__add(&fda, signal_fd, POLLIN|POLLERR|POLLHUP, 0); in __cmd_start()
1327 if (!err && fdarray__poll(&fda, -1)) { in __cmd_start()
1330 if (fda.entries[sock_pos].revents & POLLIN) in __cmd_start()
1332 if (fda.entries[file_pos].revents & POLLIN) in __cmd_start()
1334 if (fda.entries[signal_pos].revents & POLLIN) in __cmd_start()
1343 fdarray__exit(&fda); in __cmd_start()
/linux/tools/testing/selftests/net/
H A Dmsg_zerocopy.c161 int fda = fd; in do_accept() local
163 fd = accept(fda, NULL, NULL); in do_accept()
166 if (close(fda)) in do_accept()
/linux/tools/lib/perf/
H A Devlist.c373 static void perf_evlist__munmap_filtered(struct fdarray *fda, int fd, in perf_evlist__munmap_filtered() argument
376 struct perf_mmap *map = fda->priv[fd].ptr; in perf_evlist__munmap_filtered()