summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/handle_lat.c
diff options
context:
space:
mode:
authorXavier Simonart <xavier.simonart@intel.com>2019-12-29 18:41:50 +0100
committerXavier Simonart <xavier.simonart@intel.com>2020-01-29 12:12:27 +0100
commit7ef348cff20a6d35fe36bb551e5b1aaa69eded1a (patch)
treeeb3570fbdabd29f6af9e0d695ea8fbd7c8c8f5a5 /VNFs/DPPD-PROX/handle_lat.c
parenta984177b93bd59fec43da19193b8ee5204d92e00 (diff)
Add Latency Distribution display
- Latency Distribution (i.e. histograms) has been added when latency is enabled. - Histograms are now compiled by default. - A bug has also been fixed, which was causing strange behavior in the histograms (due to bucket size being overwritten). - The default bucket size has been changed to "11" which means that the size of each bucket is now (1 cycle << 11) = 2048 cycles = 1 microsecond at 2GHz. It was (1 << (10 - 1)). As there are 128 latency buckets, it is not possible to show all of them on the display. Hence the latency buckets are displayed based on on the assumption that the minimum latency is usually relatively stable and that the maximum latency change more often. - The first empty buckets are not shown (i.e. buckets empty for all tasks) - If more than 15 buckets are non empty, then the buckets are combined, so that a maximum of 15 (bigger) buckets are shown - If less than 15 buckets are non empty, the following (empty) buckets are shown (this avoid seeing every x seconds some columns being added and removed). Change-Id: I27fe6ac0e513a5558e42ff2e74255c55ba79516d Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/handle_lat.c')
-rw-r--r--VNFs/DPPD-PROX/handle_lat.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/VNFs/DPPD-PROX/handle_lat.c b/VNFs/DPPD-PROX/handle_lat.c
index a82e74ad..ef4da319 100644
--- a/VNFs/DPPD-PROX/handle_lat.c
+++ b/VNFs/DPPD-PROX/handle_lat.c
@@ -1,5 +1,5 @@
/*
-// Copyright (c) 2010-2017 Intel Corporation
+// Copyright (c) 2010-2019 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@
#include "prox_shared.h"
#include "prox_port_cfg.h"
-#define DEFAULT_BUCKET_SIZE 10
+#define DEFAULT_BUCKET_SIZE 11
#define ACCURACY_BUFFER_SIZE (2 * ACCURACY_WINDOW)
struct lat_info {
@@ -60,7 +60,7 @@ struct delayed_latency_entry {
uint32_t packet_id;
uint8_t generator_id;
uint64_t pkt_rx_time;
- uint64_t pkt_tx_time;
+ uint64_t pkt_tx_time; // Time written into packets by gen. Unit is TSC >> LATENCY_ACCURACY
uint64_t rx_time_err;
};
@@ -128,6 +128,11 @@ static uint32_t diff_time(uint32_t rx_time, uint32_t tx_time)
return rx_time - tx_time;
}
+uint32_t task_lat_get_latency_bucket_size(struct task_lat *task)
+{
+ return task->lat_test->bucket_size;
+}
+
struct lat_test *task_lat_get_latency_meassurement(struct task_lat *task)
{
if (task->use_lt == task->using_lt)
@@ -453,7 +458,7 @@ static void lat_test_histogram_add(struct lat_test *lat_test, uint64_t lat_tsc)
uint64_t bucket_id = (lat_tsc >> lat_test->bucket_size);
size_t bucket_count = sizeof(lat_test->buckets)/sizeof(lat_test->buckets[0]);
- bucket_id = bucket_id < bucket_count? bucket_id : bucket_count;
+ bucket_id = bucket_id < bucket_count? bucket_id : (bucket_count - 1);
lat_test->buckets[bucket_id]++;
}
@@ -776,8 +781,8 @@ static void init_task_lat(struct task_base *tbase, struct task_args *targ)
task->lt[0].min_lat = -1;
task->lt[1].min_lat = -1;
- task->lt[0].bucket_size = targ->bucket_size - LATENCY_ACCURACY;
- task->lt[1].bucket_size = targ->bucket_size - LATENCY_ACCURACY;
+ task->lt[0].bucket_size = targ->bucket_size;
+ task->lt[1].bucket_size = targ->bucket_size;
if (task->unique_id_pos) {
task_lat_init_eld(task, socket_id);
task_lat_reset_eld(task);