From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E90B23858D37; Tue, 21 Nov 2023 19:37:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E90B23858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700595432; bh=woPx06ieEb2Q0BrtqQRTFkBNX6wLmk39EUgFPkE1j9Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=v/1mK076dCwYgjRjtbUch8bCwWmnkBSxJEGilegYabtbr8Y6KTKsM1/m7lMjGor2i tR4kN80fSwYAs1Bz684m/JekHNfToF210/HMLs2zT2ART5XrdMEoU2tlPn/cJ1G2Le xIzZlOi5C7pBLskfCdh9hluU/oQrZ1eQzS5FQB6Y= From: "jemarch at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/112656] btf: function prototypes generated with name Date: Tue, 21 Nov 2023 19:37:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jemarch at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112656 --- Comment #1 from Jose E. Marchesi --- Smaller reproducer: static void log_event(const char *event_name, void *dev_ptr) { } void lala () { log_event ("foobar", ((void *)0)); } Note that the FUNC_PROTO for log_event seems to be created with a name only= if the function gets inlined: $ bpf-unknown-none-gcc -gbtf -c -O2 foo.c -o foo.o $ bpftool btf dump file foo.o [1] INT 'int' size=3D4 bits_offset=3D0 nr_bits=3D32 encoding=3DSIGNED [2] FUNC_PROTO '(anon)' ret_type_id=3D1 vlen=3D0 [3] FUNC_PROTO 'log_event' ret_type_id=3D1 vlen=3D2 'event_name' type_id=3D6 'dev_ptr' type_id=3D7 [4] INT 'char' size=3D1 bits_offset=3D0 nr_bits=3D8 encoding=3DSIGNED [5] CONST '(anon)' type_id=3D4 [6] PTR '(anon)' type_id=3D5 [7] PTR '(anon)' type_id=3D0 [8] FUNC 'lala' type_id=3D2 linkage=3Dglobal $ bpf-unknown-none-gcc -gbtf -c -O2 -fno-inline foo.c -o foo.o $ /usr/sbin/bpftool btf dump file foo.o [1] INT 'int' size=3D4 bits_offset=3D0 nr_bits=3D32 encoding=3DSIGNED [2] FUNC_PROTO '(anon)' ret_type_id=3D1 vlen=3D0 [3] FUNC_PROTO '(anon)' ret_type_id=3D1 vlen=3D2 'event_name' type_id=3D6 'dev_ptr' type_id=3D7 [4] INT 'char' size=3D1 bits_offset=3D0 nr_bits=3D8 encoding=3DSIGNED [5] CONST '(anon)' type_id=3D4 [6] PTR '(anon)' type_id=3D5 [7] PTR '(anon)' type_id=3D0 [8] FUNC 'lala' type_id=3D2 linkage=3Dglobal [9] FUNC 'log_event' type_id=3D3 linkage=3Dstatic=