Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2538078pxb; Fri, 5 Feb 2021 23:29:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJy55nmLdP1Q6BbeEGkwAUb9KxM/svjaCXyrLiHvTYNIz3BlyhcPFG7TqhYFZCy0fH0JLZNm X-Received: by 2002:a17:906:607:: with SMTP id s7mr7669140ejb.301.1612596554886; Fri, 05 Feb 2021 23:29:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612596554; cv=none; d=google.com; s=arc-20160816; b=spfrfEQKN+zO/tL6uGqx6Zoo6243mi00iY/QdlBmNSl2oULjxiIKjBEPZKgkHHVeUC Y+Dr0kgIhZhHfHcoDcywdXYGfhNSYQ8jbaLjr8jHmHxWteELUhBBQp2s6XhyDFEsgTgG ccSOAu/sV3H3BnEMVx6mRuev4Geqvuv9NMP278LEMutLMmGSZ+OCf3BktnHAX1Sgj9yx ECHdbD46zOePMAjLxXTpptJ8FzEgIDKgLIrv/itskiPqJU6X+d/qUhVtEMK5coaeo78z SHp79szLQ+3Lj4oMeDHEuQ/i5c9iUGTFcv6jia1TTjPeOo2h7PdGknMrYeNvPhpkuocC JgJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:reply-to :in-reply-to:references:mime-version:dkim-signature; bh=WAkpmSceCQpOL9g/nb4W8z+4GPryDFavQAvOKJCZ4ec=; b=brTRltxGKYG7OCZrHdMiQnnSmud3PQynMINWdcuoaqLICv85X3bkpWoN1H0ZHuY0iO AJitqC5M9vi4d2J/XY7iMOwBcUJfRVtVgG09yb3fdMbaygcf51Mxzx/CknuzK+WFBQth /eUcFJsyGzCN6ok9WuHNrk2W/p9snhbA/ksl5zGUcmEP4LE+fy8sFSp8qCG6TFGPFLvq qgqjW+oqjfjwrTqFCvZDF+FGkZmPX4H8r7U6Vh9++bZmkIejFGY/T+rvIeOs6/4OhRUB IawfNsSq1GNOw3TeZD688tp+VhDCVrohcy99dHI9zxuaOUZwPb3f9+xbFqXrqhOj095J lbFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NwAb6V1G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id c5si7089975ejz.259.2021.02.05.23.28.51; Fri, 05 Feb 2021 23:29:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NwAb6V1G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229609AbhBFH0z (ORCPT + 99 others); Sat, 6 Feb 2021 02:26:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbhBFH0y (ORCPT ); Sat, 6 Feb 2021 02:26:54 -0500 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1802AC06174A; Fri, 5 Feb 2021 23:26:14 -0800 (PST) Received: by mail-io1-xd30.google.com with SMTP id s24so9645122iob.6; Fri, 05 Feb 2021 23:26:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=WAkpmSceCQpOL9g/nb4W8z+4GPryDFavQAvOKJCZ4ec=; b=NwAb6V1G+IFXjDY2j2EcxBPzs6HFWtDkMW2mZRrYx3hC+p/bXbeP+RdECFiLUGbbQV dgwxhv7stlWzl3ZCYfBvptTMbLJdjgklbAY22It9SJlR67PxOQ9xDrtwAMyNqks19o5m iGsY1xKaN2W3l+FKCqLZENSHycmGH/eUc3WxclUWvT/dJX3V9Uugc9XbVBAzXFTIOBCf rWtViqSegeTtKjDJmtyTW2pgOnEWA9mv25ISVhYBprRJUApAIwwZVQnVDjp6diWfM1AC tIaqESU482JRtGdqPQEjf24k3qcRGRKfoA91Ab3nUvWcqxIafO388gfvdHrdBLP8JeQi cDsQ== 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:reply-to :from:date:message-id:subject:to:cc; bh=WAkpmSceCQpOL9g/nb4W8z+4GPryDFavQAvOKJCZ4ec=; b=W6o/DzpuTNys9wOpjWlnnEsMQu80QZyLbUNT3R12f8gslZFXDcUaRUAASvjCpFguZw RW7hsaeJzXVjGs2we8u6ZpRxO/dqAaBvgFtFwUQ1ohH4S/XunZICyFgi+PANnK4xETON P7h9B51iS9m0VUIzktJ6hGts2dXGaZaQEPayqU0oyhKnrvwV//yU0ynzbkfZJgGEN+J/ fLpcU+BvAW6Rj5YNWY+aJZ/vlcoTYU0ATvYQsrgML6GkRQ6aHQBEh4qeVrx4/8yGdskS xxUEJbpdHuZkRkfD3j4fSF4TDikmn+mn0VGRScESTrKW1/Lu4CCK9v2iACVkucjX5QpS Nf/g== X-Gm-Message-State: AOAM531nU2g8lnxR+g09b4pBUmc80C/12HOEnpFJOl4jaVF4KSaOQBA+ ah4qB7V/sMUHm7wtikDBUhZj7lnEcHrqAbM8wP8= X-Received: by 2002:a05:6638:251:: with SMTP id w17mr8479927jaq.138.1612596373526; Fri, 05 Feb 2021 23:26:13 -0800 (PST) MIME-Version: 1.0 References: <20210204220741.GA920417@kernel.org> <20210205152823.GD920417@kernel.org> <20210205192446.GH920417@kernel.org> In-Reply-To: Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Sat, 6 Feb 2021 08:26:02 +0100 Message-ID: Subject: Re: ERROR: INT DW_ATE_unsigned_1 Error emitting BTF type To: Yonghong Song Cc: Arnaldo Carvalho de Melo , Arnaldo Carvalho de Melo , dwarves@vger.kernel.org, Linux Kernel Mailing List , bpf@vger.kernel.org, Jiri Olsa , Jan Engelhardt , Domenico Andreoli , Matthias Schwarzott , Andrii Nakryiko , Mark Wieelard , Paul Moore , Ondrej Mosnacek , =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= , Tom Stellard Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 5, 2021 at 9:03 PM Yonghong Song wrote: > > > > On 2/5/21 11:24 AM, Arnaldo Carvalho de Melo wrote: > > Em Fri, Feb 05, 2021 at 11:10:08AM -0800, Yonghong Song escreveu: > >> On 2/5/21 11:06 AM, Sedat Dilek wrote: > >>> On Fri, Feb 5, 2021 at 7:53 PM Sedat Dilek wrote: > >>> Grepping through linux.git/tools I guess some BTF tools/libs need to > >>> know what BTF_INT_UNSIGNED is? > > > >> BTF_INT_UNSIGNED needs kernel support. Maybe to teach pahole to > >> ignore this for now until kernel infrastructure is ready. > > > > Yeah, I thought about doing that. > > > >> Not sure whether this information will be useful or not > >> for BTF. This needs to be discussed separately. > > > > Maybe search for the rationale for its introduction in DWARF. > > In LLVM, we have: > uint8_t BTFEncoding; > switch (Encoding) { > case dwarf::DW_ATE_boolean: > BTFEncoding = BTF::INT_BOOL; > break; > case dwarf::DW_ATE_signed: > case dwarf::DW_ATE_signed_char: > BTFEncoding = BTF::INT_SIGNED; > break; > case dwarf::DW_ATE_unsigned: > case dwarf::DW_ATE_unsigned_char: > BTFEncoding = 0; > break; > > I think DW_ATE_unsigned can be ignored in pahole since > the default encoding = 0. A simple comment is enough. > For the followers (here: LLVM v12.0.0-rc1): [ llvm/lib/Target/BPF/BTFDebug.cpp ] BTFTypeInt::BTFTypeInt(uint32_t Encoding, uint32_t SizeInBits, uint32_t OffsetInBits, StringRef TypeName) : Name(TypeName) { // Translate IR int encoding to BTF int encoding. uint8_t BTFEncoding; switch (Encoding) { case dwarf::DW_ATE_boolean: BTFEncoding = BTF::INT_BOOL; break; case dwarf::DW_ATE_signed: case dwarf::DW_ATE_signed_char: BTFEncoding = BTF::INT_SIGNED; break; case dwarf::DW_ATE_unsigned: case dwarf::DW_ATE_unsigned_char: BTFEncoding = 0; break; default: llvm_unreachable("Unknown BTFTypeInt Encoding"); } - Sedat -