From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12DB1C432C0 for ; Thu, 28 Nov 2019 01:53:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA5812158A for ; Thu, 28 Nov 2019 01:53:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="q61J3ZTE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728008AbfK1BxV (ORCPT ); Wed, 27 Nov 2019 20:53:21 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:40366 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727911AbfK1BxE (ORCPT ); Wed, 27 Nov 2019 20:53:04 -0500 Received: by mail-lj1-f196.google.com with SMTP id s22so7602309ljs.7; Wed, 27 Nov 2019 17:53:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sjoIpFpRenJ43SEbjdtws32ttw6a5wLdlbCVT5pndaQ=; b=q61J3ZTEbhk/7GIlrL4eaVHPJE03jjQZK5TCfgcz/1DbBt7+9BDIGhNfCOBmpobbJk 6FRxlnkcSmazOdKB4luTKr1i3esan4cF6c5U1fM4YHAtVils6SZuOdmt+ST5f1F2UcOj qtA2qp8e9JWNaLk3rYc1QxU7ijgVjswAo8lEXxVC5umtHjYTuF1/PGrCW5i56dZOp7du PX90rTPy2mFdcAU2W5cZ8nnxAzCz9P/PnpY2xsrcpRuVj+YwvxjVdm8ZvF3zIiNoiPsl E77OQECS0voPkg5X1Y1SScRUFNzWSgxVXH+8xT7Ab3T11c920kzZGfgNzacMfZL/9jIA CEyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sjoIpFpRenJ43SEbjdtws32ttw6a5wLdlbCVT5pndaQ=; b=o/2db4zaaNtzW1cpmTXPk5aOoKckNDi8SS7IBaG5e6RKjMD5lUrn7g18YFgfBG0sxI Or/xrj2lv0ZBQhneKlb00pbzgnO7fQV+3Kgh4kpxkTP1OmxiZk1vLpreoiALNu+fdcK9 g7EelekyvGV9wrbNexN6WhiPf1SBSUB2f8QBDuHEGk1mQTlfBo/Ob9U8ch4kzz+V3P2x yKP8YdbPAVI4+thX9Z7+uxLkfeP2Ili9PZ2Px3GRqQ+hxu9KOFBNG+zlDBjju94wlh2t EwX6PNo4iAzjnlQPoBBzlUc+mCyUGwxLCFDLK8GQaRUl44Hq2mW67hZBJHZRuXUTiitI CHRg== X-Gm-Message-State: APjAAAXK28YHtJUtrUadRrSAdDIrOPlobGjQb1FOvy1LuzrnqkqChK4L ZnJLR9dXQAxhnqwfJhN6FOF2Pg1yhQVGU1qPeUMbfchX X-Google-Smtp-Source: APXvYqxak1JG+XREoRk/MyoRGKdT9xeT7/OZtEGmbWsmKSDSZvhvs9D9Viubh5oOkbK+eLBNy7ZGgHxej6ZoszhbOLo= X-Received: by 2002:a2e:9181:: with SMTP id f1mr2692282ljg.51.1574905982362; Wed, 27 Nov 2019 17:53:02 -0800 (PST) MIME-Version: 1.0 References: <87imn6y4n9.fsf@toke.dk> <20191126183451.GC29071@kernel.org> <87d0dexyij.fsf@toke.dk> <20191126190450.GD29071@kernel.org> <20191126221018.GA22719@kernel.org> <20191126221733.GB22719@kernel.org> <20191126231030.GE3145429@mini-arch.hsd1.ca.comcast.net> <20191126155228.0e6ed54c@cakuba.netronome.com> <20191127013901.GE29071@kernel.org> <2993CDB0-8D4D-4A0C-9DB2-8FDD1A0538AB@kernel.org> <58CA150B-D006-48DF-A279-077BA2FFD6EC@kernel.org> In-Reply-To: From: Alexei Starovoitov Date: Wed, 27 Nov 2019 17:52:51 -0800 Message-ID: Subject: Re: [PATCH] libbpf: Fix up generation of bpf_helper_defs.h To: Arnaldo Carvalho de Melo Cc: Jakub Kicinski , Stanislav Fomichev , Andrii Nakryiko , =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= , Andrii Nakryiko , Adrian Hunter , Alexei Starovoitov , Daniel Borkmann , Jiri Olsa , Martin KaFai Lau , Namhyung Kim , bpf , Networking , linux-perf-users@vger.kernel.org, Linux Kernel Mailing List , Quentin Monnet Content-Type: text/plain; charset="UTF-8" Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Wed, Nov 27, 2019 at 5:26 PM Arnaldo Carvalho de Melo wrote: > > On November 27, 2019 10:20:17 PM GMT-03:00, Alexei Starovoitov wrote: > >On Wed, Nov 27, 2019 at 5:17 PM Arnaldo Carvalho de Melo > > wrote: > >> > >> On November 27, 2019 9:59:15 PM GMT-03:00, Alexei Starovoitov > > wrote: > >> >On Wed, Nov 27, 2019 at 4:50 PM Arnaldo Carvalho de Melo > >> > wrote: > >> >> > >> >> Take it as one, I think it's what should have been in the cset it > >is > >> >fixing, that way no breakage would have happened. > >> > > >> >Ok. I trimmed commit log and applied here: > >> > >>https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git/commit/?id=1fd450f99272791df8ea8e1b0f5657678e118e90 > >> > > >> >What about your other fix and my suggestion there? > >> >(__u64) cast instead of PRI ? > >> >We do this already in two places: > >> >libbpf.c: shdr_idx, (__u64)sym->st_value); > >> >libbpf.c: (__u64)sym.st_value, > >GELF_ST_TYPE(sym.st_info), > >> > >> > >> I'm using the smartphone now, but I thought you first suggested using > >a cast to long, if you mean using %llu + cast to __u64, then should be > >was ugly as using PRI, IOW, should work on both 64 bit and 32 bit. :-) > > > >Yes. I suggested (long) first, but then found two cases in libbpf that > >solve this with (__u64), > >so better to stick to that for consistency. > > If it's already being used elsewhere in lubbpf, it was tested already with the build containers and since nobody complained, go with it :-) Ok. Pushed this fix: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git/commit/?id=7c3977d1e80401b1a25efded698b05d60ee26e31 Likely will send PR for bpf tree to Dave tomorrow.