public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Andrii Nakryiko <andrii@kernel.org>,
	bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
	martin.lau@kernel.org
Cc: kernel-team@meta.com
Subject: Re: [PATCH v4 bpf-next 2/3] veristat: add -d debug mode option to see debug libbpf log
Date: Wed, 29 Mar 2023 20:37:07 +0300	[thread overview]
Message-ID: <4dfb40c14e1ad9fb2d7903236d0a19bb6b14f06e.camel@gmail.com> (raw)
In-Reply-To: <20230327185202.1929145-3-andrii@kernel.org>

On Mon, 2023-03-27 at 11:52 -0700, Andrii Nakryiko wrote:
> Add -d option to allow requesting libbpf debug logs from veristat.
> 
> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
> ---
>  tools/testing/selftests/bpf/veristat.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/bpf/veristat.c b/tools/testing/selftests/bpf/veristat.c
> index 83231456d3c5..263df32fbda8 100644
> --- a/tools/testing/selftests/bpf/veristat.c
> +++ b/tools/testing/selftests/bpf/veristat.c
> @@ -135,6 +135,7 @@ static struct env {
>  	char **filenames;
>  	int filename_cnt;
>  	bool verbose;
> +	bool debug;
>  	bool quiet;
>  	int log_level;

Nitpick:
  it is now three booleans that control verbosity level, would it be
  better to use numerical level instead?

>  	enum resfmt out_fmt;
> @@ -169,7 +170,7 @@ static int libbpf_print_fn(enum libbpf_print_level level, const char *format, va
>  {
>  	if (!env.verbose)
>  		return 0;
> -	if (level == LIBBPF_DEBUG /* && !env.verbose */)
> +	if (level == LIBBPF_DEBUG  && !env.debug)
>  		return 0;
>  	return vfprintf(stderr, format, args);
>  }
> @@ -186,6 +187,7 @@ static const struct argp_option opts[] = {
>  	{ NULL, 'h', NULL, OPTION_HIDDEN, "Show the full help" },
>  	{ "verbose", 'v', NULL, 0, "Verbose mode" },
>  	{ "log-level", 'l', "LEVEL", 0, "Verifier log level (default 0 for normal mode, 1 for verbose mode)" },
> +	{ "debug", 'd', NULL, 0, "Debug mode (turns on libbpf debug logging)" },
>  	{ "quiet", 'q', NULL, 0, "Quiet mode" },
>  	{ "emit", 'e', "SPEC", 0, "Specify stats to be emitted" },
>  	{ "sort", 's', "SPEC", 0, "Specify sort order" },
> @@ -212,6 +214,10 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
>  	case 'v':
>  		env.verbose = true;
>  		break;
> +	case 'd':
> +		env.debug = true;
> +		env.verbose = true;
> +		break;
>  	case 'q':
>  		env.quiet = true;
>  		break;


  reply	other threads:[~2023-03-29 17:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 18:51 [PATCH v4 bpf-next 0/3] veristat: add better support of freplace programs Andrii Nakryiko
2023-03-27 18:52 ` [PATCH v4 bpf-next 1/3] libbpf: disassociate section handler on explicit bpf_program__set_type() call Andrii Nakryiko
2023-03-27 18:52 ` [PATCH v4 bpf-next 2/3] veristat: add -d debug mode option to see debug libbpf log Andrii Nakryiko
2023-03-29 17:37   ` Eduard Zingerman [this message]
2023-03-29 18:35     ` Andrii Nakryiko
2023-03-27 18:52 ` [PATCH v4 bpf-next 3/3] veristat: guess and substitue underlying program type for freplace (EXT) progs Andrii Nakryiko
2023-03-29 18:36   ` Eduard Zingerman
2023-03-30  5:38     ` Alexei Starovoitov
2023-03-30 14:48       ` Eduard Zingerman
2023-03-30 18:56         ` Andrii Nakryiko
2023-03-30 18:56     ` Andrii Nakryiko
2023-03-28 17:25 ` [PATCH v4 bpf-next 0/3] veristat: add better support of freplace programs Stanislav Fomichev
2023-03-30  0:30 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4dfb40c14e1ad9fb2d7903236d0a19bb6b14f06e.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@meta.com \
    --cc=martin.lau@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox