Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
page-types.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>
#include <stdarg.h>
#include <string.h>
#include <getopt.h>
#include <limits.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/errno.h>
#include <sys/fcntl.h>
#include <sys/mount.h>
#include <sys/statfs.h>
#include "../../include/uapi/linux/magic.h"
#include "../../include/uapi/linux/kernel-page-flags.h"

Go to the source code of this file.

Macros

#define _LARGEFILE64_SOURCE
 
#define MAX_PATH   256
 
#define _STR(x)   #x
 
#define STR(x)   _STR(x)
 
#define PM_ENTRY_BYTES   sizeof(uint64_t)
 
#define PM_STATUS_BITS   3
 
#define PM_STATUS_OFFSET   (64 - PM_STATUS_BITS)
 
#define PM_STATUS_MASK   (((1LL << PM_STATUS_BITS) - 1) << PM_STATUS_OFFSET)
 
#define PM_STATUS(nr)   (((nr) << PM_STATUS_OFFSET) & PM_STATUS_MASK)
 
#define PM_PSHIFT_BITS   6
 
#define PM_PSHIFT_OFFSET   (PM_STATUS_OFFSET - PM_PSHIFT_BITS)
 
#define PM_PSHIFT_MASK   (((1LL << PM_PSHIFT_BITS) - 1) << PM_PSHIFT_OFFSET)
 
#define PM_PSHIFT(x)   (((u64) (x) << PM_PSHIFT_OFFSET) & PM_PSHIFT_MASK)
 
#define PM_PFRAME_MASK   ((1LL << PM_PSHIFT_OFFSET) - 1)
 
#define PM_PFRAME(x)   ((x) & PM_PFRAME_MASK)
 
#define PM_PRESENT   PM_STATUS(4LL)
 
#define PM_SWAP   PM_STATUS(2LL)
 
#define KPF_BYTES   8
 
#define PROC_KPAGEFLAGS   "/proc/kpageflags"
 
#define KPF_RESERVED   32
 
#define KPF_MLOCKED   33
 
#define KPF_MAPPEDTODISK   34
 
#define KPF_PRIVATE   35
 
#define KPF_PRIVATE_2   36
 
#define KPF_OWNER_PRIVATE   37
 
#define KPF_ARCH   38
 
#define KPF_UNCACHED   39
 
#define KPF_READAHEAD   48
 
#define KPF_SLOB_FREE   49
 
#define KPF_SLUB_FROZEN   50
 
#define KPF_SLUB_DEBUG   51
 
#define KPF_ALL_BITS   ((uint64_t)~0ULL)
 
#define KPF_HACKERS_BITS   (0xffffULL << 32)
 
#define KPF_OVERLOADED_BITS   (0xffffULL << 48)
 
#define BIT(name)   (1ULL << KPF_##name)
 
#define BITS_COMPOUND   (BIT(COMPOUND_HEAD) | BIT(COMPOUND_TAIL))
 
#define MAX_ADDR_RANGES   1024
 
#define MAX_VMAS   10240
 
#define MAX_BIT_FILTERS   64
 
#define HASH_SHIFT   13
 
#define HASH_SIZE   (1 << HASH_SHIFT)
 
#define HASH_MASK   (HASH_SIZE - 1)
 
#define HASH_KEY(flags)   (flags & HASH_MASK)
 
#define ARRAY_SIZE(x)   (sizeof(x) / sizeof((x)[0]))
 
#define min_t(type, x, y)
 
#define max_t(type, x, y)
 
#define KPAGEFLAGS_BATCH   (64 << 10) /* 64k pages */
 
#define PAGEMAP_BATCH   (64 << 10)
 

Functions

int main (int argc, char *argv[])
 

Macro Definition Documentation

#define _LARGEFILE64_SOURCE

Definition at line 22 of file page-types.c.

#define _STR (   x)    #x

Definition at line 46 of file page-types.c.

#define ARRAY_SIZE (   x)    (sizeof(x) / sizeof((x)[0]))

Definition at line 199 of file page-types.c.

#define BIT (   name)    (1ULL << KPF_##name)

Definition at line 98 of file page-types.c.

#define BITS_COMPOUND   (BIT(COMPOUND_HEAD) | BIT(COMPOUND_TAIL))

Definition at line 99 of file page-types.c.

#define HASH_KEY (   flags)    (flags & HASH_MASK)

Definition at line 188 of file page-types.c.

#define HASH_MASK   (HASH_SIZE - 1)

Definition at line 187 of file page-types.c.

#define HASH_SHIFT   13

Definition at line 185 of file page-types.c.

#define HASH_SIZE   (1 << HASH_SHIFT)

Definition at line 186 of file page-types.c.

#define KPAGEFLAGS_BATCH   (64 << 10) /* 64k pages */

Definition at line 640 of file page-types.c.

#define KPF_ALL_BITS   ((uint64_t)~0ULL)

Definition at line 95 of file page-types.c.

#define KPF_ARCH   38

Definition at line 84 of file page-types.c.

#define KPF_BYTES   8

Definition at line 74 of file page-types.c.

#define KPF_HACKERS_BITS   (0xffffULL << 32)

Definition at line 96 of file page-types.c.

#define KPF_MAPPEDTODISK   34

Definition at line 80 of file page-types.c.

#define KPF_MLOCKED   33

Definition at line 79 of file page-types.c.

#define KPF_OVERLOADED_BITS   (0xffffULL << 48)

Definition at line 97 of file page-types.c.

#define KPF_OWNER_PRIVATE   37

Definition at line 83 of file page-types.c.

#define KPF_PRIVATE   35

Definition at line 81 of file page-types.c.

#define KPF_PRIVATE_2   36

Definition at line 82 of file page-types.c.

#define KPF_READAHEAD   48

Definition at line 90 of file page-types.c.

#define KPF_RESERVED   32

Definition at line 78 of file page-types.c.

#define KPF_SLOB_FREE   49

Definition at line 91 of file page-types.c.

#define KPF_SLUB_DEBUG   51

Definition at line 93 of file page-types.c.

#define KPF_SLUB_FROZEN   50

Definition at line 92 of file page-types.c.

#define KPF_UNCACHED   39

Definition at line 85 of file page-types.c.

#define MAX_ADDR_RANGES   1024

Definition at line 158 of file page-types.c.

#define MAX_BIT_FILTERS   64

Definition at line 168 of file page-types.c.

#define MAX_PATH   256

Definition at line 42 of file page-types.c.

#define max_t (   type,
  x,
  y 
)
Value:
({ \
type __max1 = (x); \
type __max2 = (y); \
__max1 > __max2 ? __max1 : __max2; })

Definition at line 206 of file page-types.c.

#define MAX_VMAS   10240

Definition at line 163 of file page-types.c.

#define min_t (   type,
  x,
  y 
)
Value:
({ \
type __min1 = (x); \
type __min2 = (y); \
__min1 < __min2 ? __min1 : __min2; })

Definition at line 201 of file page-types.c.

#define PAGEMAP_BATCH   (64 << 10)

Definition at line 664 of file page-types.c.

#define PM_ENTRY_BYTES   sizeof(uint64_t)

Definition at line 54 of file page-types.c.

#define PM_PFRAME (   x)    ((x) & PM_PFRAME_MASK)

Definition at line 64 of file page-types.c.

#define PM_PFRAME_MASK   ((1LL << PM_PSHIFT_OFFSET) - 1)

Definition at line 63 of file page-types.c.

#define PM_PRESENT   PM_STATUS(4LL)

Definition at line 66 of file page-types.c.

#define PM_PSHIFT (   x)    (((u64) (x) << PM_PSHIFT_OFFSET) & PM_PSHIFT_MASK)

Definition at line 62 of file page-types.c.

#define PM_PSHIFT_BITS   6

Definition at line 59 of file page-types.c.

#define PM_PSHIFT_MASK   (((1LL << PM_PSHIFT_BITS) - 1) << PM_PSHIFT_OFFSET)

Definition at line 61 of file page-types.c.

#define PM_PSHIFT_OFFSET   (PM_STATUS_OFFSET - PM_PSHIFT_BITS)

Definition at line 60 of file page-types.c.

#define PM_STATUS (   nr)    (((nr) << PM_STATUS_OFFSET) & PM_STATUS_MASK)

Definition at line 58 of file page-types.c.

#define PM_STATUS_BITS   3

Definition at line 55 of file page-types.c.

#define PM_STATUS_MASK   (((1LL << PM_STATUS_BITS) - 1) << PM_STATUS_OFFSET)

Definition at line 57 of file page-types.c.

#define PM_STATUS_OFFSET   (64 - PM_STATUS_BITS)

Definition at line 56 of file page-types.c.

#define PM_SWAP   PM_STATUS(2LL)

Definition at line 67 of file page-types.c.

#define PROC_KPAGEFLAGS   "/proc/kpageflags"

Definition at line 75 of file page-types.c.

#define STR (   x)    _STR(x)

Definition at line 47 of file page-types.c.

Function Documentation

int main ( int  argc,
char argv[] 
)

Definition at line 1002 of file page-types.c.