Linux Perf
header.h File Reference
#include <linux/perf_event.h>
#include <sys/types.h>
#include <stdbool.h>
#include <linux/bitmap.h>
#include <linux/types.h>
#include "event.h"
#include "env.h"
#include "pmu.h"
Include dependency graph for header.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  perf_file_section
 
struct  perf_file_header
 
struct  perf_pipe_file_header
 
struct  perf_header
 

Macros

#define NAME_ALIGN   64
 

Enumerations

enum  {
  HEADER_RESERVED = 0, HEADER_FIRST_FEATURE = 1, HEADER_TRACING_DATA = 1, HEADER_BUILD_ID,
  HEADER_HOSTNAME, HEADER_OSRELEASE, HEADER_VERSION, HEADER_ARCH,
  HEADER_NRCPUS, HEADER_CPUDESC, HEADER_CPUID, HEADER_TOTAL_MEM,
  HEADER_CMDLINE, HEADER_EVENT_DESC, HEADER_CPU_TOPOLOGY, HEADER_NUMA_TOPOLOGY,
  HEADER_BRANCH_STACK, HEADER_PMU_MAPPINGS, HEADER_GROUP_DESC, HEADER_AUXTRACE,
  HEADER_STAT, HEADER_CACHE, HEADER_SAMPLE_TIME, HEADER_MEM_TOPOLOGY,
  HEADER_LAST_FEATURE, HEADER_FEAT_BITS = 256
}
 
enum  perf_header_version { PERF_HEADER_VERSION_1, PERF_HEADER_VERSION_2 }
 

Functions

int perf_file_header__read (struct perf_file_header *header, struct perf_header *ph, int fd)
 
int perf_session__read_header (struct perf_session *session)
 
int perf_session__write_header (struct perf_session *session, struct perf_evlist *evlist, int fd, bool at_exit)
 
int perf_header__write_pipe (int fd)
 
void perf_header__set_feat (struct perf_header *header, int feat)
 
void perf_header__clear_feat (struct perf_header *header, int feat)
 
bool perf_header__has_feat (const struct perf_header *header, int feat)
 
int perf_header__set_cmdline (int argc, const char **argv)
 
int perf_header__process_sections (struct perf_header *header, int fd, void *data, int(*process)(struct perf_file_section *section, struct perf_header *ph, int feat, int fd, void *data))
 
int perf_header__fprintf_info (struct perf_session *s, FILE *fp, bool full)
 
int perf_event__synthesize_features (struct perf_tool *tool, struct perf_session *session, struct perf_evlist *evlist, perf_event__handler_t process)
 
int perf_event__synthesize_extra_attr (struct perf_tool *tool, struct perf_evlist *evsel_list, perf_event__handler_t process, bool is_pipe)
 
int perf_event__process_feature (struct perf_tool *tool, union perf_event *event, struct perf_session *session)
 
int perf_event__synthesize_attr (struct perf_tool *tool, struct perf_event_attr *attr, u32 ids, u64 *id, perf_event__handler_t process)
 
int perf_event__synthesize_attrs (struct perf_tool *tool, struct perf_session *session, perf_event__handler_t process)
 
int perf_event__synthesize_event_update_unit (struct perf_tool *tool, struct perf_evsel *evsel, perf_event__handler_t process)
 
int perf_event__synthesize_event_update_scale (struct perf_tool *tool, struct perf_evsel *evsel, perf_event__handler_t process)
 
int perf_event__synthesize_event_update_name (struct perf_tool *tool, struct perf_evsel *evsel, perf_event__handler_t process)
 
int perf_event__synthesize_event_update_cpus (struct perf_tool *tool, struct perf_evsel *evsel, perf_event__handler_t process)
 
int perf_event__process_attr (struct perf_tool *tool, union perf_event *event, struct perf_evlist **pevlist)
 
int perf_event__process_event_update (struct perf_tool *tool, union perf_event *event, struct perf_evlist **pevlist)
 
size_t perf_event__fprintf_event_update (union perf_event *event, FILE *fp)
 
int perf_event__synthesize_tracing_data (struct perf_tool *tool, int fd, struct perf_evlist *evlist, perf_event__handler_t process)
 
int perf_event__process_tracing_data (struct perf_tool *tool, union perf_event *event, struct perf_session *session)
 
int perf_event__synthesize_build_id (struct perf_tool *tool, struct dso *pos, u16 misc, perf_event__handler_t process, struct machine *machine)
 
int perf_event__process_build_id (struct perf_tool *tool, union perf_event *event, struct perf_session *session)
 
bool is_perf_magic (u64 magic)
 
int do_write (struct feat_fd *fd, const void *buf, size_t size)
 
int write_padded (struct feat_fd *fd, const void *bf, size_t count, size_t count_aligned)
 
int get_cpuid (char *buffer, size_t sz)
 
char * get_cpuid_str (struct perf_pmu *pmu __maybe_unused)
 
int strcmp_cpuid_str (const char *s1, const char *s2)
 

Macro Definition Documentation

◆ NAME_ALIGN

#define NAME_ALIGN   64

Definition at line 163 of file header.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
HEADER_RESERVED 
HEADER_FIRST_FEATURE 
HEADER_TRACING_DATA 
HEADER_BUILD_ID 
HEADER_HOSTNAME 
HEADER_OSRELEASE 
HEADER_VERSION 
HEADER_ARCH 
HEADER_NRCPUS 
HEADER_CPUDESC 
HEADER_CPUID 
HEADER_TOTAL_MEM 
HEADER_CMDLINE 
HEADER_EVENT_DESC 
HEADER_CPU_TOPOLOGY 
HEADER_NUMA_TOPOLOGY 
HEADER_BRANCH_STACK 
HEADER_PMU_MAPPINGS 
HEADER_GROUP_DESC 
HEADER_AUXTRACE 
HEADER_STAT 
HEADER_CACHE 
HEADER_SAMPLE_TIME 
HEADER_MEM_TOPOLOGY 
HEADER_LAST_FEATURE 
HEADER_FEAT_BITS 

Definition at line 14 of file header.h.

◆ perf_header_version

Enumerator
PERF_HEADER_VERSION_1 
PERF_HEADER_VERSION_2 

Definition at line 44 of file header.h.

Function Documentation

◆ do_write()

int do_write ( struct feat_fd fd,
const void *  buf,
size_t  size 
)

Definition at line 129 of file header.c.

Here is the call graph for this function:

◆ get_cpuid()

int get_cpuid ( char *  buffer,
size_t  sz 
)

Definition at line 20 of file header.c.

Here is the call graph for this function:

◆ get_cpuid_str()

char* get_cpuid_str ( struct perf_pmu *pmu  __maybe_unused)

Definition at line 38 of file header.c.

Here is the call graph for this function:

◆ is_perf_magic()

bool is_perf_magic ( u64  magic)

Definition at line 2967 of file header.c.

◆ perf_event__fprintf_event_update()

size_t perf_event__fprintf_event_update ( union perf_event event,
FILE *  fp 
)

Definition at line 3595 of file header.c.

Here is the call graph for this function:

◆ perf_event__process_attr()

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

◆ perf_event__process_build_id()

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

◆ perf_event__process_event_update()

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

◆ perf_event__process_feature()

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

◆ perf_event__process_tracing_data()

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

◆ perf_event__synthesize_attr()

int perf_event__synthesize_attr ( struct perf_tool tool,
struct perf_event_attr *  attr,
u32  ids,
u64 *  id,
perf_event__handler_t  process 
)

Definition at line 3348 of file header.c.

Here is the call graph for this function:

◆ perf_event__synthesize_attrs()

int perf_event__synthesize_attrs ( struct perf_tool tool,
struct perf_session session,
perf_event__handler_t  process 
)

Definition at line 3634 of file header.c.

Here is the call graph for this function:

◆ perf_event__synthesize_build_id()

int perf_event__synthesize_build_id ( struct perf_tool tool,
struct dso pos,
u16  misc,
perf_event__handler_t  process,
struct machine machine 
)

Definition at line 3894 of file header.c.

Here is the call graph for this function:

◆ perf_event__synthesize_event_update_cpus()

int perf_event__synthesize_event_update_cpus ( struct perf_tool tool,
struct perf_evsel evsel,
perf_event__handler_t  process 
)

Definition at line 3565 of file header.c.

Here is the call graph for this function:

◆ perf_event__synthesize_event_update_name()

int perf_event__synthesize_event_update_name ( struct perf_tool tool,
struct perf_evsel evsel,
perf_event__handler_t  process 
)

Definition at line 3546 of file header.c.

Here is the call graph for this function:

◆ perf_event__synthesize_event_update_scale()

int perf_event__synthesize_event_update_scale ( struct perf_tool tool,
struct perf_evsel evsel,
perf_event__handler_t  process 
)

Definition at line 3526 of file header.c.

Here is the call graph for this function:

◆ perf_event__synthesize_event_update_unit()

int perf_event__synthesize_event_update_unit ( struct perf_tool tool,
struct perf_evsel evsel,
perf_event__handler_t  process 
)

Definition at line 3507 of file header.c.

Here is the call graph for this function:

◆ perf_event__synthesize_extra_attr()

int perf_event__synthesize_extra_attr ( struct perf_tool tool,
struct perf_evlist evsel_list,
perf_event__handler_t  process,
bool  is_pipe 
)

Definition at line 3663 of file header.c.

Here is the call graph for this function:

◆ perf_event__synthesize_features()

int perf_event__synthesize_features ( struct perf_tool tool,
struct perf_session session,
struct perf_evlist evlist,
perf_event__handler_t  process 
)

Definition at line 3382 of file header.c.

Here is the call graph for this function:

◆ perf_event__synthesize_tracing_data()

int perf_event__synthesize_tracing_data ( struct perf_tool tool,
int  fd,
struct perf_evlist evlist,
perf_event__handler_t  process 
)

Definition at line 3805 of file header.c.

Here is the call graph for this function:

◆ perf_file_header__read()

int perf_file_header__read ( struct perf_file_header header,
struct perf_header ph,
int  fd 
)

Definition at line 3012 of file header.c.

Here is the call graph for this function:

◆ perf_header__clear_feat()

void perf_header__clear_feat ( struct perf_header header,
int  feat 
)

Definition at line 81 of file header.c.

◆ perf_header__fprintf_info()

int perf_header__fprintf_info ( struct perf_session s,
FILE *  fp,
bool  full 
)

Definition at line 2628 of file header.c.

Here is the call graph for this function:

◆ perf_header__has_feat()

bool perf_header__has_feat ( const struct perf_header header,
int  feat 
)

Definition at line 86 of file header.c.

◆ perf_header__process_sections()

int perf_header__process_sections ( struct perf_header header,
int  fd,
void *  data,
int(*)(struct perf_file_section *section, struct perf_header *ph, int feat, int fd, void *data)  process 
)

Definition at line 2856 of file header.c.

Here is the call graph for this function:

◆ perf_header__set_cmdline()

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

◆ perf_header__set_feat()

void perf_header__set_feat ( struct perf_header header,
int  feat 
)

Definition at line 76 of file header.c.

◆ perf_header__write_pipe()

int perf_header__write_pipe ( int  fd)

Definition at line 2743 of file header.c.

Here is the call graph for this function:

◆ perf_session__read_header()

int perf_session__read_header ( struct perf_session session)

Definition at line 3247 of file header.c.

Here is the call graph for this function:

◆ perf_session__write_header()

int perf_session__write_header ( struct perf_session session,
struct perf_evlist evlist,
int  fd,
bool  at_exit 
)

Definition at line 2765 of file header.c.

Here is the call graph for this function:

◆ strcmp_cpuid_str()

int strcmp_cpuid_str ( const char *  s1,
const char *  s2 
)

Definition at line 584 of file pmu.c.

◆ write_padded()

int write_padded ( struct feat_fd fd,
const void *  bf,
size_t  count,
size_t  count_aligned 
)

Definition at line 156 of file header.c.

Here is the call graph for this function: