Re: [PATCH bpf-next v3 3/7] bpftool: Support inline annotations when dumping the CFG of a program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quentin Monnet <quentin@xxxxxxxxxxxxx> writes:

> diff --git a/tools/bpf/bpftool/btf_dumper.c b/tools/bpf/bpftool/btf_dumper.c
> index e7f6ec3a8f35..583aa843df92 100644
> --- a/tools/bpf/bpftool/btf_dumper.c
> +++ b/tools/bpf/bpftool/btf_dumper.c
> @@ -821,3 +821,37 @@ void btf_dump_linfo_json(const struct btf *btf,
>  					BPF_LINE_INFO_LINE_COL(linfo->line_col));
>  	}
>  }
> +
> +static void dotlabel_puts(const char *s)
> +{
> +	for (; *s; ++s) {
> +		switch (*s) {
> +		case '\\':
> +		case '"':
> +		case '{':
> +		case '}':
> +		case '<':
> +		case '>':
> +		case '|':
> +		case ' ':
> +			putchar('\\');
> +			__fallthrough;

Is __fallthrough correct? I see the following compile error on s390 in
linux-next (20230412):

  CC      btf_dumper.o
btf_dumper.c: In function ‘dotlabel_puts’:
btf_dumper.c:838:25: error: ‘__fallthrough’ undeclared (first use in this function); did you mean ‘fallthrough’?
  838 |                         __fallthrough;
      |                         ^~~~~~~~~~~~~

removing the two underscores fixes this.

> +		default:
> +			putchar(*s);
> +		}
> +	}
> +}

Thanks,
Sven




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux