Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6235064ybc; Wed, 27 Nov 2019 17:54:48 -0800 (PST) X-Google-Smtp-Source: APXvYqxW4t4vDWr6ifpapvv1/1u9If620LKUZ3dge3jehzuKY6AHFe6Vu2cGodvktUe8OVRtmaGh X-Received: by 2002:a17:906:3107:: with SMTP id 7mr33358110ejx.125.1574906088210; Wed, 27 Nov 2019 17:54:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574906088; cv=none; d=google.com; s=arc-20160816; b=yueclsQIn6M4PrY7cNbdbNzU9YCpYoD1EypivO+lvcr5l4yGupiEliVs8zH5+z2Vqa HLzLlSCWIhLX5ejRoLgAX/Lok16JlHJupGzK3W04oy4qjoH2pWxK8hgL03TWE7QDSZl5 TljnTDTCyqiwPHScqCOlEJ6b1N1c4buV+a0oxvDrNEJ5LKgW8YHvc4e4cBNLrTwXHUXG dnONw0/02223CZcNvjQ4WDYcBut8JIY0PnDNaLnoSitScoUIDJLju3gkTEXuu9TQwvee EyGEGpB8EOz5W3LMhs63DuYXoxHoURbhFp+hISw5Z+Dby9+Hv6Y2oQvsaHg3iEs45x8c hl9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=sjoIpFpRenJ43SEbjdtws32ttw6a5wLdlbCVT5pndaQ=; b=w6fxvF97JKOdfvMpkKJgRae9hCRFcidgPVGVfddt+e9ABCcMUnUbB3ggAv7YkRGhPY pa6mtscREl7Rlm4+PCG2wmZo8oI9qVvVENqvVtVD4bCohra05Lea2gUV4WcHrpjJVMva LcQ1pYfR2TRXwjErpo9qduggZ6riVxfL2Gy50gf+7FWjGkF6dWWWxmSOyMntX6czBF2C HigI/kxWOUWDaP36vlczbpnP6Tf0T44KHt9X2thAn5s5dB80SzGJ5oadC/MZPiURiWXq 0DDZqn4KJYIlbwVEIy5UMFmgOUTFwZu5y94qYuH9gVkqIVbSI7IbKOZJIFI3OQoSUJ/h KGug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=q61J3ZTE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s21si10480446ejv.422.2019.11.27.17.54.24; Wed, 27 Nov 2019 17:54:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=q61J3ZTE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728063AbfK1BxX (ORCPT + 99 others); Wed, 27 Nov 2019 20:53:23 -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-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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.