Linux Perf
builtin-sched.c File Reference
#include "builtin.h"
#include "perf.h"
#include "util/util.h"
#include "util/evlist.h"
#include "util/cache.h"
#include "util/evsel.h"
#include "util/symbol.h"
#include "util/thread.h"
#include "util/header.h"
#include "util/session.h"
#include "util/tool.h"
#include "util/cloexec.h"
#include "util/thread_map.h"
#include "util/color.h"
#include "util/stat.h"
#include "util/callchain.h"
#include "util/time-utils.h"
#include <subcmd/parse-options.h>
#include "util/trace-event.h"
#include "util/debug.h"
#include <linux/kernel.h>
#include <linux/log2.h>
#include <sys/prctl.h>
#include <sys/resource.h>
#include <inttypes.h>
#include <errno.h>
#include <semaphore.h>
#include <pthread.h>
#include <math.h>
#include <api/fs/fs.h>
#include <linux/time64.h>
#include "sane_ctype.h"
Include dependency graph for builtin-sched.c:

Go to the source code of this file.

Classes

struct  task_desc
 
struct  sched_atom
 
struct  work_atom
 
struct  work_atoms
 
struct  trace_sched_handler
 
struct  perf_sched_map
 
struct  perf_sched
 
struct  thread_runtime
 
struct  evsel_runtime
 
struct  idle_thread_runtime
 
struct  sched_thread_parms
 
struct  sort_dimension
 
union  map_priv
 
struct  total_run_stats
 

Macros

#define PR_SET_NAME   15 /* Set process name */
 
#define MAX_CPUS   4096
 
#define COMM_LEN   20
 
#define SYM_LEN   129
 
#define MAX_PID   1024000
 
#define TASK_STATE_TO_CHAR_STR   "RSDTtZXxKWP"
 
#define TASK_RUNNING   0
 
#define TASK_INTERRUPTIBLE   1
 
#define TASK_UNINTERRUPTIBLE   2
 
#define __TASK_STOPPED   4
 
#define __TASK_TRACED   8
 
#define EXIT_DEAD   16
 
#define EXIT_ZOMBIE   32
 
#define EXIT_TRACE   (EXIT_ZOMBIE | EXIT_DEAD)
 
#define TASK_DEAD   64
 
#define TASK_WAKEKILL   128
 
#define TASK_WAKING   256
 
#define TASK_PARKED   512
 
#define COLOR_PIDS   PERF_COLOR_BLUE
 
#define COLOR_CPUS   PERF_COLOR_BG_RED
 

Typedefs

typedef int(* sort_fn_t) (struct work_atoms *, struct work_atoms *)
 
typedef int(* tracepoint_handler) (struct perf_tool *tool, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine)
 
typedef int(* sched_handler) (struct perf_tool *tool, union perf_event *event, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine)
 

Enumerations

enum  sched_event_type { SCHED_EVENT_RUN, SCHED_EVENT_SLEEP, SCHED_EVENT_WAKEUP, SCHED_EVENT_MIGRATION }
 
enum  thread_state { THREAD_SLEEPING = 0, THREAD_WAIT_CPU, THREAD_SCHED_IN, THREAD_IGNORE }
 

Functions

static u64 get_nsecs (void)
 
static void burn_nsecs (struct perf_sched *sched, u64 nsecs)
 
static void sleep_nsecs (u64 nsecs)
 
static void calibrate_run_measurement_overhead (struct perf_sched *sched)
 
static void calibrate_sleep_measurement_overhead (struct perf_sched *sched)
 
static struct sched_atomget_new_event (struct task_desc *task, u64 timestamp)
 
static struct sched_atomlast_event (struct task_desc *task)
 
static void add_sched_event_run (struct perf_sched *sched, struct task_desc *task, u64 timestamp, u64 duration)
 
static void add_sched_event_wakeup (struct perf_sched *sched, struct task_desc *task, u64 timestamp, struct task_desc *wakee)
 
static void add_sched_event_sleep (struct perf_sched *sched, struct task_desc *task, u64 timestamp, u64 task_state __maybe_unused)
 
static struct task_descregister_pid (struct perf_sched *sched, unsigned long pid, const char *comm)
 
static void print_task_traces (struct perf_sched *sched)
 
static void add_cross_task_wakeups (struct perf_sched *sched)
 
static void perf_sched__process_event (struct perf_sched *sched, struct sched_atom *atom)
 
static u64 get_cpu_usage_nsec_parent (void)
 
static int self_open_counters (struct perf_sched *sched, unsigned long cur_task)
 
static u64 get_cpu_usage_nsec_self (int fd)
 
static void * thread_func (void *ctx)
 
static void create_tasks (struct perf_sched *sched)
 
static void wait_for_tasks (struct perf_sched *sched)
 
static void run_one_test (struct perf_sched *sched)
 
static void test_calibrations (struct perf_sched *sched)
 
static int replay_wakeup_event (struct perf_sched *sched, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine __maybe_unused)
 
static int replay_switch_event (struct perf_sched *sched, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine __maybe_unused)
 
static int replay_fork_event (struct perf_sched *sched, union perf_event *event, struct machine *machine)
 
static struct thread_runtimethread__init_runtime (struct thread *thread)
 
static struct thread_runtimethread__get_runtime (struct thread *thread)
 
static int thread_lat_cmp (struct list_head *list, struct work_atoms *l, struct work_atoms *r)
 
static struct work_atomsthread_atoms_search (struct rb_root *root, struct thread *thread, struct list_head *sort_list)
 
static void __thread_latency_insert (struct rb_root *root, struct work_atoms *data, struct list_head *sort_list)
 
static int thread_atoms_insert (struct perf_sched *sched, struct thread *thread)
 
static char sched_out_state (u64 prev_state)
 
static int add_sched_out_event (struct work_atoms *atoms, char run_state, u64 timestamp)
 
static void add_runtime_event (struct work_atoms *atoms, u64 delta, u64 timestamp __maybe_unused)
 
static void add_sched_in_event (struct work_atoms *atoms, u64 timestamp)
 
static int latency_switch_event (struct perf_sched *sched, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine)
 
static int latency_runtime_event (struct perf_sched *sched, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine)
 
static int latency_wakeup_event (struct perf_sched *sched, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine)
 
static int latency_migrate_task_event (struct perf_sched *sched, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine)
 
static void output_lat_thread (struct perf_sched *sched, struct work_atoms *work_list)
 
static int pid_cmp (struct work_atoms *l, struct work_atoms *r)
 
static int avg_cmp (struct work_atoms *l, struct work_atoms *r)
 
static int max_cmp (struct work_atoms *l, struct work_atoms *r)
 
static int switch_cmp (struct work_atoms *l, struct work_atoms *r)
 
static int runtime_cmp (struct work_atoms *l, struct work_atoms *r)
 
static int sort_dimension__add (const char *tok, struct list_head *list)
 
static void perf_sched__sort_lat (struct perf_sched *sched)
 
static int process_sched_wakeup_event (struct perf_tool *tool, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine)
 
static bool thread__has_color (struct thread *thread)
 
static struct threadmap__findnew_thread (struct perf_sched *sched, struct machine *machine, pid_t pid, pid_t tid)
 
static int map_switch_event (struct perf_sched *sched, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine)
 
static int process_sched_switch_event (struct perf_tool *tool, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine)
 
static int process_sched_runtime_event (struct perf_tool *tool, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine)
 
static int perf_sched__process_fork_event (struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct machine *machine)
 
static int process_sched_migrate_task_event (struct perf_tool *tool, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine)
 
static int perf_sched__process_tracepoint_sample (struct perf_tool *tool __maybe_unused, union perf_event *event __maybe_unused, struct perf_sample *sample, struct perf_evsel *evsel, struct machine *machine)
 
static int perf_sched__process_comm (struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
 
static int perf_sched__read_events (struct perf_sched *sched)
 
static void print_sched_time (unsigned long long nsecs, int width)
 
static struct evsel_runtimeperf_evsel__get_runtime (struct perf_evsel *evsel)
 
static void perf_evsel__save_time (struct perf_evsel *evsel, u64 timestamp, u32 cpu)
 
static u64 perf_evsel__get_time (struct perf_evsel *evsel, u32 cpu)
 
static char * timehist_get_commstr (struct thread *thread)
 
static void timehist_header (struct perf_sched *sched)
 
static char task_state_char (struct thread *thread, int state)
 
static void timehist_print_sample (struct perf_sched *sched, struct perf_evsel *evsel, struct perf_sample *sample, struct addr_location *al, struct thread *thread, u64 t, int state)
 
static void timehist_update_runtime_stats (struct thread_runtime *r, u64 t, u64 tprev)
 
static bool is_idle_sample (struct perf_sample *sample, struct perf_evsel *evsel)
 
static void save_task_callchain (struct perf_sched *sched, struct perf_sample *sample, struct perf_evsel *evsel, struct machine *machine)
 
static int init_idle_thread (struct thread *thread)
 
static int init_idle_threads (int ncpu)
 
static void free_idle_threads (void)
 
static struct threadget_idle_thread (int cpu)
 
static void save_idle_callchain (struct perf_sched *sched, struct idle_thread_runtime *itr, struct perf_sample *sample)
 
static struct threadtimehist_get_thread (struct perf_sched *sched, struct perf_sample *sample, struct machine *machine, struct perf_evsel *evsel)
 
static bool timehist_skip_sample (struct perf_sched *sched, struct thread *thread, struct perf_evsel *evsel, struct perf_sample *sample)
 
static void timehist_print_wakeup_event (struct perf_sched *sched, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine, struct thread *awakened)
 
static int timehist_sched_wakeup_event (struct perf_tool *tool, union perf_event *event __maybe_unused, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine)
 
static void timehist_print_migration_event (struct perf_sched *sched, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine, struct thread *migrated)
 
static int timehist_migrate_task_event (struct perf_tool *tool, union perf_event *event __maybe_unused, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine)
 
static int timehist_sched_change_event (struct perf_tool *tool, union perf_event *event, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine)
 
static int timehist_sched_switch_event (struct perf_tool *tool, union perf_event *event, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine __maybe_unused)
 
static int process_lost (struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine __maybe_unused)
 
static void print_thread_runtime (struct thread *t, struct thread_runtime *r)
 
static void print_thread_waittime (struct thread *t, struct thread_runtime *r)
 
static int __show_thread_runtime (struct thread *t, void *priv)
 
static int show_thread_runtime (struct thread *t, void *priv)
 
static int show_deadthread_runtime (struct thread *t, void *priv)
 
static size_t callchain__fprintf_folded (FILE *fp, struct callchain_node *node)
 
static size_t timehist_print_idlehist_callchain (struct rb_root *root)
 
static void timehist_print_summary (struct perf_sched *sched, struct perf_session *session)
 
static int perf_timehist__process_sample (struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel, struct machine *machine)
 
static int timehist_check_attr (struct perf_sched *sched, struct perf_evlist *evlist)
 
static int perf_sched__timehist (struct perf_sched *sched)
 
static void print_bad_events (struct perf_sched *sched)
 
static void __merge_work_atoms (struct rb_root *root, struct work_atoms *data)
 
static void perf_sched__merge_lat (struct perf_sched *sched)
 
static int perf_sched__lat (struct perf_sched *sched)
 
static int setup_map_cpus (struct perf_sched *sched)
 
static int setup_color_pids (struct perf_sched *sched)
 
static int setup_color_cpus (struct perf_sched *sched)
 
static int perf_sched__map (struct perf_sched *sched)
 
static int perf_sched__replay (struct perf_sched *sched)
 
static void setup_sorting (struct perf_sched *sched, const struct option *options, const char *const usage_msg[])
 
static int __cmd_record (int argc, const char **argv)
 
int cmd_sched (int argc, const char **argv)
 

Variables

static struct thread ** idle_threads
 
static int idle_max_cpu
 
static char idle_comm [] = "<idle>"
 
static int comm_width = 30
 

Macro Definition Documentation

◆ __TASK_STOPPED

#define __TASK_STOPPED   4

Definition at line 90 of file builtin-sched.c.

◆ __TASK_TRACED

#define __TASK_TRACED   8

Definition at line 91 of file builtin-sched.c.

◆ COLOR_CPUS

#define COLOR_CPUS   PERF_COLOR_BG_RED

Definition at line 155 of file builtin-sched.c.

◆ COLOR_PIDS

#define COLOR_PIDS   PERF_COLOR_BLUE

Definition at line 154 of file builtin-sched.c.

◆ COMM_LEN

#define COMM_LEN   20

Definition at line 43 of file builtin-sched.c.

◆ EXIT_DEAD

#define EXIT_DEAD   16

Definition at line 93 of file builtin-sched.c.

◆ EXIT_TRACE

#define EXIT_TRACE   (EXIT_ZOMBIE | EXIT_DEAD)

Definition at line 95 of file builtin-sched.c.

◆ EXIT_ZOMBIE

#define EXIT_ZOMBIE   32

Definition at line 94 of file builtin-sched.c.

◆ MAX_CPUS

#define MAX_CPUS   4096

Definition at line 42 of file builtin-sched.c.

◆ MAX_PID

#define MAX_PID   1024000

Definition at line 45 of file builtin-sched.c.

◆ PR_SET_NAME

#define PR_SET_NAME   15 /* Set process name */

Definition at line 41 of file builtin-sched.c.

◆ SYM_LEN

#define SYM_LEN   129

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

◆ TASK_DEAD

#define TASK_DEAD   64

Definition at line 97 of file builtin-sched.c.

◆ TASK_INTERRUPTIBLE

#define TASK_INTERRUPTIBLE   1

Definition at line 88 of file builtin-sched.c.

◆ TASK_PARKED

#define TASK_PARKED   512

Definition at line 100 of file builtin-sched.c.

◆ TASK_RUNNING

#define TASK_RUNNING   0

Definition at line 87 of file builtin-sched.c.

◆ TASK_STATE_TO_CHAR_STR

#define TASK_STATE_TO_CHAR_STR   "RSDTtZXxKWP"

Definition at line 84 of file builtin-sched.c.

◆ TASK_UNINTERRUPTIBLE

#define TASK_UNINTERRUPTIBLE   2

Definition at line 89 of file builtin-sched.c.

◆ TASK_WAKEKILL

#define TASK_WAKEKILL   128

Definition at line 98 of file builtin-sched.c.

◆ TASK_WAKING

#define TASK_WAKING   256

Definition at line 99 of file builtin-sched.c.

Typedef Documentation

◆ sched_handler

typedef int(* sched_handler) (struct perf_tool *tool, union perf_event *event, struct perf_evsel *evsel, struct perf_sample *sample, struct machine *machine)

Definition at line 2896 of file builtin-sched.c.

◆ sort_fn_t

typedef int(* sort_fn_t) (struct work_atoms *, struct work_atoms *)

Definition at line 130 of file builtin-sched.c.

◆ tracepoint_handler

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

Definition at line 1722 of file builtin-sched.c.

Enumeration Type Documentation

◆ sched_event_type

Enumerator
SCHED_EVENT_RUN 
SCHED_EVENT_SLEEP 
SCHED_EVENT_WAKEUP 
SCHED_EVENT_MIGRATION 

Definition at line 67 of file builtin-sched.c.

◆ thread_state

Enumerator
THREAD_SLEEPING 
THREAD_WAIT_CPU 
THREAD_SCHED_IN 
THREAD_IGNORE 

Definition at line 102 of file builtin-sched.c.

Function Documentation

◆ __cmd_record()

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

Definition at line 3299 of file builtin-sched.c.

Here is the call graph for this function:

◆ __merge_work_atoms()

static void __merge_work_atoms ( struct rb_root *  root,
struct work_atoms data 
)
static

Definition at line 3077 of file builtin-sched.c.

Here is the call graph for this function:

◆ __show_thread_runtime()

static int __show_thread_runtime ( struct thread t,
void *  priv 
)
static

Definition at line 2698 of file builtin-sched.c.

Here is the call graph for this function:

◆ __thread_latency_insert()

static void __thread_latency_insert ( struct rb_root *  root,
struct work_atoms data,
struct list_head *  sort_list 
)
static

Definition at line 979 of file builtin-sched.c.

Here is the call graph for this function:

◆ add_cross_task_wakeups()

static void add_cross_task_wakeups ( struct perf_sched sched)
static

Definition at line 493 of file builtin-sched.c.

Here is the call graph for this function:

◆ add_runtime_event()

static void add_runtime_event ( struct work_atoms atoms,
u64  delta,
u64 timestamp  __maybe_unused 
)
static

Definition at line 1047 of file builtin-sched.c.

◆ add_sched_event_run()

static void add_sched_event_run ( struct perf_sched sched,
struct task_desc task,
u64  timestamp,
u64  duration 
)
static

Definition at line 375 of file builtin-sched.c.

Here is the call graph for this function:

◆ add_sched_event_sleep()

static void add_sched_event_sleep ( struct perf_sched sched,
struct task_desc task,
u64  timestamp,
u64 task_state  __maybe_unused 
)
static

Definition at line 425 of file builtin-sched.c.

Here is the call graph for this function:

◆ add_sched_event_wakeup()

static void add_sched_event_wakeup ( struct perf_sched sched,
struct task_desc task,
u64  timestamp,
struct task_desc wakee 
)
static

Definition at line 398 of file builtin-sched.c.

Here is the call graph for this function:

◆ add_sched_in_event()

static void add_sched_in_event ( struct work_atoms atoms,
u64  timestamp 
)
static

Definition at line 1061 of file builtin-sched.c.

◆ add_sched_out_event()

static int add_sched_out_event ( struct work_atoms atoms,
char  run_state,
u64  timestamp 
)
static

Definition at line 1025 of file builtin-sched.c.

Here is the call graph for this function:

◆ avg_cmp()

static int avg_cmp ( struct work_atoms l,
struct work_atoms r 
)
static

Definition at line 1354 of file builtin-sched.c.

◆ burn_nsecs()

static void burn_nsecs ( struct perf_sched sched,
u64  nsecs 
)
static

Definition at line 293 of file builtin-sched.c.

Here is the call graph for this function:

◆ calibrate_run_measurement_overhead()

static void calibrate_run_measurement_overhead ( struct perf_sched sched)
static

Definition at line 312 of file builtin-sched.c.

Here is the call graph for this function:

◆ calibrate_sleep_measurement_overhead()

static void calibrate_sleep_measurement_overhead ( struct perf_sched sched)
static

Definition at line 329 of file builtin-sched.c.

Here is the call graph for this function:

◆ callchain__fprintf_folded()

static size_t callchain__fprintf_folded ( FILE *  fp,
struct callchain_node node 
)
static

Definition at line 2737 of file builtin-sched.c.

Here is the call graph for this function:

◆ cmd_sched()

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

Definition at line 3337 of file builtin-sched.c.

Here is the call graph for this function:

◆ create_tasks()

static void create_tasks ( struct perf_sched sched)
static

Definition at line 652 of file builtin-sched.c.

Here is the call graph for this function:

◆ free_idle_threads()

static void free_idle_threads ( void  )
static

Definition at line 2225 of file builtin-sched.c.

Here is the call graph for this function:

◆ get_cpu_usage_nsec_parent()

static u64 get_cpu_usage_nsec_parent ( void  )
static

Definition at line 534 of file builtin-sched.c.

◆ get_cpu_usage_nsec_self()

static u64 get_cpu_usage_nsec_self ( int  fd)
static

Definition at line 591 of file builtin-sched.c.

◆ get_idle_thread()

static struct thread* get_idle_thread ( int  cpu)
static

Definition at line 2240 of file builtin-sched.c.

Here is the call graph for this function:

◆ get_new_event()

static struct sched_atom* get_new_event ( struct task_desc task,
u64  timestamp 
)
static

Definition at line 348 of file builtin-sched.c.

Here is the call graph for this function:

◆ get_nsecs()

static u64 get_nsecs ( void  )
static

Definition at line 284 of file builtin-sched.c.

◆ init_idle_thread()

static int init_idle_thread ( struct thread thread)
static

Definition at line 2179 of file builtin-sched.c.

Here is the call graph for this function:

◆ init_idle_threads()

static int init_idle_threads ( int  ncpu)
static

Definition at line 2201 of file builtin-sched.c.

Here is the call graph for this function:

◆ is_idle_sample()

static bool is_idle_sample ( struct perf_sample sample,
struct perf_evsel evsel 
)
static

Definition at line 2121 of file builtin-sched.c.

Here is the call graph for this function:

◆ last_event()

static struct sched_atom* last_event ( struct task_desc task)
static

Definition at line 367 of file builtin-sched.c.

◆ latency_migrate_task_event()

static int latency_migrate_task_event ( struct perf_sched sched,
struct perf_evsel evsel,
struct perf_sample sample,
struct machine machine 
)
static

Definition at line 1257 of file builtin-sched.c.

Here is the call graph for this function:

◆ latency_runtime_event()

static int latency_runtime_event ( struct perf_sched sched,
struct perf_evsel evsel,
struct perf_sample sample,
struct machine machine 
)
static

Definition at line 1161 of file builtin-sched.c.

Here is the call graph for this function:

◆ latency_switch_event()

static int latency_switch_event ( struct perf_sched sched,
struct perf_evsel evsel,
struct perf_sample sample,
struct machine machine 
)
static

Definition at line 1091 of file builtin-sched.c.

Here is the call graph for this function:

◆ latency_wakeup_event()

static int latency_wakeup_event ( struct perf_sched sched,
struct perf_evsel evsel,
struct perf_sample sample,
struct machine machine 
)
static

Definition at line 1196 of file builtin-sched.c.

Here is the call graph for this function:

◆ map__findnew_thread()

static struct thread* map__findnew_thread ( struct perf_sched sched,
struct machine machine,
pid_t  pid,
pid_t  tid 
)
static

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

Here is the call graph for this function:

◆ map_switch_event()

static int map_switch_event ( struct perf_sched sched,
struct perf_evsel evsel,
struct perf_sample sample,
struct machine machine 
)
static

Definition at line 1513 of file builtin-sched.c.

Here is the call graph for this function:

◆ max_cmp()

static int max_cmp ( struct work_atoms l,
struct work_atoms r 
)
static

Definition at line 1375 of file builtin-sched.c.

◆ output_lat_thread()

static void output_lat_thread ( struct perf_sched sched,
struct work_atoms work_list 
)
static

Definition at line 1307 of file builtin-sched.c.

Here is the call graph for this function:

◆ perf_evsel__get_runtime()

static struct evsel_runtime* perf_evsel__get_runtime ( struct perf_evsel evsel)
static

Definition at line 1840 of file builtin-sched.c.

Here is the call graph for this function:

◆ perf_evsel__get_time()

static u64 perf_evsel__get_time ( struct perf_evsel evsel,
u32  cpu 
)
static

Definition at line 1882 of file builtin-sched.c.

Here is the call graph for this function:

◆ perf_evsel__save_time()

static void perf_evsel__save_time ( struct perf_evsel evsel,
u64  timestamp,
u32  cpu 
)
static

Definition at line 1855 of file builtin-sched.c.

Here is the call graph for this function:

◆ perf_sched__lat()

static int perf_sched__lat ( struct perf_sched sched)
static

Definition at line 3130 of file builtin-sched.c.

Here is the call graph for this function:

◆ perf_sched__map()

static int perf_sched__map ( struct perf_sched sched)
static

Definition at line 3228 of file builtin-sched.c.

Here is the call graph for this function:

◆ perf_sched__merge_lat()

static void perf_sched__merge_lat ( struct perf_sched sched)
static

Definition at line 3115 of file builtin-sched.c.

Here is the call graph for this function:

◆ perf_sched__process_comm()

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

Definition at line 1743 of file builtin-sched.c.

Here is the call graph for this function:

◆ perf_sched__process_event()

static void perf_sched__process_event ( struct perf_sched sched,
struct sched_atom atom 
)
static

Definition at line 508 of file builtin-sched.c.

Here is the call graph for this function:

◆ perf_sched__process_fork_event()

static int perf_sched__process_fork_event ( struct perf_tool tool,
union perf_event event,
struct perf_sample sample,
struct machine machine 
)
static

Definition at line 1692 of file builtin-sched.c.

Here is the call graph for this function:

◆ perf_sched__process_tracepoint_sample()

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

Definition at line 1727 of file builtin-sched.c.

◆ perf_sched__read_events()

static int perf_sched__read_events ( struct perf_sched sched)
static

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

Here is the call graph for this function:

◆ perf_sched__replay()

static int perf_sched__replay ( struct perf_sched sched)
static

Definition at line 3246 of file builtin-sched.c.

Here is the call graph for this function:

◆ perf_sched__sort_lat()

static void perf_sched__sort_lat ( struct perf_sched sched)
static

Definition at line 1447 of file builtin-sched.c.

Here is the call graph for this function:

◆ perf_sched__timehist()

static int perf_sched__timehist ( struct perf_sched sched)
static

Definition at line 2947 of file builtin-sched.c.

Here is the call graph for this function:

◆ perf_timehist__process_sample()

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

Definition at line 2902 of file builtin-sched.c.

◆ pid_cmp()

static int pid_cmp ( struct work_atoms l,
struct work_atoms r 
)
static

Definition at line 1343 of file builtin-sched.c.

◆ print_bad_events()

static void print_bad_events ( struct perf_sched sched)
static

Definition at line 3055 of file builtin-sched.c.

◆ print_sched_time()

static void print_sched_time ( unsigned long long  nsecs,
int  width 
)
inlinestatic

Definition at line 1825 of file builtin-sched.c.

◆ print_task_traces()

static void print_task_traces ( struct perf_sched sched)
static

Definition at line 481 of file builtin-sched.c.

◆ print_thread_runtime()

static void print_thread_runtime ( struct thread t,
struct thread_runtime r 
)
static

Definition at line 2650 of file builtin-sched.c.

Here is the call graph for this function:

◆ print_thread_waittime()

static void print_thread_waittime ( struct thread t,
struct thread_runtime r 
)
static

Definition at line 2673 of file builtin-sched.c.

Here is the call graph for this function:

◆ process_lost()

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

Definition at line 2635 of file builtin-sched.c.

Here is the call graph for this function:

◆ process_sched_migrate_task_event()

static int process_sched_migrate_task_event ( struct perf_tool tool,
struct perf_evsel evsel,
struct perf_sample sample,
struct machine machine 
)
static

Definition at line 1709 of file builtin-sched.c.

◆ process_sched_runtime_event()

static int process_sched_runtime_event ( struct perf_tool tool,
struct perf_evsel evsel,
struct perf_sample sample,
struct machine machine 
)
static

Definition at line 1679 of file builtin-sched.c.

◆ process_sched_switch_event()

static int process_sched_switch_event ( struct perf_tool tool,
struct perf_evsel evsel,
struct perf_sample sample,
struct machine machine 
)
static

Definition at line 1653 of file builtin-sched.c.

Here is the call graph for this function:

◆ process_sched_wakeup_event()

static int process_sched_wakeup_event ( struct perf_tool tool,
struct perf_evsel evsel,
struct perf_sample sample,
struct machine machine 
)
static

Definition at line 1468 of file builtin-sched.c.

◆ register_pid()

static struct task_desc* register_pid ( struct perf_sched sched,
unsigned long  pid,
const char *  comm 
)
static

Definition at line 435 of file builtin-sched.c.

Here is the call graph for this function:

◆ replay_fork_event()

static int replay_fork_event ( struct perf_sched sched,
union perf_event event,
struct machine machine 
)
static

Definition at line 867 of file builtin-sched.c.

Here is the call graph for this function:

◆ replay_switch_event()

static int replay_switch_event ( struct perf_sched sched,
struct perf_evsel evsel,
struct perf_sample sample,
struct machine *machine  __maybe_unused 
)
static

Definition at line 821 of file builtin-sched.c.

Here is the call graph for this function:

◆ replay_wakeup_event()

static int replay_wakeup_event ( struct perf_sched sched,
struct perf_evsel evsel,
struct perf_sample sample,
struct machine *machine  __maybe_unused 
)
static

Definition at line 800 of file builtin-sched.c.

Here is the call graph for this function:

◆ run_one_test()

static void run_one_test ( struct perf_sched sched)
static

Definition at line 736 of file builtin-sched.c.

Here is the call graph for this function:

◆ runtime_cmp()

static int runtime_cmp ( struct work_atoms l,
struct work_atoms r 
)
static

Definition at line 1395 of file builtin-sched.c.

◆ save_idle_callchain()

static void save_idle_callchain ( struct perf_sched sched,
struct idle_thread_runtime itr,
struct perf_sample sample 
)
static

Definition at line 2274 of file builtin-sched.c.

Here is the call graph for this function:

◆ save_task_callchain()

static void save_task_callchain ( struct perf_sched sched,
struct perf_sample sample,
struct perf_evsel evsel,
struct machine machine 
)
static

Definition at line 2131 of file builtin-sched.c.

Here is the call graph for this function:

◆ sched_out_state()

static char sched_out_state ( u64  prev_state)
static

Definition at line 1017 of file builtin-sched.c.

Here is the call graph for this function:

◆ self_open_counters()

static int self_open_counters ( struct perf_sched sched,
unsigned long  cur_task 
)
static

Definition at line 549 of file builtin-sched.c.

Here is the call graph for this function:

◆ setup_color_cpus()

static int setup_color_cpus ( struct perf_sched sched)
static

Definition at line 3211 of file builtin-sched.c.

Here is the call graph for this function:

◆ setup_color_pids()

static int setup_color_pids ( struct perf_sched sched)
static

Definition at line 3194 of file builtin-sched.c.

Here is the call graph for this function:

◆ setup_map_cpus()

static int setup_map_cpus ( struct perf_sched sched)
static

Definition at line 3169 of file builtin-sched.c.

Here is the call graph for this function:

◆ setup_sorting()

static void setup_sorting ( struct perf_sched sched,
const struct option *  options,
const char *const  usage_msg[] 
)
static

Definition at line 3281 of file builtin-sched.c.

Here is the call graph for this function:

◆ show_deadthread_runtime()

static int show_deadthread_runtime ( struct thread t,
void *  priv 
)
static

Definition at line 2729 of file builtin-sched.c.

Here is the call graph for this function:

◆ show_thread_runtime()

static int show_thread_runtime ( struct thread t,
void *  priv 
)
static

Definition at line 2721 of file builtin-sched.c.

Here is the call graph for this function:

◆ sleep_nsecs()

static void sleep_nsecs ( u64  nsecs)
static

Definition at line 302 of file builtin-sched.c.

◆ sort_dimension__add()

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

Definition at line 1405 of file builtin-sched.c.

Here is the call graph for this function:

◆ switch_cmp()

static int switch_cmp ( struct work_atoms l,
struct work_atoms r 
)
static

Definition at line 1385 of file builtin-sched.c.

◆ task_state_char()

static char task_state_char ( struct thread thread,
int  state 
)
static

Definition at line 1976 of file builtin-sched.c.

◆ test_calibrations()

static void test_calibrations ( struct perf_sched sched)
static

Definition at line 782 of file builtin-sched.c.

Here is the call graph for this function:

◆ thread__get_runtime()

static struct thread_runtime* thread__get_runtime ( struct thread thread)
static

Definition at line 921 of file builtin-sched.c.

Here is the call graph for this function:

◆ thread__has_color()

static bool thread__has_color ( struct thread thread)
static

Definition at line 1486 of file builtin-sched.c.

Here is the call graph for this function:

◆ thread__init_runtime()

static struct thread_runtime* thread__init_runtime ( struct thread thread)
static

Definition at line 907 of file builtin-sched.c.

Here is the call graph for this function:

◆ thread_atoms_insert()

static int thread_atoms_insert ( struct perf_sched sched,
struct thread thread 
)
static

Definition at line 1003 of file builtin-sched.c.

Here is the call graph for this function:

◆ thread_atoms_search()

static struct work_atoms* thread_atoms_search ( struct rb_root *  root,
struct thread thread,
struct list_head *  sort_list 
)
static

Definition at line 953 of file builtin-sched.c.

Here is the call graph for this function:

◆ thread_func()

static void* thread_func ( void *  ctx)
static

Definition at line 608 of file builtin-sched.c.

Here is the call graph for this function:

◆ thread_lat_cmp()

static int thread_lat_cmp ( struct list_head *  list,
struct work_atoms l,
struct work_atoms r 
)
static

Definition at line 936 of file builtin-sched.c.

◆ timehist_check_attr()

static int timehist_check_attr ( struct perf_sched sched,
struct perf_evlist evlist 
)
static

Definition at line 2924 of file builtin-sched.c.

Here is the call graph for this function:

◆ timehist_get_commstr()

static char* timehist_get_commstr ( struct thread thread)
static

Definition at line 1894 of file builtin-sched.c.

Here is the call graph for this function:

◆ timehist_get_thread()

static struct thread* timehist_get_thread ( struct perf_sched sched,
struct perf_sample sample,
struct machine machine,
struct perf_evsel evsel 
)
static

Definition at line 2284 of file builtin-sched.c.

Here is the call graph for this function:

◆ timehist_header()

static void timehist_header ( struct perf_sched sched)
static

Definition at line 1917 of file builtin-sched.c.

◆ timehist_migrate_task_event()

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

Definition at line 2472 of file builtin-sched.c.

Here is the call graph for this function:

◆ timehist_print_idlehist_callchain()

static size_t timehist_print_idlehist_callchain ( struct rb_root *  root)
static

Definition at line 2765 of file builtin-sched.c.

Here is the call graph for this function:

◆ timehist_print_migration_event()

static void timehist_print_migration_event ( struct perf_sched sched,
struct perf_evsel evsel,
struct perf_sample sample,
struct machine machine,
struct thread migrated 
)
static

Definition at line 2419 of file builtin-sched.c.

Here is the call graph for this function:

◆ timehist_print_sample()

static void timehist_print_sample ( struct perf_sched sched,
struct perf_evsel evsel,
struct perf_sample sample,
struct addr_location al,
struct thread thread,
u64  t,
int  state 
)
static

Definition at line 1988 of file builtin-sched.c.

Here is the call graph for this function:

◆ timehist_print_summary()

static void timehist_print_summary ( struct perf_sched sched,
struct perf_session session 
)
static

Definition at line 2791 of file builtin-sched.c.

Here is the call graph for this function:

◆ timehist_print_wakeup_event()

static void timehist_print_wakeup_event ( struct perf_sched sched,
struct perf_evsel evsel,
struct perf_sample sample,
struct machine machine,
struct thread awakened 
)
static

Definition at line 2354 of file builtin-sched.c.

Here is the call graph for this function:

◆ timehist_sched_change_event()

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

Definition at line 2500 of file builtin-sched.c.

Here is the call graph for this function:

◆ timehist_sched_switch_event()

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

Definition at line 2626 of file builtin-sched.c.

Here is the call graph for this function:

◆ timehist_sched_wakeup_event()

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

Definition at line 2388 of file builtin-sched.c.

Here is the call graph for this function:

◆ timehist_skip_sample()

static bool timehist_skip_sample ( struct perf_sched sched,
struct thread thread,
struct perf_evsel evsel,
struct perf_sample sample 
)
static

Definition at line 2331 of file builtin-sched.c.

Here is the call graph for this function:

◆ timehist_update_runtime_stats()

static void timehist_update_runtime_stats ( struct thread_runtime r,
u64  t,
u64  tprev 
)
static

Definition at line 2080 of file builtin-sched.c.

Here is the call graph for this function:

◆ wait_for_tasks()

static void wait_for_tasks ( struct perf_sched sched)
static

Definition at line 683 of file builtin-sched.c.

Here is the call graph for this function:

Variable Documentation

◆ comm_width

int comm_width = 30
static

Definition at line 1892 of file builtin-sched.c.

◆ idle_comm

char idle_comm[] = "<idle>"
static

Definition at line 282 of file builtin-sched.c.

◆ idle_max_cpu

int idle_max_cpu
static

Definition at line 281 of file builtin-sched.c.

◆ idle_threads

struct thread** idle_threads
static

Definition at line 280 of file builtin-sched.c.