On 12/21/21 18:50, Lorenzo Bianconi wrote:
> Use VLOG_INFO_RL in engine_recompute and engine_compute routines
> to log compute time over a given threshold (i.e. 500ms).
> This change will be useful during controller debugging.
> 
> Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1988555
> Signed-off-by: Lorenzo Bianconi <[email protected]>
> ---

Hi Lorenzo,

This works but I have a couple minor comments.

>  lib/inc-proc-eng.c | 27 +++++++++++++++++++++------
>  1 file changed, 21 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/inc-proc-eng.c b/lib/inc-proc-eng.c
> index 2958a55e3..1681fc5ec 100644
> --- a/lib/inc-proc-eng.c
> +++ b/lib/inc-proc-eng.c
> @@ -328,6 +328,7 @@ engine_init_run(void)
>      }
>  }
>  
> +#define ENGINE_COMPUTE_LOG_TO   500 /* ms */

Please move this to the beginning of the file where all declarations are
located.

Please add a prefix to make it explicit that this timeout is in msec, e.g.:

#define ENGINE_COMPUTE_LOG_TO_MS 500 /* ms */

>  /* Do a full recompute (or at least try). If we're not allowed then
>   * mark the node as "aborted".
>   */
> @@ -361,8 +362,15 @@ engine_recompute(struct engine_node *node, bool allowed,
>      long long int now = time_msec();
>      node->run(node, node->data);
>      node->stats.recompute++;
> -    VLOG_DBG("node: %s, recompute (%s) took %lldms", node->name, reason,
> -             time_msec() - now);
> +    long long int delta_time = time_msec() - now;
> +    if (delta_time > ENGINE_COMPUTE_LOG_TO) {

Can we make the timeout configurable?  E.g., through an appctl like
"inc-engine/compute-log-timeout".

Thanks,
Dumitru

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to