Linux Kernel
3.7.1
|
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
#include <signal.h>
#include <pthread.h>
#include <sched.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <mqueue.h>
#include <popt.h>
Go to the source code of this file.
Data Structures | |
struct | test |
Macros | |
#define | _GNU_SOURCE |
#define | min(a, b) ((a) < (b) ? (a) : (b)) |
#define | MAX_CPUS 64 |
#define | MSG_SIZE 16 |
#define | TEST1_LOOPS 10000000 |
#define | TEST2_LOOPS 100000 |
#define | drain_queue() while (mq_receive(queue, buff, MSG_SIZE, &prio_in) == MSG_SIZE) |
#define | do_untimed_send() |
#define | do_send_recv() |
Functions | |
void | shutdown (int exit_val, char *err_cause, int line_no) |
void | sig_action_SIGUSR1 (int signum, siginfo_t *info, void *context) |
void | sig_action (int signum, siginfo_t *info, void *context) |
void | increase_limits (void) |
void * | fake_cont_thread (void *arg) |
void * | cont_thread (void *arg) |
void | const_prio (int *prio) |
void | inc_prio (int *prio) |
void | dec_prio (int *prio) |
void | random_prio (int *prio) |
void * | perf_test_thread (void *arg) |
int | main (int argc, char *argv[]) |
Variables | |
char * | MAX_MSGS = "/proc/sys/fs/mqueue/msg_max" |
char * | MAX_MSGSIZE = "/proc/sys/fs/mqueue/msgsize_max" |
char * | cpu_option_string |
int | cpus_to_pin [MAX_CPUS] |
int | num_cpus_to_pin |
pthread_t | cpu_threads [MAX_CPUS] |
pthread_t | main_thread |
cpu_set_t * | cpu_set |
int | cpu_set_size |
int | cpus_online |
int | continuous_mode |
int | continuous_mode_fake |
struct rlimit saved_limits | cur_limits |
int | saved_max_msgs |
int | saved_max_msgsize |
int | cur_max_msgs |
int | cur_max_msgsize |
FILE * | max_msgs |
FILE * | max_msgsize |
int | cur_nice |
char * | queue_path = "/mq_perf_tests" |
mqd_t | queue = -1 |
struct mq_attr | result |
int | mq_prio_max |
struct poptOption | options [] |
struct test | test2 [] |
#define _GNU_SOURCE |
Definition at line 23 of file mq_perf_tests.c.
#define do_send_recv | ( | ) |
Definition at line 343 of file mq_perf_tests.c.
#define do_untimed_send | ( | ) |
Definition at line 337 of file mq_perf_tests.c.
Definition at line 334 of file mq_perf_tests.c.
#define MAX_CPUS 64 |
Definition at line 74 of file mq_perf_tests.c.
#define MSG_SIZE 16 |
Definition at line 84 of file mq_perf_tests.c.
#define TEST1_LOOPS 10000000 |
Definition at line 85 of file mq_perf_tests.c.
#define TEST2_LOOPS 100000 |
Definition at line 86 of file mq_perf_tests.c.
Definition at line 373 of file mq_perf_tests.c.
Definition at line 317 of file mq_perf_tests.c.
Definition at line 384 of file mq_perf_tests.c.
Definition at line 304 of file mq_perf_tests.c.
Definition at line 378 of file mq_perf_tests.c.
Definition at line 519 of file mq_perf_tests.c.
Definition at line 535 of file mq_perf_tests.c.
Tests to perform (all done with MSG_SIZE messages):
1) Time to add/remove message with 0 messages on queue 1a) with constant prio 2) Time to add/remove message when queue close to capacity: 2a) with constant prio 2b) with increasing prio 2c) with decreasing prio 2d) with random prio 3) Test limits of priorities honored (double check _SC_MQ_PRIO_MAX)
Definition at line 419 of file mq_perf_tests.c.
Definition at line 390 of file mq_perf_tests.c.
Definition at line 220 of file mq_perf_tests.c.
Definition at line 207 of file mq_perf_tests.c.
int continuous_mode |
Definition at line 87 of file mq_perf_tests.c.
int continuous_mode_fake |
Definition at line 88 of file mq_perf_tests.c.
char* cpu_option_string |
Definition at line 75 of file mq_perf_tests.c.
cpu_set_t* cpu_set |
Definition at line 80 of file mq_perf_tests.c.
int cpu_set_size |
Definition at line 81 of file mq_perf_tests.c.
pthread_t cpu_threads[MAX_CPUS] |
Definition at line 78 of file mq_perf_tests.c.
int cpus_online |
Definition at line 82 of file mq_perf_tests.c.
Definition at line 76 of file mq_perf_tests.c.
Definition at line 90 of file mq_perf_tests.c.
int cur_max_msgs |
Definition at line 92 of file mq_perf_tests.c.
int cur_max_msgsize |
Definition at line 92 of file mq_perf_tests.c.
int cur_nice |
Definition at line 94 of file mq_perf_tests.c.
pthread_t main_thread |
Definition at line 79 of file mq_perf_tests.c.
Definition at line 70 of file mq_perf_tests.c.
FILE* max_msgs |
Definition at line 93 of file mq_perf_tests.c.
Definition at line 71 of file mq_perf_tests.c.
FILE * max_msgsize |
Definition at line 93 of file mq_perf_tests.c.
int mq_prio_max |
Definition at line 98 of file mq_perf_tests.c.
int num_cpus_to_pin |
Definition at line 77 of file mq_perf_tests.c.
struct poptOption options[] |
Definition at line 100 of file mq_perf_tests.c.
Definition at line 96 of file mq_perf_tests.c.
char* queue_path = "/mq_perf_tests" |
Definition at line 95 of file mq_perf_tests.c.
Definition at line 97 of file mq_perf_tests.c.
int saved_max_msgs |
Definition at line 91 of file mq_perf_tests.c.
int saved_max_msgsize |
Definition at line 91 of file mq_perf_tests.c.
Definition at line 395 of file mq_perf_tests.c.