Linux Perf
trace-event-perl.c File Reference
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <linux/bitmap.h>
#include <linux/time64.h>
#include <stdbool.h>
#include <EXTERN.h>
#include <perl.h>
#include "../../perf.h"
#include "../callchain.h"
#include "../machine.h"
#include "../thread.h"
#include "../event.h"
#include "../trace-event.h"
#include "../evsel.h"
#include "../debug.h"
Include dependency graph for trace-event-perl.c:

Go to the source code of this file.

Macros

#define HAS_BOOL
 
#define TRACE_EVENT_TYPE_MAX   ((1 << (sizeof(unsigned short) * 8)) - 1)
 

Typedefs

typedef PerlInterpreter * INTERP
 

Functions

void boot_Perf__Trace__Context (pTHX_ CV *cv)
 
void boot_DynaLoader (pTHX_ CV *cv)
 
void xs_init (pTHX)
 
static DECLARE_BITMAP (events_defined, TRACE_EVENT_TYPE_MAX)
 
static void define_symbolic_value (const char *ev_name, const char *field_name, const char *field_value, const char *field_str)
 
static void define_symbolic_values (struct print_flag_sym *field, const char *ev_name, const char *field_name)
 
static void define_symbolic_field (const char *ev_name, const char *field_name)
 
static void define_flag_value (const char *ev_name, const char *field_name, const char *field_value, const char *field_str)
 
static void define_flag_values (struct print_flag_sym *field, const char *ev_name, const char *field_name)
 
static void define_flag_field (const char *ev_name, const char *field_name, const char *delim)
 
static void define_event_symbols (struct event_format *event, const char *ev_name, struct print_arg *args)
 
static SV * perl_process_callchain (struct perf_sample *sample, struct perf_evsel *evsel, struct addr_location *al)
 
static void perl_process_tracepoint (struct perf_sample *sample, struct perf_evsel *evsel, struct addr_location *al)
 
static void perl_process_event_generic (union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel)
 
static void perl_process_event (union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel, struct addr_location *al)
 
static void run_start_sub (void)
 
static int perl_start_script (const char *script, int argc, const char **argv)
 
static int perl_flush_script (void)
 
static int perl_stop_script (void)
 
static int perl_generate_script (struct pevent *pevent, const char *outfile)
 

Variables

INTERP my_perl
 
struct scripting_contextscripting_context
 
static char * cur_field_name
 
static int zero_flag_atom
 
struct scripting_ops perl_scripting_ops
 

Macro Definition Documentation

◆ HAS_BOOL

#define HAS_BOOL

Definition at line 33 of file trace-event-perl.c.

◆ TRACE_EVENT_TYPE_MAX

#define TRACE_EVENT_TYPE_MAX   ((1 << (sizeof(unsigned short) * 8)) - 1)

Definition at line 64 of file trace-event-perl.c.

Typedef Documentation

◆ INTERP

typedef PerlInterpreter* INTERP

Definition at line 48 of file trace-event-perl.c.

Function Documentation

◆ boot_DynaLoader()

void boot_DynaLoader ( pTHX_ CV *  cv)

◆ boot_Perf__Trace__Context()

void boot_Perf__Trace__Context ( pTHX_ CV *  cv)

◆ DECLARE_BITMAP()

static DECLARE_BITMAP ( events_defined  ,
TRACE_EVENT_TYPE_MAX   
)
static

◆ define_event_symbols()

static void define_event_symbols ( struct event_format *  event,
const char *  ev_name,
struct print_arg *  args 
)
static

Definition at line 192 of file trace-event-perl.c.

Here is the call graph for this function:

◆ define_flag_field()

static void define_flag_field ( const char *  ev_name,
const char *  field_name,
const char *  delim 
)
static

Definition at line 169 of file trace-event-perl.c.

◆ define_flag_value()

static void define_flag_value ( const char *  ev_name,
const char *  field_name,
const char *  field_value,
const char *  field_str 
)
static

Definition at line 132 of file trace-event-perl.c.

Here is the call graph for this function:

◆ define_flag_values()

static void define_flag_values ( struct print_flag_sym *  field,
const char *  ev_name,
const char *  field_name 
)
static

Definition at line 160 of file trace-event-perl.c.

Here is the call graph for this function:

◆ define_symbolic_field()

static void define_symbolic_field ( const char *  ev_name,
const char *  field_name 
)
static

Definition at line 111 of file trace-event-perl.c.

◆ define_symbolic_value()

static void define_symbolic_value ( const char *  ev_name,
const char *  field_name,
const char *  field_value,
const char *  field_str 
)
static

Definition at line 74 of file trace-event-perl.c.

Here is the call graph for this function:

◆ define_symbolic_values()

static void define_symbolic_values ( struct print_flag_sym *  field,
const char *  ev_name,
const char *  field_name 
)
static

Definition at line 102 of file trace-event-perl.c.

Here is the call graph for this function:

◆ perl_flush_script()

static int perl_flush_script ( void  )
static

Definition at line 516 of file trace-event-perl.c.

◆ perl_generate_script()

static int perl_generate_script ( struct pevent *  pevent,
const char *  outfile 
)
static

Definition at line 538 of file trace-event-perl.c.

Here is the call graph for this function:

◆ perl_process_callchain()

static SV* perl_process_callchain ( struct perf_sample sample,
struct perf_evsel evsel,
struct addr_location al 
)
static

Definition at line 258 of file trace-event-perl.c.

Here is the call graph for this function:

◆ perl_process_event()

static void perl_process_event ( union perf_event event,
struct perf_sample sample,
struct perf_evsel evsel,
struct addr_location al 
)
static

Definition at line 454 of file trace-event-perl.c.

Here is the call graph for this function:

◆ perl_process_event_generic()

static void perl_process_event_generic ( union perf_event event,
struct perf_sample sample,
struct perf_evsel evsel 
)
static

Definition at line 430 of file trace-event-perl.c.

◆ perl_process_tracepoint()

static void perl_process_tracepoint ( struct perf_sample sample,
struct perf_evsel evsel,
struct addr_location al 
)
static

Definition at line 336 of file trace-event-perl.c.

Here is the call graph for this function:

◆ perl_start_script()

static int perl_start_script ( const char *  script,
int  argc,
const char **  argv 
)
static

Definition at line 475 of file trace-event-perl.c.

Here is the call graph for this function:

◆ perl_stop_script()

static int perl_stop_script ( void  )
static

Definition at line 524 of file trace-event-perl.c.

◆ run_start_sub()

static void run_start_sub ( void  )
static

Definition at line 463 of file trace-event-perl.c.

◆ xs_init()

void xs_init ( pTHX  )

Definition at line 52 of file trace-event-perl.c.

Here is the call graph for this function:

Variable Documentation

◆ cur_field_name

char* cur_field_name
static

Definition at line 71 of file trace-event-perl.c.

◆ my_perl

INTERP my_perl

Definition at line 62 of file trace-event-perl.c.

◆ perl_scripting_ops

struct scripting_ops perl_scripting_ops
Initial value:
= {
.name = "Perl",
.start_script = perl_start_script,
.flush_script = perl_flush_script,
.stop_script = perl_stop_script,
.process_event = perl_process_event,
.generate_script = perl_generate_script,
}
static int perl_generate_script(struct pevent *pevent, const char *outfile)
static int perl_stop_script(void)
static void perl_process_event(union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel, struct addr_location *al)
static int perl_flush_script(void)
static int perl_start_script(const char *script, int argc, const char **argv)

Definition at line 745 of file trace-event-perl.c.

◆ scripting_context

Definition at line 32 of file trace-event-scripting.c.

◆ zero_flag_atom

int zero_flag_atom
static

Definition at line 72 of file trace-event-perl.c.