FFmpeg
Macros | Functions
macos_kperf.c File Reference
#include "avassert.h"
#include "macos_kperf.h"
#include "thread.h"
#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>

Go to the source code of this file.

Macros

#define KPERF_LIST
 
#define F(ret, name, ...)
 
#define CFGWORD_EL0A32EN_MASK   (0x10000)
 
#define CFGWORD_EL0A64EN_MASK   (0x20000)
 
#define CFGWORD_EL1EN_MASK   (0x40000)
 
#define CFGWORD_EL3EN_MASK   (0x80000)
 
#define CFGWORD_ALLMODES_MASK   (0xf0000)
 
#define CPMU_NONE   0
 
#define CPMU_CORE_CYCLE   0x02
 
#define CPMU_INST_A64   0x8c
 
#define CPMU_INST_BRANCH   0x8d
 
#define CPMU_SYNC_DC_LOAD_MISS   0xbf
 
#define CPMU_SYNC_DC_STORE_MISS   0xc0
 
#define CPMU_SYNC_DTLB_MISS   0xc1
 
#define CPMU_SYNC_ST_HIT_YNGR_LD   0xc4
 
#define CPMU_SYNC_BR_ANY_MISP   0xcb
 
#define CPMU_FED_IC_MISS_DEM   0xd3
 
#define CPMU_FED_ITLB_MISS   0xd4
 
#define KPC_CLASS_FIXED_MASK   (1 << 0)
 
#define KPC_CLASS_CONFIGURABLE_MASK   (1 << 1)
 
#define KPC_CLASS_POWER_MASK   (1 << 2)
 
#define KPC_CLASS_RAWPMU_MASK   (1 << 3)
 
#define KPC_MAX_COUNTERS   32
 
#define CONFIG_COUNT   8
 
#define KPC_MASK   (KPC_CLASS_CONFIGURABLE_MASK | KPC_CLASS_FIXED_MASK)
 
#define F(ret, name, ...)   av_assert0(name = (name##proc *)(dlsym(kperf, #name)));
 

Functions

static void kperf_init (void)
 
void ff_kperf_init (void)
 
uint64_t ff_kperf_cycles (void)
 

Macro Definition Documentation

◆ KPERF_LIST

#define KPERF_LIST
Value:
F(int, kpc_get_counting, void) \
F(int, kpc_force_all_ctrs_set, int) \
F(int, kpc_set_counting, uint32_t) \
F(int, kpc_set_thread_counting, uint32_t) \
F(int, kpc_set_config, uint32_t, void *) \
F(int, kpc_get_config, uint32_t, void *) \
F(int, kpc_set_period, uint32_t, void *) \
F(int, kpc_get_period, uint32_t, void *) \
F(uint32_t, kpc_get_counter_count, uint32_t) \
F(uint32_t, kpc_get_config_count, uint32_t) \
F(int, kperf_sample_get, int *) \
F(int, kpc_get_thread_counters, int, unsigned int, void *)

Definition at line 27 of file macos_kperf.c.

◆ F [1/2]

#define F (   ret,
  name,
  ... 
)
Value:
typedef ret name##proc(__VA_ARGS__); \
static name##proc *name = NULL;

Definition at line 41 of file macos_kperf.c.

◆ CFGWORD_EL0A32EN_MASK

#define CFGWORD_EL0A32EN_MASK   (0x10000)

Definition at line 47 of file macos_kperf.c.

◆ CFGWORD_EL0A64EN_MASK

#define CFGWORD_EL0A64EN_MASK   (0x20000)

Definition at line 48 of file macos_kperf.c.

◆ CFGWORD_EL1EN_MASK

#define CFGWORD_EL1EN_MASK   (0x40000)

Definition at line 49 of file macos_kperf.c.

◆ CFGWORD_EL3EN_MASK

#define CFGWORD_EL3EN_MASK   (0x80000)

Definition at line 50 of file macos_kperf.c.

◆ CFGWORD_ALLMODES_MASK

#define CFGWORD_ALLMODES_MASK   (0xf0000)

Definition at line 51 of file macos_kperf.c.

◆ CPMU_NONE

#define CPMU_NONE   0

Definition at line 53 of file macos_kperf.c.

◆ CPMU_CORE_CYCLE

#define CPMU_CORE_CYCLE   0x02

Definition at line 54 of file macos_kperf.c.

◆ CPMU_INST_A64

#define CPMU_INST_A64   0x8c

Definition at line 55 of file macos_kperf.c.

◆ CPMU_INST_BRANCH

#define CPMU_INST_BRANCH   0x8d

Definition at line 56 of file macos_kperf.c.

◆ CPMU_SYNC_DC_LOAD_MISS

#define CPMU_SYNC_DC_LOAD_MISS   0xbf

Definition at line 57 of file macos_kperf.c.

◆ CPMU_SYNC_DC_STORE_MISS

#define CPMU_SYNC_DC_STORE_MISS   0xc0

Definition at line 58 of file macos_kperf.c.

◆ CPMU_SYNC_DTLB_MISS

#define CPMU_SYNC_DTLB_MISS   0xc1

Definition at line 59 of file macos_kperf.c.

◆ CPMU_SYNC_ST_HIT_YNGR_LD

#define CPMU_SYNC_ST_HIT_YNGR_LD   0xc4

Definition at line 60 of file macos_kperf.c.

◆ CPMU_SYNC_BR_ANY_MISP

#define CPMU_SYNC_BR_ANY_MISP   0xcb

Definition at line 61 of file macos_kperf.c.

◆ CPMU_FED_IC_MISS_DEM

#define CPMU_FED_IC_MISS_DEM   0xd3

Definition at line 62 of file macos_kperf.c.

◆ CPMU_FED_ITLB_MISS

#define CPMU_FED_ITLB_MISS   0xd4

Definition at line 63 of file macos_kperf.c.

◆ KPC_CLASS_FIXED_MASK

#define KPC_CLASS_FIXED_MASK   (1 << 0)

Definition at line 65 of file macos_kperf.c.

◆ KPC_CLASS_CONFIGURABLE_MASK

#define KPC_CLASS_CONFIGURABLE_MASK   (1 << 1)

Definition at line 66 of file macos_kperf.c.

◆ KPC_CLASS_POWER_MASK

#define KPC_CLASS_POWER_MASK   (1 << 2)

Definition at line 67 of file macos_kperf.c.

◆ KPC_CLASS_RAWPMU_MASK

#define KPC_CLASS_RAWPMU_MASK   (1 << 3)

Definition at line 68 of file macos_kperf.c.

◆ KPC_MAX_COUNTERS

#define KPC_MAX_COUNTERS   32

Definition at line 70 of file macos_kperf.c.

◆ CONFIG_COUNT

#define CONFIG_COUNT   8

Definition at line 71 of file macos_kperf.c.

◆ KPC_MASK

Definition at line 72 of file macos_kperf.c.

◆ F [2/2]

#define F (   ret,
  name,
  ... 
)    av_assert0(name = (name##proc *)(dlsym(kperf, #name)));

Definition at line 41 of file macos_kperf.c.

Function Documentation

◆ kperf_init()

static void kperf_init ( void  )
static

Definition at line 74 of file macos_kperf.c.

Referenced by ff_kperf_init().

◆ ff_kperf_init()

void ff_kperf_init ( void  )

Definition at line 102 of file macos_kperf.c.

◆ ff_kperf_cycles()

uint64_t ff_kperf_cycles ( void  )

Definition at line 108 of file macos_kperf.c.

name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
F
#define F(ret, name,...)
Definition: macos_kperf.c:41
NULL
#define NULL
Definition: coverity.c:32
ret
ret
Definition: filter_design.txt:187