mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Okash Khawaja <osk@fb.com>, Martin KaFai Lau <kafai@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>, Yonghong Song <yhs@fb.com>,
	"Quentin Monnet" <quentin.monnet@netronome.com>,
	"David S. Miller" <davem@davemloft.net>, <netdev@vger.kernel.org>,
	<kernel-team@fb.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH bpf-next v2 2/3] bpf: btf: add btf print functionality
Date: Tue, 3 Jul 2018 15:38:43 -0700	[thread overview]
Message-ID: <20180703153843.7a3425af@cakuba.netronome.com> (raw)
In-Reply-To: <20180703152331.151d1c4b@cakuba.netronome.com>

On Tue, 3 Jul 2018 15:23:31 -0700, Jakub Kicinski wrote:
> > > > +			else
> > > > +				jsonw_printf(jw, "%hhd", *((char *)data));    
> > > 
> > > ... I think you need to always print a string, and express it as
> > > \u00%02hhx for non-printable.    
> > Okay that makes sense  
> 
> Yeah, IDK, char can be used as a byte as well as a string.  In eBPF
> it may actually be more likely to just be used as a raw byte buffer...

Actually, what is the definition/purpose of BTF_INT_CHAR?  There seems
to be no BTF_INT_SHORT and BTF_INT_SIGNED can simply be of size 8...
Is normal int only used for bitfields of size 8 and BTF_INT_CHAR for
char variables?

The kernel seems to be rejecting combinations of those flags, is
unsigned char going to not be marked as char then?

> Either way I think it may be nice to keep it consistent, at least for
> the JSON output could we do either always ints or always characters?


  reply	other threads:[~2018-07-03 22:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02 18:39 [PATCH bpf-next v2 0/3] bpf: btf: print bpftool map data with btf Okash Khawaja
2018-07-02 18:39 ` [PATCH bpf-next v2 2/3] bpf: btf: add btf print functionality Okash Khawaja
2018-07-03  5:06   ` Jakub Kicinski
2018-07-03 21:46     ` Okash Khawaja
2018-07-03 22:23       ` Jakub Kicinski
2018-07-03 22:38         ` Jakub Kicinski [this message]
2018-07-03 23:33           ` Martin KaFai Lau
2018-07-07 13:30             ` Okash Khawaja
2018-07-07 18:49               ` Jakub Kicinski
2018-07-04 16:31         ` Okash Khawaja
2018-07-02 18:39 ` [PATCH bpf-next v2 3/3] bpf: btf: print map dump and lookup with btf info Okash Khawaja
2018-07-03  5:29   ` Jakub Kicinski
     [not found] ` <20180702191324.476855192@fb.com>
2018-07-03  4:07   ` [PATCH bpf-next v2 1/3] bpf: btf: export btf types and name by offset from lib Jakub Kicinski

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=20180703153843.7a3425af@cakuba.netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=kafai@fb.com \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=osk@fb.com \
    --cc=quentin.monnet@netronome.com \
    --cc=yhs@fb.com \
    /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

all inboxes | Powered by JetHome®