Linux Perf
fdarray.c File Reference
#include <api/fd/array.h>
#include <poll.h>
#include "util/debug.h"
#include "tests/tests.h"
Include dependency graph for fdarray.c:

Go to the source code of this file.

Macros

#define FDA_CHECK(_idx, _fd, _revents)
 
#define FDA_ADD(_idx, _fd, _revents, _nr)
 

Functions

static void fdarray__init_revents (struct fdarray *fda, short revents)
 
static int fdarray__fprintf_prefix (struct fdarray *fda, const char *prefix, FILE *fp)
 
int test__fdarray__filter (struct test *test __maybe_unused, int subtest __maybe_unused)
 
int test__fdarray__add (struct test *test __maybe_unused, int subtest __maybe_unused)
 

Macro Definition Documentation

◆ FDA_ADD

#define FDA_ADD (   _idx,
  _fd,
  _revents,
  _nr 
)
Value:
if (fdarray__add(fda, _fd, _revents) < 0) { \
pr_debug("\n%d: fdarray__add(fda, %d, %d) failed!", \
__LINE__,_fd, _revents); \
goto out_delete; \
} \
if (fda->nr != _nr) { \
pr_debug("\n%d: fdarray__add(fda, %d, %d)=%d != %d", \
__LINE__,_fd, _revents, fda->nr, _nr); \
goto out_delete; \
} \
FDA_CHECK(_idx, _fd, _revents)

◆ FDA_CHECK

#define FDA_CHECK (   _idx,
  _fd,
  _revents 
)
Value:
if (fda->entries[_idx].fd != _fd) { \
pr_debug("\n%d: fda->entries[%d](%d) != %d!", \
__LINE__, _idx, fda->entries[1].fd, _fd); \
goto out_delete; \
} \
if (fda->entries[_idx].events != (_revents)) { \
pr_debug("\n%d: fda->entries[%d].revents(%d) != %d!", \
__LINE__, _idx, fda->entries[_idx].fd, _revents); \
goto out_delete; \
}

Function Documentation

◆ fdarray__fprintf_prefix()

static int fdarray__fprintf_prefix ( struct fdarray *  fda,
const char *  prefix,
FILE *  fp 
)
static

Definition at line 19 of file fdarray.c.

◆ fdarray__init_revents()

static void fdarray__init_revents ( struct fdarray *  fda,
short  revents 
)
static

Definition at line 7 of file fdarray.c.

◆ test__fdarray__add()

int test__fdarray__add ( struct test *test  __maybe_unused,
int subtest  __maybe_unused 
)

Definition at line 108 of file fdarray.c.

Here is the call graph for this function:

◆ test__fdarray__filter()

int test__fdarray__filter ( struct test *test  __maybe_unused,
int subtest  __maybe_unused 
)

Definition at line 30 of file fdarray.c.

Here is the call graph for this function: