Linux Perf
header.c File Reference
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <linux/stringify.h>
#include "header.h"
#include "util.h"
Include dependency graph for header.c:

Go to the source code of this file.

Macros

#define mfspr(rn)
 
#define SPRN_PVR   0x11F /* Processor Version Register */
 
#define PVR_VER(pvr)   (((pvr) >> 16) & 0xFFFF) /* Version field */
 
#define PVR_REV(pvr)   (((pvr) >> 0) & 0xFFFF) /* Revison field */
 

Functions

int get_cpuid (char *buffer, size_t sz)
 
char * get_cpuid_str (struct perf_pmu *pmu __maybe_unused)
 

Macro Definition Documentation

◆ mfspr

#define mfspr (   rn)
Value:
({unsigned long rval; \
asm volatile("mfspr %0," __stringify(rn) \
: "=r" (rval)); rval; })

Definition at line 11 of file header.c.

◆ PVR_REV

#define PVR_REV (   pvr)    (((pvr) >> 0) & 0xFFFF) /* Revison field */

Definition at line 17 of file header.c.

◆ PVR_VER

#define PVR_VER (   pvr)    (((pvr) >> 16) & 0xFFFF) /* Version field */

Definition at line 16 of file header.c.

◆ SPRN_PVR

#define SPRN_PVR   0x11F /* Processor Version Register */

Definition at line 15 of file header.c.

Function Documentation

◆ get_cpuid()

int get_cpuid ( char *  buffer,
size_t  sz 
)

Definition at line 20 of file header.c.

◆ get_cpuid_str()

char* get_cpuid_str ( struct perf_pmu *pmu  __maybe_unused)

Definition at line 38 of file header.c.