Commit 8045886e authored by Marlene Böhmer's avatar Marlene Böhmer

save state

parent 26d1ad46
Pipeline #3740 passed with stages
in 2 minutes
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#include "socket.h" #include "socket.h"
#include "timer.h" #include "timer.h"
FILE *prrt_debug_log;
static inline prrtPacketLength_t deliver_packet(const PrrtSocket *s, void *buffer, PrrtPacket *packet, struct sockaddr* addr) { static inline prrtPacketLength_t deliver_packet(const PrrtSocket *s, void *buffer, PrrtPacket *packet, struct sockaddr* addr) {
size_t timespec_size = sizeof(struct timespec); size_t timespec_size = sizeof(struct timespec);
prrtPacketLength_t len = 0; prrtPacketLength_t len = 0;
...@@ -136,6 +138,8 @@ PrrtSocket *PrrtSocket_create(prrtByteCount_t maximum_payload_size, prrtTimedelt ...@@ -136,6 +138,8 @@ PrrtSocket *PrrtSocket_create(prrtByteCount_t maximum_payload_size, prrtTimedelt
s->prrtTransmitPace = PrrtPace_create(); s->prrtTransmitPace = PrrtPace_create();
s->prrtReceivePace = PrrtPace_create(); s->prrtReceivePace = PrrtPace_create();
s->appDeliverPace = PrrtPace_create(); s->appDeliverPace = PrrtPace_create();
prrt_debug_log = stderr;
return s; return s;
......
...@@ -9,9 +9,9 @@ PrrtPace* PrrtPace_create(void) { ...@@ -9,9 +9,9 @@ PrrtPace* PrrtPace_create(void) {
PrrtPace* pace = (PrrtPace*) calloc(1, sizeof(PrrtPace)); PrrtPace* pace = (PrrtPace*) calloc(1, sizeof(PrrtPace));
check_mem(pace); check_mem(pace);
prrtTimedelta_t filterLength_us = 2 * 1000 * 1000; // 2 seconds prrtTimedelta_t filterLength_us = 2 * 1000 * 1000; // 2 seconds
pace->internalPace = PrrtPaceFilter_create(filterLength_us, FILTER_TYPE_MAX); pace->internalPace = PrrtPaceFilter_create(filterLength_us, FILTER_TYPE_MIN);
pace->dependentPace = PrrtPaceFilter_create(filterLength_us, FILTER_TYPE_MAX); pace->dependentPace = PrrtPaceFilter_create(filterLength_us, FILTER_TYPE_MIN);
pace->externalPace = PrrtPaceFilter_create(filterLength_us, FILTER_TYPE_MAX); pace->externalPace = PrrtPaceFilter_create(filterLength_us, FILTER_TYPE_MIN);
pace->totalPauseDuration_ns = 0; pace->totalPauseDuration_ns = 0;
pace->initialized = false; pace->initialized = false;
......
...@@ -22,8 +22,10 @@ ...@@ -22,8 +22,10 @@
#define DEBUG_FEEDBACK 0 #define DEBUG_FEEDBACK 0
#define DEBUG_TIMERECEIVER 1 #define DEBUG_TIMERECEIVER 1
extern FILE *prrt_debug_log;
#ifdef DEBUG #ifdef DEBUG
#define debug(DOMAIN, M, ...) do { if (DEBUG_ALL||(DOMAIN)) fprintf(stderr, "DEBUG %-20s %s:%d: " M "\n", #DOMAIN + 6, __FILE__, __LINE__, ##__VA_ARGS__); } while (0) #define debug(DOMAIN, M, ...) do { if (DEBUG_ALL||(DOMAIN)) fprintf(prrt_debug_log, "DEBUG %-20s %s:%d: " M "\n", #DOMAIN + 6, __FILE__, __LINE__, ##__VA_ARGS__); } while (0)
#else #else
#define debug(DOMAIN, M, ...) #define debug(DOMAIN, M, ...)
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment