Linux Perf
hists_cumulate.c File Reference
#include "perf.h"
#include "util/debug.h"
#include "util/event.h"
#include "util/symbol.h"
#include "util/sort.h"
#include "util/evsel.h"
#include "util/evlist.h"
#include "util/machine.h"
#include "util/thread.h"
#include "util/parse-events.h"
#include "tests/tests.h"
#include "tests/hists_common.h"
#include <linux/kernel.h>
Include dependency graph for hists_cumulate.c:

Go to the source code of this file.

Classes

struct  sample
 
struct  result
 
struct  callchain_result
 

Macros

#define COMM(he)   (thread__comm_str(he->thread))
 
#define DSO(he)   (he->ms.map->dso->short_name)
 
#define SYM(he)   (he->ms.sym->name)
 
#define CPU(he)   (he->cpu)
 
#define PID(he)   (he->thread->tid)
 
#define DEPTH(he)   (he->callchain->max_depth)
 
#define CDSO(cl)   (cl->ms.map->dso->short_name)
 
#define CSYM(cl)   (cl->ms.sym->name)
 

Typedefs

typedef int(* test_fn_t) (struct perf_evsel *, struct machine *)
 

Functions

static int add_hist_entries (struct hists *hists, struct machine *machine)
 
static void del_hist_entries (struct hists *hists)
 
static int do_test (struct hists *hists, struct result *expected, size_t nr_expected, struct callchain_result *expected_callchain, size_t nr_callchain)
 
static int test1 (struct perf_evsel *evsel, struct machine *machine)
 
static int test2 (struct perf_evsel *evsel, struct machine *machine)
 
static int test3 (struct perf_evsel *evsel, struct machine *machine)
 
static int test4 (struct perf_evsel *evsel, struct machine *machine)
 
int test__hists_cumulate (struct test *test __maybe_unused, int subtest __maybe_unused)
 

Variables

static struct sample fake_samples []
 
static u64 fake_callchains [][10]
 

Macro Definition Documentation

◆ CDSO

#define CDSO (   cl)    (cl->ms.map->dso->short_name)

Definition at line 157 of file hists_cumulate.c.

◆ COMM

#define COMM (   he)    (thread__comm_str(he->thread))

Definition at line 151 of file hists_cumulate.c.

◆ CPU

#define CPU (   he)    (he->cpu)

Definition at line 154 of file hists_cumulate.c.

◆ CSYM

#define CSYM (   cl)    (cl->ms.sym->name)

Definition at line 158 of file hists_cumulate.c.

◆ DEPTH

#define DEPTH (   he)    (he->callchain->max_depth)

Definition at line 156 of file hists_cumulate.c.

◆ DSO

#define DSO (   he)    (he->ms.map->dso->short_name)

Definition at line 152 of file hists_cumulate.c.

◆ PID

#define PID (   he)    (he->thread->tid)

Definition at line 155 of file hists_cumulate.c.

◆ SYM

#define SYM (   he)    (he->ms.sym->name)

Definition at line 153 of file hists_cumulate.c.

Typedef Documentation

◆ test_fn_t

typedef int(* test_fn_t) (struct perf_evsel *, struct machine *)

Definition at line 149 of file hists_cumulate.c.

Function Documentation

◆ add_hist_entries()

static int add_hist_entries ( struct hists hists,
struct machine machine 
)
static

Definition at line 79 of file hists_cumulate.c.

Here is the call graph for this function:

◆ del_hist_entries()

static void del_hist_entries ( struct hists hists)
static

Definition at line 125 of file hists_cumulate.c.

Here is the call graph for this function:

◆ do_test()

static int do_test ( struct hists hists,
struct result expected,
size_t  nr_expected,
struct callchain_result expected_callchain,
size_t  nr_callchain 
)
static

Definition at line 176 of file hists_cumulate.c.

Here is the call graph for this function:

◆ test1()

static int test1 ( struct perf_evsel evsel,
struct machine machine 
)
static

Definition at line 249 of file hists_cumulate.c.

Here is the call graph for this function:

◆ test2()

static int test2 ( struct perf_evsel evsel,
struct machine machine 
)
static

Definition at line 300 of file hists_cumulate.c.

Here is the call graph for this function:

◆ test3()

static int test3 ( struct perf_evsel evsel,
struct machine machine 
)
static

Definition at line 448 of file hists_cumulate.c.

Here is the call graph for this function:

◆ test4()

static int test4 ( struct perf_evsel evsel,
struct machine machine 
)
static

Definition at line 505 of file hists_cumulate.c.

Here is the call graph for this function:

◆ test__hists_cumulate()

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

Definition at line 691 of file hists_cumulate.c.

Here is the call graph for this function:

Variable Documentation

◆ fake_callchains

u64 fake_callchains[][10]
static
Initial value:
= {
}
#define FAKE_IP_BASH_XMALLOC
Definition: hists_common.h:27
#define FAKE_IP_KERNEL_SYS_PERF_EVENT_OPEN
Definition: hists_common.h:34
#define FAKE_IP_LIBC_MALLOC
Definition: hists_common.h:29
#define FAKE_IP_PERF_MAIN
Definition: hists_common.h:23
#define FAKE_IP_KERNEL_SCHEDULE
Definition: hists_common.h:32
#define FAKE_IP_PERF_CMD_RECORD
Definition: hists_common.h:25
#define FAKE_IP_BASH_MAIN
Definition: hists_common.h:26
#define FAKE_IP_PERF_RUN_COMMAND
Definition: hists_common.h:24
#define FAKE_IP_KERNEL_PAGE_FAULT
Definition: hists_common.h:33
#define FAKE_IP_LIBC_FREE
Definition: hists_common.h:30

Definition at line 52 of file hists_cumulate.c.

◆ fake_samples

struct sample fake_samples[]
static
Initial value:
= {
{ .pid = FAKE_PID_PERF1, .ip = FAKE_IP_PERF_MAIN, },
{ .pid = FAKE_PID_PERF1, .ip = FAKE_IP_LIBC_MALLOC, },
{ .pid = FAKE_PID_PERF1, .ip = FAKE_IP_LIBC_FREE, },
{ .pid = FAKE_PID_PERF2, .ip = FAKE_IP_PERF_MAIN, },
{ .pid = FAKE_PID_BASH, .ip = FAKE_IP_BASH_MAIN, },
{ .pid = FAKE_PID_BASH, .ip = FAKE_IP_BASH_XMALLOC, },
}
#define FAKE_IP_BASH_XMALLOC
Definition: hists_common.h:27
#define FAKE_IP_LIBC_MALLOC
Definition: hists_common.h:29
#define FAKE_IP_PERF_MAIN
Definition: hists_common.h:23
#define FAKE_IP_KERNEL_SCHEDULE
Definition: hists_common.h:32
#define FAKE_PID_PERF2
Definition: hists_common.h:9
#define FAKE_IP_PERF_CMD_RECORD
Definition: hists_common.h:25
#define FAKE_PID_PERF1
Definition: hists_common.h:8
#define FAKE_IP_BASH_MAIN
Definition: hists_common.h:26
#define FAKE_IP_KERNEL_PAGE_FAULT
Definition: hists_common.h:33
#define FAKE_PID_BASH
Definition: hists_common.h:10
#define FAKE_IP_LIBC_FREE
Definition: hists_common.h:30

Definition at line 25 of file hists_cumulate.c.