Classes | Macros | Functions | Variables
benchmark-udp-pummel.c File Reference
#include "task.h"
#include "uv.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for benchmark-udp-pummel.c:

Go to the source code of this file.

Classes

struct  receiver_state
 
struct  sender_state
 

Macros

#define BASE_PORT   12345
 
#define EXPECTED   "RANG TANG DING DONG I AM THE JAPANESE SANDMAN"
 
#define TEST_DURATION   5000 /* ms */
 
#define X(a, b)
 

Functions

static void alloc_cb (uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)
 
static void close_cb (uv_handle_t *handle)
 
static int pummel (unsigned int n_senders, unsigned int n_receivers, unsigned long timeout)
 
static void recv_cb (uv_udp_t *handle, ssize_t nread, const uv_buf_t *buf, const struct sockaddr *addr, unsigned flags)
 
static void send_cb (uv_udp_send_t *req, int status)
 
static void timeout_cb (uv_timer_t *timer)
 

Variables

static uv_buf_t bufs [5]
 
static unsigned int close_cb_called
 
static int exiting
 
static int n_receivers_
 
static int n_senders_
 
static unsigned int packet_counter = (unsigned int) 1e6
 
static struct receiver_state receivers [1024]
 
static unsigned int recv_cb_called
 
static unsigned int send_cb_called
 
static struct sender_state senders [1024]
 
static int timed
 

Macro Definition Documentation

◆ BASE_PORT

#define BASE_PORT   12345

Definition at line 33 of file benchmark-udp-pummel.c.

◆ EXPECTED

#define EXPECTED   "RANG TANG DING DONG I AM THE JAPANESE SANDMAN"

Definition at line 29 of file benchmark-udp-pummel.c.

◆ TEST_DURATION

#define TEST_DURATION   5000 /* ms */

Definition at line 31 of file benchmark-udp-pummel.c.

◆ X

#define X (   a,
  b 
)
Value:
BENCHMARK_IMPL(udp_pummel_##a##v##b) { \
return pummel(a, b, 0); \
} \
BENCHMARK_IMPL(udp_timed_pummel_##a##v##b) { \
return pummel(a, b, TEST_DURATION); \
}

Definition at line 223 of file benchmark-udp-pummel.c.

Function Documentation

◆ alloc_cb()

static void alloc_cb ( uv_handle_t handle,
size_t  suggested_size,
uv_buf_t buf 
)
static

Definition at line 62 of file benchmark-udp-pummel.c.

◆ close_cb()

static void close_cb ( uv_handle_t handle)
static

Definition at line 129 of file benchmark-udp-pummel.c.

◆ pummel()

static int pummel ( unsigned int  n_senders,
unsigned int  n_receivers,
unsigned long  timeout 
)
static

Definition at line 148 of file benchmark-udp-pummel.c.

◆ recv_cb()

static void recv_cb ( uv_udp_t handle,
ssize_t  nread,
const uv_buf_t buf,
const struct sockaddr *  addr,
unsigned  flags 
)
static

Definition at line 109 of file benchmark-udp-pummel.c.

◆ send_cb()

static void send_cb ( uv_udp_send_t req,
int  status 
)
static

Definition at line 72 of file benchmark-udp-pummel.c.

◆ timeout_cb()

static void timeout_cb ( uv_timer_t timer)
static

Definition at line 135 of file benchmark-udp-pummel.c.

Variable Documentation

◆ bufs

uv_buf_t bufs[5]
static

Definition at line 51 of file benchmark-udp-pummel.c.

◆ close_cb_called

unsigned int close_cb_called
static

Definition at line 57 of file benchmark-udp-pummel.c.

◆ exiting

int exiting
static

Definition at line 59 of file benchmark-udp-pummel.c.

◆ n_receivers_

int n_receivers_
static

Definition at line 50 of file benchmark-udp-pummel.c.

◆ n_senders_

int n_senders_
static

Definition at line 49 of file benchmark-udp-pummel.c.

◆ packet_counter

unsigned int packet_counter = (unsigned int) 1e6
static

Definition at line 47 of file benchmark-udp-pummel.c.

◆ receivers

struct receiver_state receivers[1024]
static

Definition at line 53 of file benchmark-udp-pummel.c.

◆ recv_cb_called

unsigned int recv_cb_called
static

Definition at line 56 of file benchmark-udp-pummel.c.

◆ send_cb_called

unsigned int send_cb_called
static

Definition at line 55 of file benchmark-udp-pummel.c.

◆ senders

struct sender_state senders[1024]
static

Definition at line 52 of file benchmark-udp-pummel.c.

◆ timed

int timed
static

Definition at line 58 of file benchmark-udp-pummel.c.

BENCHMARK_IMPL
#define BENCHMARK_IMPL(name)
Definition: task.h:240
a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
setup.v
v
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:42
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
pummel
static int pummel(unsigned int n_senders, unsigned int n_receivers, unsigned long timeout)
Definition: benchmark-udp-pummel.c:148
TEST_DURATION
#define TEST_DURATION
Definition: benchmark-udp-pummel.c:31


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:04