Linux Perf
futex-wake.c File Reference
#include <string.h>
#include <pthread.h>
#include <signal.h>
#include "../util/stat.h"
#include <subcmd/parse-options.h>
#include <linux/compiler.h>
#include <linux/kernel.h>
#include <linux/time64.h>
#include <errno.h>
#include "bench.h"
#include "futex.h"
#include "cpumap.h"
#include <err.h>
#include <stdlib.h>
#include <sys/time.h>
Include dependency graph for futex-wake.c:

Go to the source code of this file.

Functions

static void * workerfn (void *arg __maybe_unused)
 
static void print_summary (void)
 
static void block_threads (pthread_t *w, pthread_attr_t thread_attr, struct cpu_map *cpu)
 
static void toggle_done (int sig __maybe_unused, siginfo_t *info __maybe_unused, void *uc __maybe_unused)
 
int bench_futex_wake (int argc, const char **argv)
 

Variables

static u_int32_t futex1 = 0
 
static unsigned int nwakes = 1
 
pthread_t * worker
 
static bool done = false
 
static bool silent = false
 
static bool fshared = false
 
static pthread_mutex_t thread_lock
 
static pthread_cond_t thread_parent
 
static pthread_cond_t thread_worker
 
static struct stats waketime_stats wakeup_stats
 
static unsigned int ncpus
 
static unsigned int threads_starting
 
static unsigned int nthreads = 0
 
static int futex_flag = 0
 
static const struct option options []
 
static const char *const bench_futex_wake_usage []
 

Function Documentation

◆ bench_futex_wake()

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

Definition at line 120 of file futex-wake.c.

Here is the call graph for this function:

◆ block_threads()

static void block_threads ( pthread_t *  w,
pthread_attr_t  thread_attr,
struct cpu_map cpu 
)
static

Definition at line 92 of file futex-wake.c.

Here is the call graph for this function:

◆ print_summary()

static void print_summary ( void  )
static

Definition at line 79 of file futex-wake.c.

Here is the call graph for this function:

◆ toggle_done()

static void toggle_done ( int sig  __maybe_unused,
siginfo_t *info  __maybe_unused,
void *uc  __maybe_unused 
)
static

Definition at line 113 of file futex-wake.c.

◆ workerfn()

static void* workerfn ( void *arg  __maybe_unused)
static

Definition at line 61 of file futex-wake.c.

Here is the call graph for this function:

Variable Documentation

◆ bench_futex_wake_usage

const char* const bench_futex_wake_usage[]
static
Initial value:
= {
"perf bench futex wake <options>",
NULL
}

Definition at line 56 of file futex-wake.c.

◆ done

bool done = false
static

Definition at line 41 of file futex-wake.c.

◆ fshared

bool fshared = false
static

Definition at line 41 of file futex-wake.c.

◆ futex1

u_int32_t futex1 = 0
static

Definition at line 32 of file futex-wake.c.

◆ futex_flag

int futex_flag = 0
static

Definition at line 46 of file futex-wake.c.

◆ ncpus

unsigned int ncpus
static

Definition at line 45 of file futex-wake.c.

◆ nthreads

unsigned int nthreads = 0
static

Definition at line 45 of file futex-wake.c.

◆ nwakes

unsigned int nwakes = 1
static

Definition at line 38 of file futex-wake.c.

◆ options

const struct option options[]
static
Initial value:
= {
OPT_UINTEGER('t', "threads", &nthreads, "Specify amount of threads"),
OPT_UINTEGER('w', "nwakes", &nwakes, "Specify amount of threads to wake at once"),
OPT_BOOLEAN( 's', "silent", &silent, "Silent mode: do not display data/details"),
OPT_BOOLEAN( 'S', "shared", &fshared, "Use shared futexes instead of private ones"),
}
static bool fshared
Definition: futex-wake.c:41
static unsigned int nwakes
Definition: futex-wake.c:38
static bool silent
Definition: futex-wake.c:41
static unsigned int nthreads
Definition: futex-wake.c:45

Definition at line 48 of file futex-wake.c.

◆ silent

bool silent = false
static

Definition at line 41 of file futex-wake.c.

◆ thread_lock

pthread_mutex_t thread_lock
static

Definition at line 42 of file futex-wake.c.

◆ thread_parent

pthread_cond_t thread_parent
static

Definition at line 43 of file futex-wake.c.

◆ thread_worker

pthread_cond_t thread_worker
static

Definition at line 43 of file futex-wake.c.

◆ threads_starting

unsigned int threads_starting
static

Definition at line 45 of file futex-wake.c.

◆ wakeup_stats

struct stats waketime_stats wakeup_stats
static

Definition at line 44 of file futex-wake.c.

◆ worker

pthread_t* worker

Definition at line 40 of file futex-wake.c.