Linux Perf
hists_output.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_output.c:

Go to the source code of this file.

Classes

struct  sample
 

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)
 

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 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)
 
static int test5 (struct perf_evsel *evsel, struct machine *machine)
 
int test__hists_output (struct test *test __maybe_unused, int subtest __maybe_unused)
 

Variables

static struct sample fake_samples []
 

Macro Definition Documentation

◆ COMM

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

Definition at line 117 of file hists_output.c.

◆ CPU

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

Definition at line 120 of file hists_output.c.

◆ DSO

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

Definition at line 118 of file hists_output.c.

◆ PID

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

Definition at line 121 of file hists_output.c.

◆ SYM

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

Definition at line 119 of file hists_output.c.

Typedef Documentation

◆ test_fn_t

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

Definition at line 115 of file hists_output.c.

Function Documentation

◆ add_hist_entries()

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

Definition at line 49 of file hists_output.c.

Here is the call graph for this function:

◆ del_hist_entries()

static void del_hist_entries ( struct hists hists)
static

Definition at line 91 of file hists_output.c.

Here is the call graph for this function:

◆ test1()

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

Definition at line 124 of file hists_output.c.

Here is the call graph for this function:

◆ test2()

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

Definition at line 226 of file hists_output.c.

Here is the call graph for this function:

◆ test3()

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

Definition at line 282 of file hists_output.c.

Here is the call graph for this function:

◆ test4()

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

Definition at line 356 of file hists_output.c.

Here is the call graph for this function:

◆ test5()

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

Definition at line 458 of file hists_output.c.

Here is the call graph for this function:

◆ test__hists_output()

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

Definition at line 577 of file hists_output.c.

Here is the call graph for this function:

Variable Documentation

◆ fake_samples

struct sample fake_samples[]
static
Initial value:
= {
{ .cpu = 0, .pid = FAKE_PID_PERF1, .ip = FAKE_IP_KERNEL_SCHEDULE, },
{ .cpu = 1, .pid = FAKE_PID_PERF1, .ip = FAKE_IP_PERF_MAIN, },
{ .cpu = 1, .pid = FAKE_PID_PERF1, .ip = FAKE_IP_PERF_CMD_RECORD, },
{ .cpu = 1, .pid = FAKE_PID_PERF1, .ip = FAKE_IP_LIBC_MALLOC, },
{ .cpu = 2, .pid = FAKE_PID_PERF1, .ip = FAKE_IP_LIBC_FREE, },
{ .cpu = 2, .pid = FAKE_PID_PERF2, .ip = FAKE_IP_PERF_MAIN, },
{ .cpu = 2, .pid = FAKE_PID_PERF2, .ip = FAKE_IP_KERNEL_PAGE_FAULT, },
{ .cpu = 3, .pid = FAKE_PID_BASH, .ip = FAKE_IP_BASH_MAIN, },
{ .cpu = 0, .pid = FAKE_PID_BASH, .ip = FAKE_IP_BASH_XMALLOC, },
{ .cpu = 1, .pid = FAKE_PID_BASH, .ip = FAKE_IP_KERNEL_PAGE_FAULT, },
}
#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 26 of file hists_output.c.