#include <assert.h>
#include <errno.h>
#include <sys/mman.h>
#include <string.h>
#include <unistd.h>
#include <linux/perf_event.h>
#include <linux/version.h>
#include <hpcrun/messages/messages.h>
#include "perf_mmap.h"
#include "perf-util.h"
#include "perf_barrier.h"
Go to the source code of this file.
|
static void | skip_perf_data (pe_mmap_t *current_perf_mmap, size_t sz) __attribute__((unused)) |
|
static u64 | perf_mmap_read_head (pe_mmap_t *hdr) |
|
static int | num_of_more_perf_data (pe_mmap_t *hdr) |
|
static int | has_more_perf_data (pe_mmap_t *hdr) |
|
static int | perf_read (pe_mmap_t *current_perf_mmap, void *buf, size_t bytes_wanted) |
|
static int | perf_read_header (pe_mmap_t *current_perf_mmap, pe_header_t *hdr) |
|
static int | perf_read_u32 (pe_mmap_t *current_perf_mmap, u32 *val) |
|
static int | perf_read_u64 (pe_mmap_t *current_perf_mmap, u64 *val) |
|
static void | handle_struct_read_format (pe_mmap_t *perf_mmap, int read_format) |
|
static int | perf_sample_callchain (pe_mmap_t *current_perf_mmap, perf_mmap_data_t *mmap_data) |
|
static int | parse_buffer (int sample_type, pe_mmap_t *current_perf_mmap, struct perf_event_attr *attr, perf_mmap_data_t *mmap_info) |
|
int | read_perf_buffer (pe_mmap_t *current_perf_mmap, struct perf_event_attr *attr, perf_mmap_data_t *mmap_info) |
|
pe_mmap_t * | set_mmap (int perf_fd) |
|
void | perf_unmmap (pe_mmap_t *mmap) |
|
void | perf_mmap_init () |
|
◆ MMAP_OFFSET_0
◆ PERF_DATA_PAGE_EXP
#define PERF_DATA_PAGE_EXP 1 |
◆ PERF_DATA_PAGES
◆ PERF_MMAP_SIZE
◆ PERF_TAIL_MASK
◆ handle_struct_read_format()
static void handle_struct_read_format |
( |
pe_mmap_t * |
perf_mmap, |
|
|
int |
read_format |
|
) |
| |
|
static |
◆ has_more_perf_data()
static int has_more_perf_data |
( |
pe_mmap_t * |
hdr | ) |
|
|
static |
◆ num_of_more_perf_data()
static int num_of_more_perf_data |
( |
pe_mmap_t * |
hdr | ) |
|
|
static |
◆ parse_buffer()
static int parse_buffer |
( |
int |
sample_type, |
|
|
pe_mmap_t * |
current_perf_mmap, |
|
|
struct perf_event_attr * |
attr, |
|
|
perf_mmap_data_t * |
mmap_info |
|
) |
| |
|
static |
parse mmapped buffer and copy the values into perf_mmap_data_t mmap_info. we assume mmap_info is already initialized. returns the number of read event attributes
Definition at line 319 of file perf_mmap.c.
◆ perf_mmap_init()
initialize perf_mmap. caller needs to call this in the beginning before calling any API.
Definition at line 537 of file perf_mmap.c.
◆ perf_mmap_read_head()
◆ perf_read()
static int perf_read |
( |
pe_mmap_t * |
current_perf_mmap, |
|
|
void * |
buf, |
|
|
size_t |
bytes_wanted |
|
) |
| |
|
static |
◆ perf_read_header()
◆ perf_read_u32()
static int perf_read_u32 |
( |
pe_mmap_t * |
current_perf_mmap, |
|
|
u32 * |
val |
|
) |
| |
|
inlinestatic |
◆ perf_read_u64()
static int perf_read_u64 |
( |
pe_mmap_t * |
current_perf_mmap, |
|
|
u64 * |
val |
|
) |
| |
|
inlinestatic |
◆ perf_sample_callchain()
◆ perf_unmmap()
◆ read_perf_buffer()
◆ set_mmap()
◆ skip_perf_data()
static void skip_perf_data |
( |
pe_mmap_t * |
current_perf_mmap, |
|
|
size_t |
sz |
|
) |
| |
|
static |
◆ pagesize
◆ tail_mask