Skip to content
Extraits de code Groupes Projets
Valider 05d0e20e rédigé par François De Keersmaeker's avatar François De Keersmaeker
Parcourir les fichiers

Inserted debug message in DEBUG mode only

parent 780a9d8a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -11,8 +11,10 @@ uint32_t old_verdict = verdict;
// Stochastic dropping
uint16_t thread_id = *((uint16_t *) arg);
float random_float = rand_r(&(thread_data[thread_id].seed)) / (RAND_MAX + 1.0);
printf("Random float: %f", random_float);
verdict = (random_float < DROP_PROBA) ? NF_DROP : NF_ACCEPT;
#ifdef DEBUG
printf("Generated random float: %f. Drop probability: %f.\n", random_float, DROP_PROBA);
#endif /* DEBUG */
{% endif %}
#if defined LOG || defined DEBUG
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter