Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
header.c File Reference
#include "util.h"
#include <sys/types.h>
#include <byteswap.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <linux/list.h>
#include <linux/kernel.h>
#include <linux/bitops.h>
#include <sys/utsname.h>
#include "evlist.h"
#include "evsel.h"
#include "header.h"
#include "../perf.h"
#include "trace-event.h"
#include "session.h"
#include "symbol.h"
#include "debug.h"
#include "cpumap.h"
#include "pmu.h"
#include "vdso.h"
#include "strbuf.h"

Go to the source code of this file.

Data Structures

struct  perf_file_attr
 
struct  cpu_topo
 
struct  feature_ops
 
struct  header_print_data
 

Macros

#define _FILE_OFFSET_BITS   64
 
#define PERF_MAGIC   __perf_magic2
 
#define NAME_ALIGN   64
 
#define dsos__for_each_with_build_id(pos, head)
 
#define CPUINFO_PROC   NULL
 
#define CORE_SIB_FMT   "/sys/devices/system/cpu/cpu%d/topology/core_siblings_list"
 
#define THRD_SIB_FMT   "/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list"
 
#define FEAT_OPA(n, func)   [n] = { .name = #n, .write = write_##func, .print = print_##func }
 
#define FEAT_OPP(n, func)
 
#define FEAT_OPF(n, func)
 
#define print_tracing_data   NULL
 
#define print_build_id   NULL
 
#define PERF_PIPE_HDR_VER0   16
 

Functions

int perf_header__push_event (u64 id, const char *name)
 
charperf_header__find_event (u64 id)
 
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 build_id_cache__add_s (const char *sbuild_id, const char *debugdir, const char *name, bool is_kallsyms, bool is_vdso)
 
int build_id_cache__remove_s (const char *sbuild_id, const char *debugdir)
 
int __attribute__ ((weak))
 
int perf_header__fprintf_info (struct perf_session *session, FILE *fp, bool full)
 
int perf_header__write_pipe (int fd)
 
int perf_session__write_header (struct perf_session *session, struct perf_evlist *evlist, int fd, bool at_exit)
 
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_file_header__read (struct perf_file_header *header, struct perf_header *ph, int fd)
 
int perf_session__read_header (struct perf_session *session, int fd)
 
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__process_attr (union perf_event *event, struct perf_evlist **pevlist)
 
int perf_event__synthesize_event_type (struct perf_tool *tool, u64 event_id, char *name, perf_event__handler_t process, struct machine *machine)
 
int perf_event__synthesize_event_types (struct perf_tool *tool, perf_event__handler_t process, struct machine *machine)
 
int perf_event__process_event_type (struct perf_tool *tool __maybe_unused, union perf_event *event)
 
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 (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 __maybe_unused, union perf_event *event, struct perf_session *session)
 
void disable_buildid_cache (void)
 

Macro Definition Documentation

#define _FILE_OFFSET_BITS   64

Definition at line 1 of file header.c.

#define CORE_SIB_FMT   "/sys/devices/system/cpu/cpu%d/topology/core_siblings_list"

Definition at line 733 of file header.c.

#define CPUINFO_PROC   NULL
#define dsos__for_each_with_build_id (   pos,
  head 
)
Value:
if (!pos->has_build_id) \
continue; \
else

Definition at line 206 of file header.c.

#define FEAT_OPA (   n,
  func 
)    [n] = { .name = #n, .write = write_##func, .print = print_##func }

Definition at line 1960 of file header.c.

#define FEAT_OPF (   n,
  func 
)
Value:
[n] = { .name = #n, .write = write_##func, .print = print_##func, \
.process = process_##func, .full_only = true }

Definition at line 1965 of file header.c.

#define FEAT_OPP (   n,
  func 
)
Value:
[n] = { .name = #n, .write = write_##func, .print = print_##func, \
.process = process_##func }

Definition at line 1962 of file header.c.

#define NAME_ALIGN   64

Definition at line 114 of file header.c.

#define PERF_MAGIC   __perf_magic2

Definition at line 77 of file header.c.

#define PERF_PIPE_HDR_VER0   16

Definition at line 2312 of file header.c.

#define print_build_id   NULL

Definition at line 1971 of file header.c.

#define print_tracing_data   NULL

Definition at line 1970 of file header.c.

#define THRD_SIB_FMT   "/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list"

Definition at line 735 of file header.c.

Function Documentation

int __attribute__ ( (weak)  )
read

read_persistent_clock - Return time from the persistent clock.

Weak dummy function for arches that do not yet support it. Reads the time from the battery backed persistent clock. Returns a timespec with tv_sec=0 and tv_nsec=0 if unsupported.

XXX - Do be sure to remove it once all arches implement it.

read_boot_clock - Return time of the system start.

Weak dummy function for arches that do not yet support it. Function to read the exact time the system has been started. Returns a timespec with tv_sec=0 and tv_nsec=0 if unsupported.

XXX - Do be sure to remove it once all arches implement it.

__iowrite32_copy - copy data to MMIO space, in 32-bit units : destination, in MMIO space (must be 32-bit aligned) : source (must be 32-bit aligned) : number of 32-bit quantities to copy

Copy data from kernel space to MMIO space, in units of 32 bits at a time. Order of access is not guaranteed, nor is a memory barrier performed afterwards.

__iowrite64_copy - copy data to MMIO space, in 64-bit or 32-bit units : destination, in MMIO space (must be 64-bit aligned) : source (must be 64-bit aligned) : number of 64-bit quantities to copy

Copy data from kernel space to MMIO space, in units of 32 or 64 bits at a time. Order of access is not guaranteed, nor is a memory barrier performed afterwards.

get_user_pages_fast() - pin user pages in memory : starting user address : number of pages from start to pin : whether pages will be written to : array that receives pointers to the pages pinned. Should be at least nr_pages long.

Returns number of pages pinned. This may be fewer than the number requested. If nr_pages is 0 or negative, returns 0. If no pages were pinned, returns -errno.

get_user_pages_fast provides equivalent functionality to get_user_pages, operating on current and current->mm, with force=0 and vma=NULL. However unlike get_user_pages, it must be called without mmap_sem held.

get_user_pages_fast may take mmap_sem and page table locks, so no assumptions can be made about lack of locking. get_user_pages_fast is to be implemented in a way that is advantageous (vs get_user_pages()) when the user memory area is already faulted in and present in ptes. However if the pages have to be faulted in, it may turn out to be slightly slower so callers need to carefully consider what to use. On many architectures, get_user_pages_fast simply falls back to get_user_pages.

Definition at line 1078 of file header.c.

int build_id_cache__add_s ( const char sbuild_id,
const char debugdir,
const char name,
bool  is_kallsyms,
bool  is_vdso 
)

Definition at line 303 of file header.c.

int build_id_cache__remove_s ( const char sbuild_id,
const char debugdir 
)

Definition at line 372 of file header.c.

void disable_buildid_cache ( void  )

Definition at line 2959 of file header.c.

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

Definition at line 2748 of file header.c.

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

Definition at line 2949 of file header.c.

int perf_event__process_event_type ( struct perf_tool *tool  __maybe_unused,
union perf_event event 
)

Definition at line 2833 of file header.c.

int perf_event__process_tracing_data ( union perf_event event,
struct perf_session session 
)

Definition at line 2889 of file header.c.

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 2695 of file header.c.

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

Definition at line 2729 of file header.c.

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 2921 of file header.c.

int perf_event__synthesize_event_type ( struct perf_tool tool,
u64  event_id,
char name,
perf_event__handler_t  process,
struct machine machine 
)

Definition at line 2785 of file header.c.

int perf_event__synthesize_event_types ( struct perf_tool tool,
perf_event__handler_t  process,
struct machine machine 
)

Definition at line 2811 of file header.c.

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

Definition at line 2843 of file header.c.

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

Definition at line 2378 of file header.c.

void perf_header__clear_feat ( struct perf_header header,
int  feat 
)

Definition at line 89 of file header.c.

char* perf_header__find_event ( u64  id)

Definition at line 54 of file header.c.

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

Definition at line 2024 of file header.c.

bool perf_header__has_feat ( const struct perf_header header,
int  feat 
)

Definition at line 94 of file header.c.

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 2235 of file header.c.

int perf_header__push_event ( u64  id,
const char name 
)

Definition at line 35 of file header.c.

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

Definition at line 176 of file header.c.

void perf_header__set_feat ( struct perf_header header,
int  feat 
)

Definition at line 84 of file header.c.

int perf_header__write_pipe ( int  fd)

Definition at line 2105 of file header.c.

int perf_session__read_header ( struct perf_session session,
int  fd 
)

Definition at line 2597 of file header.c.

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

Definition at line 2124 of file header.c.