Linux Perf
builtin-inject.c File Reference
#include "builtin.h"
#include "perf.h"
#include "util/color.h"
#include "util/evlist.h"
#include "util/evsel.h"
#include "util/session.h"
#include "util/tool.h"
#include "util/debug.h"
#include "util/build-id.h"
#include "util/data.h"
#include "util/auxtrace.h"
#include "util/jit.h"
#include "util/thread.h"
#include <subcmd/parse-options.h>
#include <linux/list.h>
#include <errno.h>
#include <signal.h>
Include dependency graph for builtin-inject.c:

Go to the source code of this file.

Classes

struct  perf_inject
 
struct  event_entry
 

Macros

#define COMPAT_MASK
 

Typedefs

typedef int(* inject_handler) (struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel, struct machine *machine)
 

Functions

static int output_bytes (struct perf_inject *inject, void *buf, size_t sz)
 
static int perf_event__repipe_synth (struct perf_tool *tool, union perf_event *event)
 
static int perf_event__repipe_oe_synth (struct perf_tool *tool, union perf_event *event, struct ordered_events *oe __maybe_unused)
 
static int perf_event__repipe_op2_synth (struct perf_tool *tool, union perf_event *event, struct perf_session *session __maybe_unused)
 
static int perf_event__repipe_attr (struct perf_tool *tool, union perf_event *event, struct perf_evlist **pevlist)
 
static s64 perf_event__repipe_auxtrace (struct perf_tool *tool __maybe_unused, union perf_event *event __maybe_unused, struct perf_session *session __maybe_unused)
 
static int perf_event__repipe (struct perf_tool *tool, union perf_event *event, struct perf_sample *sample __maybe_unused, struct machine *machine __maybe_unused)
 
static int perf_event__drop (struct perf_tool *tool __maybe_unused, union perf_event *event __maybe_unused, struct perf_sample *sample __maybe_unused, struct machine *machine __maybe_unused)
 
static int perf_event__drop_aux (struct perf_tool *tool, union perf_event *event __maybe_unused, struct perf_sample *sample, struct machine *machine __maybe_unused)
 
static int perf_event__repipe_sample (struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel, struct machine *machine)
 
static int perf_event__repipe_mmap (struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct machine *machine)
 
static int perf_event__repipe_mmap2 (struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct machine *machine)
 
static int perf_event__repipe_fork (struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct machine *machine)
 
static int perf_event__repipe_comm (struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct machine *machine)
 
static int perf_event__repipe_namespaces (struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct machine *machine)
 
static int perf_event__repipe_exit (struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct machine *machine)
 
static int perf_event__repipe_tracing_data (struct perf_tool *tool, union perf_event *event, struct perf_session *session)
 
static int perf_event__repipe_id_index (struct perf_tool *tool, union perf_event *event, struct perf_session *session)
 
static int dso__read_build_id (struct dso *dso)
 
static int dso__inject_build_id (struct dso *dso, struct perf_tool *tool, struct machine *machine)
 
static int perf_event__inject_buildid (struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel __maybe_unused, struct machine *machine)
 
static int perf_inject__sched_process_exit (struct perf_tool *tool, union perf_event *event __maybe_unused, struct perf_sample *sample, struct perf_evsel *evsel __maybe_unused, struct machine *machine __maybe_unused)
 
static int perf_inject__sched_switch (struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel, struct machine *machine)
 
static int perf_inject__sched_stat (struct perf_tool *tool, union perf_event *event __maybe_unused, struct perf_sample *sample, struct perf_evsel *evsel, struct machine *machine)
 
static void sig_handler (int sig __maybe_unused)
 
static int perf_evsel__check_stype (struct perf_evsel *evsel, u64 sample_type, const char *sample_msg)
 
static int drop_sample (struct perf_tool *tool __maybe_unused, union perf_event *event __maybe_unused, struct perf_sample *sample __maybe_unused, struct perf_evsel *evsel __maybe_unused, struct machine *machine __maybe_unused)
 
static void strip_init (struct perf_inject *inject)
 
static bool has_tracking (struct perf_evsel *evsel)
 
static bool ok_to_remove (struct perf_evlist *evlist, struct perf_evsel *evsel_to_remove)
 
static void strip_fini (struct perf_inject *inject)
 
static int __cmd_inject (struct perf_inject *inject)
 
int cmd_inject (int argc, const char **argv)
 

Macro Definition Documentation

◆ COMPAT_MASK

#define COMPAT_MASK
Value:
(PERF_SAMPLE_ID | PERF_SAMPLE_TID | PERF_SAMPLE_TIME | \
PERF_SAMPLE_ID | PERF_SAMPLE_CPU | PERF_SAMPLE_IDENTIFIER)

Definition at line 588 of file builtin-inject.c.

Typedef Documentation

◆ inject_handler

typedef int(* inject_handler) (struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel, struct machine *machine)

Definition at line 216 of file builtin-inject.c.

Function Documentation

◆ __cmd_inject()

static int __cmd_inject ( struct perf_inject inject)
static

Definition at line 634 of file builtin-inject.c.

Here is the call graph for this function:

◆ cmd_inject()

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

Definition at line 744 of file builtin-inject.c.

Here is the call graph for this function:

◆ drop_sample()

static int drop_sample ( struct perf_tool *tool  __maybe_unused,
union perf_event *event  __maybe_unused,
struct perf_sample *sample  __maybe_unused,
struct perf_evsel *evsel  __maybe_unused,
struct machine *machine  __maybe_unused 
)
static

Definition at line 562 of file builtin-inject.c.

◆ dso__inject_build_id()

static int dso__inject_build_id ( struct dso dso,
struct perf_tool tool,
struct machine machine 
)
static

Definition at line 403 of file builtin-inject.c.

Here is the call graph for this function:

◆ dso__read_build_id()

static int dso__read_build_id ( struct dso dso)
static

Definition at line 389 of file builtin-inject.c.

Here is the call graph for this function:

◆ has_tracking()

static bool has_tracking ( struct perf_evsel evsel)
static

Definition at line 582 of file builtin-inject.c.

◆ ok_to_remove()

static bool ok_to_remove ( struct perf_evlist evlist,
struct perf_evsel evsel_to_remove 
)
static

Definition at line 596 of file builtin-inject.c.

Here is the call graph for this function:

◆ output_bytes()

static int output_bytes ( struct perf_inject inject,
void *  buf,
size_t  sz 
)
static

Definition at line 52 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_event__drop()

static int perf_event__drop ( struct perf_tool *tool  __maybe_unused,
union perf_event *event  __maybe_unused,
struct perf_sample *sample  __maybe_unused,
struct machine *machine  __maybe_unused 
)
static

Definition at line 195 of file builtin-inject.c.

◆ perf_event__drop_aux()

static int perf_event__drop_aux ( struct perf_tool tool,
union perf_event *event  __maybe_unused,
struct perf_sample sample,
struct machine *machine  __maybe_unused 
)
static

Definition at line 203 of file builtin-inject.c.

◆ perf_event__inject_buildid()

static int perf_event__inject_buildid ( struct perf_tool tool,
union perf_event event,
struct perf_sample sample,
struct perf_evsel *evsel  __maybe_unused,
struct machine machine 
)
static

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

Here is the call graph for this function:

◆ perf_event__repipe()

static int perf_event__repipe ( struct perf_tool tool,
union perf_event event,
struct perf_sample *sample  __maybe_unused,
struct machine *machine  __maybe_unused 
)
static

Definition at line 187 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_event__repipe_attr()

static int perf_event__repipe_attr ( struct perf_tool tool,
union perf_event event,
struct perf_evlist **  pevlist 
)
static

Definition at line 97 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_event__repipe_auxtrace()

static s64 perf_event__repipe_auxtrace ( struct perf_tool *tool  __maybe_unused,
union perf_event *event  __maybe_unused,
struct perf_session *session  __maybe_unused 
)
static

Definition at line 177 of file builtin-inject.c.

◆ perf_event__repipe_comm()

static int perf_event__repipe_comm ( struct perf_tool tool,
union perf_event event,
struct perf_sample sample,
struct machine machine 
)
static

Definition at line 327 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_event__repipe_exit()

static int perf_event__repipe_exit ( struct perf_tool tool,
union perf_event event,
struct perf_sample sample,
struct machine machine 
)
static

Definition at line 352 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_event__repipe_fork()

static int perf_event__repipe_fork ( struct perf_tool tool,
union perf_event event,
struct perf_sample sample,
struct machine machine 
)
static

Definition at line 314 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_event__repipe_id_index()

static int perf_event__repipe_id_index ( struct perf_tool tool,
union perf_event event,
struct perf_session session 
)
static

Definition at line 377 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_event__repipe_mmap()

static int perf_event__repipe_mmap ( struct perf_tool tool,
union perf_event event,
struct perf_sample sample,
struct machine machine 
)
static

Definition at line 238 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_event__repipe_mmap2()

static int perf_event__repipe_mmap2 ( struct perf_tool tool,
union perf_event event,
struct perf_sample sample,
struct machine machine 
)
static

Definition at line 276 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_event__repipe_namespaces()

static int perf_event__repipe_namespaces ( struct perf_tool tool,
union perf_event event,
struct perf_sample sample,
struct machine machine 
)
static

Definition at line 340 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_event__repipe_oe_synth()

static int perf_event__repipe_oe_synth ( struct perf_tool tool,
union perf_event event,
struct ordered_events *oe  __maybe_unused 
)
static

Definition at line 73 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_event__repipe_op2_synth()

static int perf_event__repipe_op2_synth ( struct perf_tool tool,
union perf_event event,
struct perf_session *session  __maybe_unused 
)
static

Definition at line 89 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_event__repipe_sample()

static int perf_event__repipe_sample ( struct perf_tool tool,
union perf_event event,
struct perf_sample sample,
struct perf_evsel evsel,
struct machine machine 
)
static

Definition at line 222 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_event__repipe_synth()

static int perf_event__repipe_synth ( struct perf_tool tool,
union perf_event event 
)
static

Definition at line 64 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_event__repipe_tracing_data()

static int perf_event__repipe_tracing_data ( struct perf_tool tool,
union perf_event event,
struct perf_session session 
)
static

Definition at line 365 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_evsel__check_stype()

static int perf_evsel__check_stype ( struct perf_evsel evsel,
u64  sample_type,
const char *  sample_msg 
)
static

Definition at line 547 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_inject__sched_process_exit()

static int perf_inject__sched_process_exit ( struct perf_tool tool,
union perf_event *event  __maybe_unused,
struct perf_sample sample,
struct perf_evsel *evsel  __maybe_unused,
struct machine *machine  __maybe_unused 
)
static

Definition at line 468 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_inject__sched_stat()

static int perf_inject__sched_stat ( struct perf_tool tool,
union perf_event *event  __maybe_unused,
struct perf_sample sample,
struct perf_evsel evsel,
struct machine machine 
)
static

Definition at line 512 of file builtin-inject.c.

Here is the call graph for this function:

◆ perf_inject__sched_switch()

static int perf_inject__sched_switch ( struct perf_tool tool,
union perf_event event,
struct perf_sample sample,
struct perf_evsel evsel,
struct machine machine 
)
static

Definition at line 488 of file builtin-inject.c.

Here is the call graph for this function:

◆ sig_handler()

static void sig_handler ( int sig  __maybe_unused)
static

Definition at line 542 of file builtin-inject.c.

◆ strip_fini()

static void strip_fini ( struct perf_inject inject)
static

Definition at line 618 of file builtin-inject.c.

Here is the call graph for this function:

◆ strip_init()

static void strip_init ( struct perf_inject inject)
static

Definition at line 571 of file builtin-inject.c.

Here is the call graph for this function: