[stratum-dev] How to set log levels with -vmodule

Maximilian Pudelko max at opennetworking.org
Thu May 13 00:49:49 UTC 2021


According to this SO <https://stackoverflow.com/a/45920794> post the
-vmodule parameter is based on the source code file name. So
-vmodule=p4_service=2
should print all VLOG(2) and below messages. I don't see a way to limit
ERROR/WARNING/INFO on a per-module
basis, though.

The BFRT code is an entire different topic as it uses its own logging
library without any hooks for us. We're pretty much
limited to letting bfrt print to stdout. The current code enables logging
of a few select modules:
https://github.com/stratum/stratum/blob/main/stratum/hal/lib/barefoot/bf_sde_wrapper.cc#L1514-L1528
But that happened on a as-needed basis without any major planing. Full
integration will require code
changes on the SDE side to allow something like callbacks or streams. Feel
free to lobby for that at Intel :D


Max

On Wed, May 12, 2021 at 3:39 PM Narada Hess via stratum-dev <
stratum-dev at lists.stratumproject.org> wrote:

> Hi All,
>
> I have used -v=<level> successfully in the stratum flags file. But when I
> add -vmodule=<x=y>, it does not seem to take effect. What am I doing wrong?
>
>
>
> Also, how do you set the log levels for the barefoot modules (as opposed
> to the stratum code per se)? Thanks, N
>
>
>
> Separate examples:
>
> -v=5
>
> -vmodule=p4_service=0
>
>
>
> -v=5
>
> -vmodule=”p4_service=0”
>
>
>
> -v=5
>
> -vmodule=bfrt_*=0
>
>
> _______________________________________________
> stratum-dev mailing list
> stratum-dev at lists.stratumproject.org
> https://lists.stratumproject.org/listinfo/stratum-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.stratumproject.org/archives/stratum-dev/attachments/20210512/f92f4466/attachment.html>


More information about the stratum-dev mailing list