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=-6.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 95CB5C433DB for ; Tue, 9 Feb 2021 19:37:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 48F7E64E7D for ; Tue, 9 Feb 2021 19:37:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233680AbhBITgP (ORCPT ); Tue, 9 Feb 2021 14:36:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:52377 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232869AbhBITYk (ORCPT ); Tue, 9 Feb 2021 14:24:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612898535; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Lq3ulMPstfAjyDEy9civCh6EIWyjgx/qxynJZ4PmPe4=; b=YoHnzKs9U1djz3dJprQRSGyk7dySJFA6mVYzRVSMB/IEBrWG3y0W9RsszHZB8/AMy9p2Cw mp0srrUJqiz453uxukgApnPey0JVycvrjRUv8XSS76sqgIQPvow0WHBa6Pq7T7+InWIWGB Gt3SMJ+etkwEjm8q8kGg43j8pb5idRY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-37-ACA2lMuhOwio1Mglt_UuFw-1; Tue, 09 Feb 2021 14:22:13 -0500 X-MC-Unique: ACA2lMuhOwio1Mglt_UuFw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B1A4A1005501; Tue, 9 Feb 2021 19:22:09 +0000 (UTC) Received: from krava (unknown [10.40.192.77]) by smtp.corp.redhat.com (Postfix) with SMTP id 6DAC55D9C0; Tue, 9 Feb 2021 19:22:06 +0000 (UTC) Date: Tue, 9 Feb 2021 20:22:05 +0100 From: Jiri Olsa To: Nathan Chancellor Cc: Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Nick Desaulniers , Networking , bpf , clang-built-linux , Veronika Kabatova , Jiri Olsa , Arnaldo Carvalho de Melo Subject: Re: FAILED unresolved symbol vfs_truncate on arm64 with LLVM Message-ID: References: <20210209052311.GA125918@ubuntu-m3-large-x86> <20210209074904.GA286822@ubuntu-m3-large-x86> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org adding Arnaldo to the loop jirka On Tue, Feb 09, 2021 at 08:06:16PM +0100, Jiri Olsa wrote: > On Tue, Feb 09, 2021 at 05:13:42PM +0100, Jiri Olsa wrote: > > On Tue, Feb 09, 2021 at 04:09:36PM +0100, Jiri Olsa wrote: > > > > SNIP > > > > > > > > > DW_AT_prototyped (true) > > > > > > > DW_AT_type (0x01cfdfe4 "long int") > > > > > > > DW_AT_external (true) > > > > > > > > > > > > > > > > > > > Ok, the problem appears to be not in DWARF, but in mcount_loc data. > > > > > > vfs_truncate's address is not recorded as ftrace-attachable, and thus > > > > > > pahole ignores it. I don't know why this happens and it's quite > > > > > > strange, given vfs_truncate is just a normal global function. > > > > > > > > right, I can't see it in mcount adresses.. but it begins with instructions > > > > that appears to be nops, which would suggest it's traceable > > > > > > > > ffff80001031f430 : > > > > ffff80001031f430: 5f 24 03 d5 hint #34 > > > > ffff80001031f434: 1f 20 03 d5 nop > > > > ffff80001031f438: 1f 20 03 d5 nop > > > > ffff80001031f43c: 3f 23 03 d5 hint #25 > > > > > > > > > > > > > > > > I'd like to understand this issue before we try to fix it, but there > > > > > > is at least one improvement we can make: pahole should check ftrace > > > > > > addresses only for static functions, not the global ones (global ones > > > > > > should be always attachable, unless they are special, e.g., notrace > > > > > > and stuff). We can easily check that by looking at the corresponding > > > > > > symbol. But I'd like to verify that vfs_truncate is ftrace-attachable > > > > > > I'm still trying to build the kernel.. however ;-) > > > > I finally reproduced.. however arm's not using mcount_loc > > but some other special section.. so it's new mess for me > > so ftrace data actualy has vfs_truncate address but with extra 4 bytes: > > ffff80001031f434 > > real vfs_truncate address: > > ffff80001031f430 g F .text 0000000000000168 vfs_truncate > > vfs_truncate disasm: > > ffff80001031f430 : > ffff80001031f430: 5f 24 03 d5 hint #34 > ffff80001031f434: 1f 20 03 d5 nop > ffff80001031f438: 1f 20 03 d5 nop > ffff80001031f43c: 3f 23 03 d5 hint #25 > > thats why we don't match it in pahole.. I checked few other functions > and some have the same problem and some match the function boundary > > those that match don't have that first hint instrucion, like: > > ffff800010321e40 : > ffff800010321e40: 1f 20 03 d5 nop > ffff800010321e44: 1f 20 03 d5 nop > ffff800010321e48: 3f 23 03 d5 hint #25 > > any hints about hint instructions? ;-) > > jirka