Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6210861ybc; Wed, 27 Nov 2019 17:21:55 -0800 (PST) X-Google-Smtp-Source: APXvYqw+x7ipjv9Zuzq9/HODDbmZ/4HPNVW56ZVvQuS5oBcF7o3wSqQzo1xcfQVSYmr1lewlZy90 X-Received: by 2002:aa7:c2da:: with SMTP id m26mr28515856edp.244.1574904115031; Wed, 27 Nov 2019 17:21:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574904115; cv=none; d=google.com; s=arc-20160816; b=JXC4cqgbOSZqrwrX/cVw5R7L3voHMZFUcK/jMY9Qea1Yck6Mu5uNlBmk06QnUcb9+7 WbS3qD6t1Oe2BJfNLy8V0jOYBDxqip1O9rNkShg+bXlbk8+BN+RbOwZUIf75l0os16k/ xvtbr1J7BcmT8vgrDvNM8a6v0sMZdMQHurmdMPrec8+j4j55q5oH6DrX5hl8RYG2PPo2 yuO0H8dlfryuw7+/fqZqiukxYQSUPyQFqxaN5AIF9RmORo8VETg5dyC1q9vGyuQghybe RgOnEtLKtaQVvBAvNlZH0cEUeVeL1sngE4o65cnsuSMtihv8Bq8p8UFrLCq+Q7SCqpSi Iisg== 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=9Nui3t1Giy2hesD3VIS/HTTxWM7eEAwvUXFkykKsTd4=; b=ZEusd2vmulzHntoDwDlJIRUDZUjymcFOgtJK50IsmC0Eil74nRUUauLpCR17JGS6HR FgbNM1x95cDUOFhwPrTZ0Z0ghKuw/MbouauH0CHPJzHoqHggheCq5pY2mv5RJmN+pn+V V1cgK1qcZ/EH9MAyAkxHl+YERaP8ZCf7cIH4LFSK7yIm0G7p7BJAIeANOQlxaBmW+bd9 LWpzCj0fSfT7BItupfferY7TZpKgHqazxMB/ZSEmqUXAYkah0YHRe5oN5+NRDQ4WGm2b dQfKazM4MtO2TRX+jmzWOlZZvvmZ+EO9jcBi/fTY2GX8kqp/gOkSoOUslpGUWGD18cNt wijw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="iK/xry5v"; 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 bs15si11460503edb.408.2019.11.27.17.21.29; Wed, 27 Nov 2019 17:21:55 -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="iK/xry5v"; 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 S1727406AbfK1BUc (ORCPT + 99 others); Wed, 27 Nov 2019 20:20:32 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:33921 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726984AbfK1BUc (ORCPT ); Wed, 27 Nov 2019 20:20:32 -0500 Received: by mail-lj1-f195.google.com with SMTP id m6so19183927ljc.1; Wed, 27 Nov 2019 17:20:30 -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=9Nui3t1Giy2hesD3VIS/HTTxWM7eEAwvUXFkykKsTd4=; b=iK/xry5vgvOHvs3SR0V8wndpNJiEidjl/53X70zbEhk4w24ChLutdZvKbvpaSMglvO kZokQT+pqqq6h/sgBSphWAif4dR+pdUeOtu+CoqKC82404/usmCcTxbkuO/46bJcpFg0 aiR7BdQrLt8Ns0I20pvnnVYkR2Rn0vEmuCiIxJYT22Qu48m2kCxZc4UnPGn16VmpCthe 1JFyKqqMMORGTAxeCY7P/JyziP08QZZHGz5o8CyvdvCWzR1n4GKxbMgUady9jbYcR4Gj 5DsozflKFIPICY1r0d+55juOBVlqEMLsZ5QTA6+PkNR/VsuOJ/wQeNpH7drCsP2pPIeD dzsA== 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=9Nui3t1Giy2hesD3VIS/HTTxWM7eEAwvUXFkykKsTd4=; b=b6HzdwUOr2XnetMDEEeWgMhJs9WXQYzhfAvYJnvNSu+f6ZleN9F1iyKU97NXQZoufc fFA53ljEZFXlbFqlKJlzC84yvlIVhNW7k68Ne9YRkut2EkHVNyqkQLZTwB9iQpItLs5K LzGWuZk9VSQGm0mLnpYDPxHW8zCBmpcJv6aEGQVQqGIO+tJUdedFN9cal8Zh+8eJ7BKC OrkM9+2zajhGV8umquqa4RTTpW8vKll3G+Ggluy+AsqbZ8bjO/ZBRBDSfvvM1KD1RHwH eYY7sAxRbn7n8vV77Y0T+zc1u81WFOyYsYBb+SCJpDuiKJsogC11hjHbvSCyxtH0DMNx UWwQ== X-Gm-Message-State: APjAAAUlhJGBcJ4ZMe8+GpY9ExpPWtvquJdVElQ4GgTTO4SEm+0B9PDZ 94O/zCavJ7IC/ou+8Al74yDiOHPHkPyFhUBZ5+U= X-Received: by 2002:a2e:970a:: with SMTP id r10mr33391991lji.142.1574904029363; Wed, 27 Nov 2019 17:20:29 -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: <58CA150B-D006-48DF-A279-077BA2FFD6EC@kernel.org> From: Alexei Starovoitov Date: Wed, 27 Nov 2019 17:20:17 -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: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.