Linux Perf
builtin-kmem.c File Reference
#include "builtin.h"
#include "perf.h"
#include "util/evlist.h"
#include "util/evsel.h"
#include "util/util.h"
#include "util/config.h"
#include "util/symbol.h"
#include "util/thread.h"
#include "util/header.h"
#include "util/session.h"
#include "util/tool.h"
#include "util/callchain.h"
#include "util/time-utils.h"
#include <subcmd/parse-options.h>
#include "util/trace-event.h"
#include "util/data.h"
#include "util/cpumap.h"
#include "util/debug.h"
#include <linux/kernel.h>
#include <linux/rbtree.h>
#include <linux/string.h>
#include <errno.h>
#include <inttypes.h>
#include <locale.h>
#include <regex.h>
#include "sane_ctype.h"
Include dependency graph for builtin-kmem.c:

Go to the source code of this file.

Classes

struct  alloc_stat
 
struct  page_stat
 
struct  alloc_func
 
struct  sort_dimension
 
struct  gfp_flag
 

Macros

#define MAX_MIGRATE_TYPES   6
 
#define MAX_PAGE_ORDER   11
 

Typedefs

typedef int(* sort_fn_t) (void *, void *)
 
typedef int(* tracepoint_handler) (struct perf_evsel *evsel, struct perf_sample *sample)
 

Enumerations

enum  { KMEM_SLAB, KMEM_PAGE }
 

Functions

static int insert_alloc_stat (unsigned long call_site, unsigned long ptr, int bytes_req, int bytes_alloc, int cpu)
 
static int insert_caller_stat (unsigned long call_site, int bytes_req, int bytes_alloc)
 
static int perf_evsel__process_alloc_event (struct perf_evsel *evsel, struct perf_sample *sample)
 
static int perf_evsel__process_alloc_node_event (struct perf_evsel *evsel, struct perf_sample *sample)
 
static int ptr_cmp (void *, void *)
 
static int slab_callsite_cmp (void *, void *)
 
static struct alloc_statsearch_alloc_stat (unsigned long ptr, unsigned long call_site, struct rb_root *root, sort_fn_t sort_fn)
 
static int perf_evsel__process_free_event (struct perf_evsel *evsel, struct perf_sample *sample)
 
static int funcmp (const void *a, const void *b)
 
static int callcmp (const void *a, const void *b)
 
static int build_alloc_func_list (void)
 
static u64 find_callsite (struct perf_evsel *evsel, struct perf_sample *sample)
 
static LIST_HEAD (page_alloc_sort_input)
 
static LIST_HEAD (page_caller_sort_input)
 
static struct page_stat__page_stat__findnew_page (struct page_stat *pstat, bool create)
 
static struct page_statpage_stat__find_page (struct page_stat *pstat)
 
static struct page_statpage_stat__findnew_page (struct page_stat *pstat)
 
static struct page_stat__page_stat__findnew_alloc (struct page_stat *pstat, bool create)
 
static struct page_statpage_stat__find_alloc (struct page_stat *pstat)
 
static struct page_statpage_stat__findnew_alloc (struct page_stat *pstat)
 
static struct page_stat__page_stat__findnew_caller (struct page_stat *pstat, bool create)
 
static struct page_statpage_stat__find_caller (struct page_stat *pstat)
 
static struct page_statpage_stat__findnew_caller (struct page_stat *pstat)
 
static bool valid_page (u64 pfn_or_page)
 
static int gfpcmp (const void *a, const void *b)
 
static char * compact_gfp_flags (char *gfp_flags)
 
static char * compact_gfp_string (unsigned long gfp_flags)
 
static int parse_gfp_flags (struct perf_evsel *evsel, struct perf_sample *sample, unsigned int gfp_flags)
 
static int perf_evsel__process_page_alloc_event (struct perf_evsel *evsel, struct perf_sample *sample)
 
static int perf_evsel__process_page_free_event (struct perf_evsel *evsel, struct perf_sample *sample)
 
static bool perf_kmem__skip_sample (struct perf_sample *sample)
 
static int process_sample_event (struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel, struct machine *machine)
 
static double fragmentation (unsigned long n_req, unsigned long n_alloc)
 
static void __print_slab_result (struct rb_root *root, struct perf_session *session, int n_lines, int is_caller)
 
static void __print_page_alloc_result (struct perf_session *session, int n_lines)
 
static void __print_page_caller_result (struct perf_session *session, int n_lines)
 
static void print_gfp_flags (void)
 
static void print_slab_summary (void)
 
static void print_page_summary (void)
 
static void print_slab_result (struct perf_session *session)
 
static void print_page_result (struct perf_session *session)
 
static void print_result (struct perf_session *session)
 
static LIST_HEAD (slab_caller_sort)
 
static LIST_HEAD (slab_alloc_sort)
 
static LIST_HEAD (page_caller_sort)
 
static LIST_HEAD (page_alloc_sort)
 
static void sort_slab_insert (struct rb_root *root, struct alloc_stat *data, struct list_head *sort_list)
 
static void __sort_slab_result (struct rb_root *root, struct rb_root *root_sorted, struct list_head *sort_list)
 
static void sort_page_insert (struct rb_root *root, struct page_stat *data, struct list_head *sort_list)
 
static void __sort_page_result (struct rb_root *root, struct rb_root *root_sorted, struct list_head *sort_list)
 
static void sort_result (void)
 
static int __cmd_kmem (struct perf_session *session)
 
static int hit_cmp (void *a, void *b)
 
static int bytes_cmp (void *a, void *b)
 
static int frag_cmp (void *a, void *b)
 
static int pingpong_cmp (void *a, void *b)
 
static int page_cmp (void *a, void *b)
 
static int page_callsite_cmp (void *a, void *b)
 
static int page_hit_cmp (void *a, void *b)
 
static int page_bytes_cmp (void *a, void *b)
 
static int page_order_cmp (void *a, void *b)
 
static int migrate_type_cmp (void *a, void *b)
 
static int gfp_flags_cmp (void *a, void *b)
 
static int slab_sort_dimension__add (const char *tok, struct list_head *list)
 
static int page_sort_dimension__add (const char *tok, struct list_head *list)
 
static int setup_slab_sorting (struct list_head *sort_list, const char *arg)
 
static int setup_page_sorting (struct list_head *sort_list, const char *arg)
 
static int parse_sort_opt (const struct option *opt __maybe_unused, const char *arg, int unset __maybe_unused)
 
static int parse_caller_opt (const struct option *opt __maybe_unused, const char *arg __maybe_unused, int unset __maybe_unused)
 
static int parse_alloc_opt (const struct option *opt __maybe_unused, const char *arg __maybe_unused, int unset __maybe_unused)
 
static int parse_slab_opt (const struct option *opt __maybe_unused, const char *arg __maybe_unused, int unset __maybe_unused)
 
static int parse_page_opt (const struct option *opt __maybe_unused, const char *arg __maybe_unused, int unset __maybe_unused)
 
static int parse_line_opt (const struct option *opt __maybe_unused, const char *arg, int unset __maybe_unused)
 
static int __cmd_record (int argc, const char **argv)
 
static int kmem_config (const char *var, const char *value, void *cb __maybe_unused)
 
int cmd_kmem (int argc, const char **argv)
 

Variables

static int kmem_slab
 
static int kmem_page
 
static long kmem_page_size
 
static enum { ... }  kmem_default = KMEM_SLAB
 
static int alloc_flag
 
static int caller_flag
 
static int alloc_lines = -1
 
static int caller_lines = -1
 
static bool raw_ip
 
static struct rb_root root_alloc_stat
 
static struct rb_root root_alloc_sorted
 
static struct rb_root root_caller_stat
 
static struct rb_root root_caller_sorted
 
static unsigned long total_requested
 
static unsigned long total_allocated
 
static unsigned long total_freed
 
static unsigned long nr_allocs
 
static unsigned long nr_cross_allocs
 
static struct perf_time_interval ptime
 
const char * time_str
 
static u64 total_page_alloc_bytes
 
static u64 total_page_free_bytes
 
static u64 total_page_nomatch_bytes
 
static u64 total_page_fail_bytes
 
static unsigned long nr_page_allocs
 
static unsigned long nr_page_frees
 
static unsigned long nr_page_fails
 
static unsigned long nr_page_nomatch
 
static bool use_pfn
 
static bool live_page
 
static struct perf_sessionkmem_session
 
static int order_stats [MAX_PAGE_ORDER][MAX_MIGRATE_TYPES]
 
static struct rb_root page_live_tree
 
static struct rb_root page_alloc_tree
 
static struct rb_root page_alloc_sorted
 
static struct rb_root page_caller_tree
 
static struct rb_root page_caller_sorted
 
static int nr_alloc_funcs
 
static struct alloc_funcalloc_func_list
 
static struct gfp_flaggfps
 
static int nr_gfps
 
struct {
   const char *   original
 
   const char *   compact
 
gfp_compact_table []
 
static size_t max_gfp_len
 
static struct perf_tool perf_kmem
 
static const char *const migrate_type_str []
 
static struct sort_dimension ptr_sort_dimension
 
static struct sort_dimension callsite_sort_dimension
 
static struct sort_dimension hit_sort_dimension
 
static struct sort_dimension bytes_sort_dimension
 
static struct sort_dimension frag_sort_dimension
 
static struct sort_dimension pingpong_sort_dimension
 
static struct sort_dimension page_sort_dimension
 
static struct sort_dimension page_callsite_sort_dimension
 
static struct sort_dimension page_hit_sort_dimension
 
static struct sort_dimension page_bytes_sort_dimension
 
static struct sort_dimension page_order_sort_dimension
 
static struct sort_dimension migrate_type_sort_dimension
 
static struct sort_dimension gfp_flags_sort_dimension
 
static struct sort_dimensionslab_sorts []
 
static struct sort_dimensionpage_sorts []
 

Macro Definition Documentation

◆ MAX_MIGRATE_TYPES

#define MAX_MIGRATE_TYPES   6

Definition at line 270 of file builtin-kmem.c.

◆ MAX_PAGE_ORDER

#define MAX_PAGE_ORDER   11

Definition at line 271 of file builtin-kmem.c.

Typedef Documentation

◆ sort_fn_t

typedef int(* sort_fn_t) (void *, void *)

Definition at line 44 of file builtin-kmem.c.

◆ tracepoint_handler

typedef int(* tracepoint_handler) (struct perf_evsel *evsel, struct perf_sample *sample)

Definition at line 931 of file builtin-kmem.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
KMEM_SLAB 
KMEM_PAGE 

Definition at line 38 of file builtin-kmem.c.

Function Documentation

◆ __cmd_kmem()

static int __cmd_kmem ( struct perf_session session)
static

Definition at line 1361 of file builtin-kmem.c.

Here is the call graph for this function:

◆ __cmd_record()

static int __cmd_record ( int  argc,
const char **  argv 
)
static

Definition at line 1824 of file builtin-kmem.c.

Here is the call graph for this function:

◆ __page_stat__findnew_alloc()

static struct page_stat* __page_stat__findnew_alloc ( struct page_stat pstat,
bool  create 
)
static

Definition at line 486 of file builtin-kmem.c.

Here is the call graph for this function:

◆ __page_stat__findnew_caller()

static struct page_stat* __page_stat__findnew_caller ( struct page_stat pstat,
bool  create 
)
static

Definition at line 541 of file builtin-kmem.c.

Here is the call graph for this function:

◆ __page_stat__findnew_page()

static struct page_stat* __page_stat__findnew_page ( struct page_stat pstat,
bool  create 
)
static

Definition at line 437 of file builtin-kmem.c.

Here is the call graph for this function:

◆ __print_page_alloc_result()

static void __print_page_alloc_result ( struct perf_session session,
int  n_lines 
)
static

Definition at line 1045 of file builtin-kmem.c.

Here is the call graph for this function:

◆ __print_page_caller_result()

static void __print_page_caller_result ( struct perf_session session,
int  n_lines 
)
static

Definition at line 1094 of file builtin-kmem.c.

Here is the call graph for this function:

◆ __print_slab_result()

static void __print_slab_result ( struct rb_root *  root,
struct perf_session session,
int  n_lines,
int  is_caller 
)
static

Definition at line 982 of file builtin-kmem.c.

Here is the call graph for this function:

◆ __sort_page_result()

static void __sort_page_result ( struct rb_root *  root,
struct rb_root *  root_sorted,
struct list_head *  sort_list 
)
static

Definition at line 1323 of file builtin-kmem.c.

Here is the call graph for this function:

◆ __sort_slab_result()

static void __sort_slab_result ( struct rb_root *  root,
struct rb_root *  root_sorted,
struct list_head *  sort_list 
)
static

Definition at line 1276 of file builtin-kmem.c.

Here is the call graph for this function:

◆ build_alloc_func_list()

static int build_alloc_func_list ( void  )
static

Definition at line 328 of file builtin-kmem.c.

Here is the call graph for this function:

◆ bytes_cmp()

static int bytes_cmp ( void *  a,
void *  b 
)
static

Definition at line 1458 of file builtin-kmem.c.

◆ callcmp()

static int callcmp ( const void *  a,
const void *  b 
)
static

Definition at line 314 of file builtin-kmem.c.

◆ cmd_kmem()

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

Definition at line 1891 of file builtin-kmem.c.

Here is the call graph for this function:

◆ compact_gfp_flags()

static char* compact_gfp_flags ( char *  gfp_flags)
static

Definition at line 665 of file builtin-kmem.c.

Here is the call graph for this function:

◆ compact_gfp_string()

static char* compact_gfp_string ( unsigned long  gfp_flags)
static

Definition at line 715 of file builtin-kmem.c.

Here is the call graph for this function:

◆ find_callsite()

static u64 find_callsite ( struct perf_evsel evsel,
struct perf_sample sample 
)
static

Definition at line 382 of file builtin-kmem.c.

Here is the call graph for this function:

◆ frag_cmp()

static int frag_cmp ( void *  a,
void *  b 
)
static

Definition at line 1475 of file builtin-kmem.c.

Here is the call graph for this function:

◆ fragmentation()

static double fragmentation ( unsigned long  n_req,
unsigned long  n_alloc 
)
static

Definition at line 974 of file builtin-kmem.c.

◆ funcmp()

static int funcmp ( const void *  a,
const void *  b 
)
static

Definition at line 303 of file builtin-kmem.c.

◆ gfp_flags_cmp()

static int gfp_flags_cmp ( void *  a,
void *  b 
)
static

Definition at line 1620 of file builtin-kmem.c.

◆ gfpcmp()

static int gfpcmp ( const void *  a,
const void *  b 
)
static

Definition at line 613 of file builtin-kmem.c.

◆ hit_cmp()

static int hit_cmp ( void *  a,
void *  b 
)
static

Definition at line 1441 of file builtin-kmem.c.

◆ insert_alloc_stat()

static int insert_alloc_stat ( unsigned long  call_site,
unsigned long  ptr,
int  bytes_req,
int  bytes_alloc,
int  cpu 
)
static

Definition at line 80 of file builtin-kmem.c.

Here is the call graph for this function:

◆ insert_caller_stat()

static int insert_caller_stat ( unsigned long  call_site,
int  bytes_req,
int  bytes_alloc 
)
static

Definition at line 125 of file builtin-kmem.c.

Here is the call graph for this function:

◆ kmem_config()

static int kmem_config ( const char *  var,
const char *  value,
void *cb  __maybe_unused 
)
static

Definition at line 1875 of file builtin-kmem.c.

◆ LIST_HEAD() [1/6]

static LIST_HEAD ( page_alloc_sort_input  )
static

◆ LIST_HEAD() [2/6]

static LIST_HEAD ( page_caller_sort_input  )
static

◆ LIST_HEAD() [3/6]

static LIST_HEAD ( slab_caller_sort  )
static

◆ LIST_HEAD() [4/6]

static LIST_HEAD ( slab_alloc_sort  )
static

◆ LIST_HEAD() [5/6]

static LIST_HEAD ( page_caller_sort  )
static

◆ LIST_HEAD() [6/6]

static LIST_HEAD ( page_alloc_sort  )
static

◆ migrate_type_cmp()

static int migrate_type_cmp ( void *  a,
void *  b 
)
static

Definition at line 1599 of file builtin-kmem.c.

◆ page_bytes_cmp()

static int page_bytes_cmp ( void *  a,
void *  b 
)
static

Definition at line 1565 of file builtin-kmem.c.

◆ page_callsite_cmp()

static int page_callsite_cmp ( void *  a,
void *  b 
)
static

Definition at line 1531 of file builtin-kmem.c.

◆ page_cmp()

static int page_cmp ( void *  a,
void *  b 
)
static

Definition at line 1514 of file builtin-kmem.c.

◆ page_hit_cmp()

static int page_hit_cmp ( void *  a,
void *  b 
)
static

Definition at line 1548 of file builtin-kmem.c.

◆ page_order_cmp()

static int page_order_cmp ( void *  a,
void *  b 
)
static

Definition at line 1582 of file builtin-kmem.c.

◆ page_sort_dimension__add()

static int page_sort_dimension__add ( const char *  tok,
struct list_head *  list 
)
static

Definition at line 1680 of file builtin-kmem.c.

◆ page_stat__find_alloc()

static struct page_stat* page_stat__find_alloc ( struct page_stat pstat)
static

Definition at line 530 of file builtin-kmem.c.

Here is the call graph for this function:

◆ page_stat__find_caller()

static struct page_stat* page_stat__find_caller ( struct page_stat pstat)
static

Definition at line 585 of file builtin-kmem.c.

Here is the call graph for this function:

◆ page_stat__find_page()

static struct page_stat* page_stat__find_page ( struct page_stat pstat)
static

Definition at line 475 of file builtin-kmem.c.

Here is the call graph for this function:

◆ page_stat__findnew_alloc()

static struct page_stat* page_stat__findnew_alloc ( struct page_stat pstat)
static

Definition at line 535 of file builtin-kmem.c.

Here is the call graph for this function:

◆ page_stat__findnew_caller()

static struct page_stat* page_stat__findnew_caller ( struct page_stat pstat)
static

Definition at line 590 of file builtin-kmem.c.

Here is the call graph for this function:

◆ page_stat__findnew_page()

static struct page_stat* page_stat__findnew_page ( struct page_stat pstat)
static

Definition at line 480 of file builtin-kmem.c.

Here is the call graph for this function:

◆ parse_alloc_opt()

static int parse_alloc_opt ( const struct option *opt  __maybe_unused,
const char *arg  __maybe_unused,
int unset  __maybe_unused 
)
static

Definition at line 1782 of file builtin-kmem.c.

◆ parse_caller_opt()

static int parse_caller_opt ( const struct option *opt  __maybe_unused,
const char *arg  __maybe_unused,
int unset  __maybe_unused 
)
static

Definition at line 1774 of file builtin-kmem.c.

◆ parse_gfp_flags()

static int parse_gfp_flags ( struct perf_evsel evsel,
struct perf_sample sample,
unsigned int  gfp_flags 
)
static

Definition at line 729 of file builtin-kmem.c.

Here is the call graph for this function:

◆ parse_line_opt()

static int parse_line_opt ( const struct option *opt  __maybe_unused,
const char *  arg,
int unset  __maybe_unused 
)
static

Definition at line 1806 of file builtin-kmem.c.

◆ parse_page_opt()

static int parse_page_opt ( const struct option *opt  __maybe_unused,
const char *arg  __maybe_unused,
int unset  __maybe_unused 
)
static

Definition at line 1798 of file builtin-kmem.c.

◆ parse_slab_opt()

static int parse_slab_opt ( const struct option *opt  __maybe_unused,
const char *arg  __maybe_unused,
int unset  __maybe_unused 
)
static

Definition at line 1790 of file builtin-kmem.c.

◆ parse_sort_opt()

static int parse_sort_opt ( const struct option *opt  __maybe_unused,
const char *  arg,
int unset  __maybe_unused 
)
static

Definition at line 1752 of file builtin-kmem.c.

Here is the call graph for this function:

◆ perf_evsel__process_alloc_event()

static int perf_evsel__process_alloc_event ( struct perf_evsel evsel,
struct perf_sample sample 
)
static

Definition at line 167 of file builtin-kmem.c.

Here is the call graph for this function:

◆ perf_evsel__process_alloc_node_event()

static int perf_evsel__process_alloc_node_event ( struct perf_evsel evsel,
struct perf_sample sample 
)
static

Definition at line 186 of file builtin-kmem.c.

Here is the call graph for this function:

◆ perf_evsel__process_free_event()

static int perf_evsel__process_free_event ( struct perf_evsel evsel,
struct perf_sample sample 
)
static

Definition at line 230 of file builtin-kmem.c.

Here is the call graph for this function:

◆ perf_evsel__process_page_alloc_event()

static int perf_evsel__process_page_alloc_event ( struct perf_evsel evsel,
struct perf_sample sample 
)
static

Definition at line 780 of file builtin-kmem.c.

Here is the call graph for this function:

◆ perf_evsel__process_page_free_event()

static int perf_evsel__process_page_free_event ( struct perf_evsel evsel,
struct perf_sample sample 
)
static

Definition at line 853 of file builtin-kmem.c.

Here is the call graph for this function:

◆ perf_kmem__skip_sample()

static bool perf_kmem__skip_sample ( struct perf_sample sample)
static

Definition at line 922 of file builtin-kmem.c.

Here is the call graph for this function:

◆ pingpong_cmp()

static int pingpong_cmp ( void *  a,
void *  b 
)
static

Definition at line 1496 of file builtin-kmem.c.

◆ print_gfp_flags()

static void print_gfp_flags ( void  )
static

Definition at line 1136 of file builtin-kmem.c.

◆ print_page_result()

static void print_page_result ( struct perf_session session)
static

Definition at line 1222 of file builtin-kmem.c.

Here is the call graph for this function:

◆ print_page_summary()

static void print_page_summary ( void  )
static

Definition at line 1168 of file builtin-kmem.c.

◆ print_result()

static void print_result ( struct perf_session session)
static

Definition at line 1233 of file builtin-kmem.c.

Here is the call graph for this function:

◆ print_slab_result()

static void print_slab_result ( struct perf_session session)
static

Definition at line 1213 of file builtin-kmem.c.

Here is the call graph for this function:

◆ print_slab_summary()

static void print_slab_summary ( void  )
static

Definition at line 1150 of file builtin-kmem.c.

Here is the call graph for this function:

◆ process_sample_event()

static int process_sample_event ( struct perf_tool *tool  __maybe_unused,
union perf_event event,
struct perf_sample sample,
struct perf_evsel evsel,
struct machine machine 
)
static

Definition at line 934 of file builtin-kmem.c.

Here is the call graph for this function:

◆ ptr_cmp()

static int ptr_cmp ( void *  a,
void *  b 
)
static

Definition at line 1407 of file builtin-kmem.c.

◆ search_alloc_stat()

static struct alloc_stat* search_alloc_stat ( unsigned long  ptr,
unsigned long  call_site,
struct rb_root *  root,
sort_fn_t  sort_fn 
)
static

Definition at line 205 of file builtin-kmem.c.

◆ setup_page_sorting()

static int setup_page_sorting ( struct list_head *  sort_list,
const char *  arg 
)
static

Definition at line 1726 of file builtin-kmem.c.

Here is the call graph for this function:

◆ setup_slab_sorting()

static int setup_slab_sorting ( struct list_head *  sort_list,
const char *  arg 
)
static

Definition at line 1700 of file builtin-kmem.c.

Here is the call graph for this function:

◆ slab_callsite_cmp()

static int slab_callsite_cmp ( void *  a,
void *  b 
)
static

Definition at line 1424 of file builtin-kmem.c.

◆ slab_sort_dimension__add()

static int slab_sort_dimension__add ( const char *  tok,
struct list_head *  list 
)
static

Definition at line 1660 of file builtin-kmem.c.

◆ sort_page_insert()

static void sort_page_insert ( struct rb_root *  root,
struct page_stat data,
struct list_head *  sort_list 
)
static

Definition at line 1293 of file builtin-kmem.c.

◆ sort_result()

static void sort_result ( void  )
static

Definition at line 1340 of file builtin-kmem.c.

Here is the call graph for this function:

◆ sort_slab_insert()

static void sort_slab_insert ( struct rb_root *  root,
struct alloc_stat data,
struct list_head *  sort_list 
)
static

Definition at line 1246 of file builtin-kmem.c.

◆ valid_page()

static bool valid_page ( u64  pfn_or_page)
static

Definition at line 595 of file builtin-kmem.c.

Variable Documentation

◆ alloc_flag

int alloc_flag
static

Definition at line 46 of file builtin-kmem.c.

◆ alloc_func_list

struct alloc_func* alloc_func_list
static

Definition at line 301 of file builtin-kmem.c.

◆ alloc_lines

int alloc_lines = -1
static

Definition at line 49 of file builtin-kmem.c.

◆ bytes_sort_dimension

struct sort_dimension bytes_sort_dimension
static
Initial value:
= {
.name = "bytes",
.cmp = bytes_cmp,
}
static int bytes_cmp(void *a, void *b)

Definition at line 1470 of file builtin-kmem.c.

◆ caller_flag

int caller_flag
static

Definition at line 47 of file builtin-kmem.c.

◆ caller_lines

int caller_lines = -1
static

Definition at line 50 of file builtin-kmem.c.

◆ callsite_sort_dimension

struct sort_dimension callsite_sort_dimension
static
Initial value:
= {
.name = "callsite",
}
static int slab_callsite_cmp(void *, void *)

Definition at line 1436 of file builtin-kmem.c.

◆ compact

const char* compact

Definition at line 624 of file builtin-kmem.c.

◆ frag_sort_dimension

struct sort_dimension frag_sort_dimension
static
Initial value:
= {
.name = "frag",
.cmp = frag_cmp,
}
static int frag_cmp(void *a, void *b)

Definition at line 1491 of file builtin-kmem.c.

◆ gfp_compact_table

const { ... } gfp_compact_table[]

◆ gfp_flags_sort_dimension

struct sort_dimension gfp_flags_sort_dimension
static
Initial value:
= {
.name = "gfp",
.cmp = gfp_flags_cmp,
}
static int gfp_flags_cmp(void *a, void *b)

Definition at line 1636 of file builtin-kmem.c.

◆ gfps

struct gfp_flag* gfps
static

Definition at line 610 of file builtin-kmem.c.

◆ hit_sort_dimension

struct sort_dimension hit_sort_dimension
static
Initial value:
= {
.name = "hit",
.cmp = hit_cmp,
}
static int hit_cmp(void *a, void *b)

Definition at line 1453 of file builtin-kmem.c.

◆ kmem_default

enum { ... } kmem_default

◆ kmem_page

int kmem_page
static

Definition at line 35 of file builtin-kmem.c.

◆ kmem_page_size

long kmem_page_size
static

Definition at line 37 of file builtin-kmem.c.

◆ kmem_session

struct perf_session* kmem_session
static

Definition at line 268 of file builtin-kmem.c.

◆ kmem_slab

int kmem_slab
static

Definition at line 34 of file builtin-kmem.c.

◆ live_page

bool live_page
static

Definition at line 267 of file builtin-kmem.c.

◆ max_gfp_len

size_t max_gfp_len
static

Definition at line 663 of file builtin-kmem.c.

◆ migrate_type_sort_dimension

struct sort_dimension migrate_type_sort_dimension
static
Initial value:
= {
.name = "migtype",
}
static int migrate_type_cmp(void *a, void *b)

Definition at line 1615 of file builtin-kmem.c.

◆ migrate_type_str

const char* const migrate_type_str[]
static
Initial value:
= {
"UNMOVABL",
"RECLAIM",
"MOVABLE",
"RESERVED",
"CMA/ISLT",
"UNKNOWN",
}

Definition at line 1036 of file builtin-kmem.c.

◆ nr_alloc_funcs

int nr_alloc_funcs
static

Definition at line 300 of file builtin-kmem.c.

◆ nr_allocs

unsigned long nr_allocs
static

Definition at line 74 of file builtin-kmem.c.

◆ nr_cross_allocs

unsigned long nr_cross_allocs
static

Definition at line 74 of file builtin-kmem.c.

◆ nr_gfps

int nr_gfps
static

Definition at line 611 of file builtin-kmem.c.

◆ nr_page_allocs

unsigned long nr_page_allocs
static

Definition at line 261 of file builtin-kmem.c.

◆ nr_page_fails

unsigned long nr_page_fails
static

Definition at line 263 of file builtin-kmem.c.

◆ nr_page_frees

unsigned long nr_page_frees
static

Definition at line 262 of file builtin-kmem.c.

◆ nr_page_nomatch

unsigned long nr_page_nomatch
static

Definition at line 264 of file builtin-kmem.c.

◆ order_stats

int order_stats[MAX_PAGE_ORDER][MAX_MIGRATE_TYPES]
static

Definition at line 273 of file builtin-kmem.c.

◆ original

const char* original

Definition at line 623 of file builtin-kmem.c.

◆ page_alloc_sorted

struct rb_root page_alloc_sorted
static

Definition at line 290 of file builtin-kmem.c.

◆ page_alloc_tree

struct rb_root page_alloc_tree
static

Definition at line 289 of file builtin-kmem.c.

◆ page_bytes_sort_dimension

struct sort_dimension page_bytes_sort_dimension
static
Initial value:
= {
.name = "bytes",
}
static int page_bytes_cmp(void *a, void *b)

Definition at line 1577 of file builtin-kmem.c.

◆ page_caller_sorted

struct rb_root page_caller_sorted
static

Definition at line 292 of file builtin-kmem.c.

◆ page_caller_tree

struct rb_root page_caller_tree
static

Definition at line 291 of file builtin-kmem.c.

◆ page_callsite_sort_dimension

struct sort_dimension page_callsite_sort_dimension
static
Initial value:
= {
.name = "callsite",
}
static int page_callsite_cmp(void *a, void *b)

Definition at line 1543 of file builtin-kmem.c.

◆ page_hit_sort_dimension

struct sort_dimension page_hit_sort_dimension
static
Initial value:
= {
.name = "hit",
.cmp = page_hit_cmp,
}
static int page_hit_cmp(void *a, void *b)

Definition at line 1560 of file builtin-kmem.c.

◆ page_live_tree

struct rb_root page_live_tree
static

Definition at line 288 of file builtin-kmem.c.

◆ page_order_sort_dimension

struct sort_dimension page_order_sort_dimension
static
Initial value:
= {
.name = "order",
}
static int page_order_cmp(void *a, void *b)

Definition at line 1594 of file builtin-kmem.c.

◆ page_sort_dimension

struct sort_dimension page_sort_dimension
static
Initial value:
= {
.name = "page",
.cmp = page_cmp,
}
static int page_cmp(void *a, void *b)

Definition at line 1526 of file builtin-kmem.c.

◆ page_sorts

struct sort_dimension* page_sorts[]
static
Initial value:
= {
}
static struct sort_dimension page_sort_dimension
static struct sort_dimension page_order_sort_dimension
static struct sort_dimension gfp_flags_sort_dimension
static struct sort_dimension migrate_type_sort_dimension
static struct sort_dimension page_bytes_sort_dimension
static struct sort_dimension page_hit_sort_dimension
static struct sort_dimension page_callsite_sort_dimension

Definition at line 1650 of file builtin-kmem.c.

◆ perf_kmem

struct perf_tool perf_kmem
static
Initial value:
= {
.ordered_events = true,
}
static int process_sample_event(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel, struct machine *machine)
Definition: builtin-kmem.c:934
int perf_event__process_mmap(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
Definition: event.c:1385
int perf_event__process_comm(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
Definition: event.c:1273
int perf_event__process_mmap2(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
Definition: event.c:1393
int perf_event__process_namespaces(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
Definition: event.c:1281

Definition at line 965 of file builtin-kmem.c.

◆ pingpong_sort_dimension

struct sort_dimension pingpong_sort_dimension
static
Initial value:
= {
.name = "pingpong",
.cmp = pingpong_cmp,
}
static int pingpong_cmp(void *a, void *b)

Definition at line 1508 of file builtin-kmem.c.

◆ ptime

struct perf_time_interval ptime
static

Definition at line 77 of file builtin-kmem.c.

◆ ptr_sort_dimension

struct sort_dimension ptr_sort_dimension
static
Initial value:
= {
.name = "ptr",
.cmp = ptr_cmp,
}
static int ptr_cmp(void *, void *)

Definition at line 1419 of file builtin-kmem.c.

◆ raw_ip

bool raw_ip
static

Definition at line 52 of file builtin-kmem.c.

◆ root_alloc_sorted

struct rb_root root_alloc_sorted
static

Definition at line 69 of file builtin-kmem.c.

◆ root_alloc_stat

struct rb_root root_alloc_stat
static

Definition at line 68 of file builtin-kmem.c.

◆ root_caller_sorted

struct rb_root root_caller_sorted
static

Definition at line 71 of file builtin-kmem.c.

◆ root_caller_stat

struct rb_root root_caller_stat
static

Definition at line 70 of file builtin-kmem.c.

◆ slab_sorts

struct sort_dimension* slab_sorts[]
static
Initial value:
= {
}
static struct sort_dimension callsite_sort_dimension
static struct sort_dimension pingpong_sort_dimension
static struct sort_dimension bytes_sort_dimension
static struct sort_dimension hit_sort_dimension
static struct sort_dimension frag_sort_dimension
static struct sort_dimension ptr_sort_dimension

Definition at line 1641 of file builtin-kmem.c.

◆ time_str

const char* time_str

Definition at line 78 of file builtin-kmem.c.

◆ total_allocated

unsigned long total_allocated
static

Definition at line 73 of file builtin-kmem.c.

◆ total_freed

unsigned long total_freed
static

Definition at line 73 of file builtin-kmem.c.

◆ total_page_alloc_bytes

u64 total_page_alloc_bytes
static

Definition at line 257 of file builtin-kmem.c.

◆ total_page_fail_bytes

u64 total_page_fail_bytes
static

Definition at line 260 of file builtin-kmem.c.

◆ total_page_free_bytes

u64 total_page_free_bytes
static

Definition at line 258 of file builtin-kmem.c.

◆ total_page_nomatch_bytes

u64 total_page_nomatch_bytes
static

Definition at line 259 of file builtin-kmem.c.

◆ total_requested

unsigned long total_requested
static

Definition at line 73 of file builtin-kmem.c.

◆ use_pfn

bool use_pfn
static

Definition at line 266 of file builtin-kmem.c.