Linux Perf
builtin-test.c File Reference
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <dirent.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include "builtin.h"
#include "hist.h"
#include "intlist.h"
#include "tests.h"
#include "debug.h"
#include "color.h"
#include <subcmd/parse-options.h>
#include "string2.h"
#include "symbol.h"
#include <linux/kernel.h>
#include <subcmd/exec-cmd.h>
Include dependency graph for builtin-test.c:

Go to the source code of this file.

Classes

struct  shell_test
 

Macros

#define for_each_test(j, t)
 
#define for_each_shell_test(dir, base, ent)
 

Functions

static bool perf_test__matches (struct test *test, int curr, int argc, const char *argv[])
 
static int run_test (struct test *test, int subtest)
 
static int test_and_print (struct test *t, bool force_skip, int subtest)
 
static const char * shell_test__description (char *description, size_t size, const char *path, const char *name)
 
static const char * shell_tests__dir (char *path, size_t size)
 
static int shell_tests__max_desc_width (void)
 
static int shell_test__run (struct test *test, int subdir __maybe_unused)
 
static int run_shell_tests (int argc, const char *argv[], int i, int width)
 
static int __cmd_test (int argc, const char *argv[], struct intlist *skiplist)
 
static int perf_test__list_shell (int argc, const char **argv, int i)
 
static int perf_test__list (int argc, const char **argv)
 
int cmd_test (int argc, const char **argv)
 

Variables

static bool dont_fork
 
struct test __weak arch_tests []
 
static struct test generic_tests []
 
static struct testtests []
 

Macro Definition Documentation

◆ for_each_shell_test

#define for_each_shell_test (   dir,
  base,
  ent 
)
Value:
while ((ent = readdir(dir)) != NULL) \
if (!is_directory(base, ent))
static char * dir
Definition: attr.c:39
bool is_directory(const char *base_path, const struct dirent *dent)
Definition: path.c:83

Definition at line 423 of file builtin-test.c.

◆ for_each_test

#define for_each_test (   j,
 
)
Value:
for (j = 0; j < ARRAY_SIZE(tests); j++) \
for (t = &tests[j][0]; t->func; t++)
int(* func)(struct test *test, int subtest)
Definition: tests.h:32
static struct test * tests[]
Definition: builtin-test.c:287

Definition at line 368 of file builtin-test.c.

Function Documentation

◆ __cmd_test()

static int __cmd_test ( int  argc,
const char *  argv[],
struct intlist skiplist 
)
static

Definition at line 537 of file builtin-test.c.

Here is the call graph for this function:

◆ cmd_test()

int cmd_test ( int  argc,
const char **  argv 
)

Definition at line 673 of file builtin-test.c.

Here is the call graph for this function:

◆ perf_test__list()

static int perf_test__list ( int  argc,
const char **  argv 
)
static

Definition at line 643 of file builtin-test.c.

Here is the call graph for this function:

◆ perf_test__list_shell()

static int perf_test__list_shell ( int  argc,
const char **  argv,
int  i 
)
static

Definition at line 612 of file builtin-test.c.

Here is the call graph for this function:

◆ perf_test__matches()

static bool perf_test__matches ( struct test test,
int  curr,
int  argc,
const char *  argv[] 
)
static

Definition at line 292 of file builtin-test.c.

◆ run_shell_tests()

static int run_shell_tests ( int  argc,
const char *  argv[],
int  i,
int  width 
)
static

Definition at line 500 of file builtin-test.c.

Here is the call graph for this function:

◆ run_test()

static int run_test ( struct test test,
int  subtest 
)
static

Definition at line 316 of file builtin-test.c.

Here is the call graph for this function:

◆ shell_test__description()

static const char* shell_test__description ( char *  description,
size_t  size,
const char *  path,
const char *  name 
)
static

Definition at line 406 of file builtin-test.c.

Here is the call graph for this function:

◆ shell_test__run()

static int shell_test__run ( struct test test,
int subdir  __maybe_unused 
)
static

Definition at line 485 of file builtin-test.c.

Here is the call graph for this function:

◆ shell_tests__dir()

static const char* shell_tests__dir ( char *  path,
size_t  size 
)
static

Definition at line 427 of file builtin-test.c.

Here is the call graph for this function:

◆ shell_tests__max_desc_width()

static int shell_tests__max_desc_width ( void  )
static

Definition at line 449 of file builtin-test.c.

Here is the call graph for this function:

◆ test_and_print()

static int test_and_print ( struct test t,
bool  force_skip,
int  subtest 
)
static

Definition at line 372 of file builtin-test.c.

Here is the call graph for this function:

Variable Documentation

◆ arch_tests

struct test __weak arch_tests[]
Initial value:
= {
{
.func = NULL,
},
}

Definition at line 29 of file builtin-test.c.

◆ dont_fork

bool dont_fork
static

Definition at line 27 of file builtin-test.c.

◆ generic_tests

struct test generic_tests[]
static

Definition at line 35 of file builtin-test.c.

◆ tests

struct test* tests[]
static
Initial value:
= {
}
static struct test generic_tests[]
Definition: builtin-test.c:35
struct test __weak arch_tests[]
Definition: builtin-test.c:29

Definition at line 287 of file builtin-test.c.