Linux Perf
futex-requeue.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-requeue.c:

Go to the source code of this file.

Functions

static void print_summary (void)
 
static void * workerfn (void *arg __maybe_unused)
 
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_requeue (int argc, const char **argv)
 

Variables

static u_int32_t futex1 = 0
 
static u_int32_t futex2 = 0
 
static unsigned int nrequeue = 1
 
static 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 requeuetime_stats requeued_stats
 
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_requeue_usage []
 

Function Documentation

◆ bench_futex_requeue()

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

Definition at line 114 of file futex-requeue.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 86 of file futex-requeue.c.

Here is the call graph for this function:

◆ print_summary()

static void print_summary ( void  )
static

Definition at line 60 of file futex-requeue.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 107 of file futex-requeue.c.

◆ workerfn()

static void* workerfn ( void *arg  __maybe_unused)
static

Definition at line 73 of file futex-requeue.c.

Here is the call graph for this function:

Variable Documentation

◆ bench_futex_requeue_usage

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

Definition at line 55 of file futex-requeue.c.

◆ done

bool done = false
static

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

◆ fshared

bool fshared = false
static

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

◆ futex1

u_int32_t futex1 = 0
static

Definition at line 31 of file futex-requeue.c.

◆ futex2

u_int32_t futex2 = 0
static

Definition at line 31 of file futex-requeue.c.

◆ futex_flag

int futex_flag = 0
static

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

◆ nrequeue

unsigned int nrequeue = 1
static

Definition at line 37 of file futex-requeue.c.

◆ nthreads

unsigned int nthreads = 0
static

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

◆ options

const struct option options[]
static
Initial value:
= {
OPT_UINTEGER('t', "threads", &nthreads, "Specify amount of threads"),
OPT_UINTEGER('q', "nrequeue", &nrequeue, "Specify amount of threads to requeue 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 silent
Definition: futex-requeue.c:40
static unsigned int nrequeue
Definition: futex-requeue.c:37
static unsigned int nthreads
Definition: futex-requeue.c:44
static bool fshared
Definition: futex-requeue.c:40

Definition at line 47 of file futex-requeue.c.

◆ requeued_stats

struct stats requeuetime_stats requeued_stats
static

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

◆ silent

bool silent = false
static

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

◆ thread_lock

pthread_mutex_t thread_lock
static

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

◆ thread_parent

pthread_cond_t thread_parent
static

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

◆ thread_worker

pthread_cond_t thread_worker
static

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

◆ threads_starting

unsigned int threads_starting
static

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

◆ worker

pthread_t* worker
static

Definition at line 39 of file futex-requeue.c.