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=-0.9 required=3.0 tests=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 D0747C10DCE for ; Fri, 6 Mar 2020 08:52:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A9492208CD for ; Fri, 6 Mar 2020 08:52:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Z6mDQtTH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726861AbgCFIwI (ORCPT ); Fri, 6 Mar 2020 03:52:08 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:54165 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725941AbgCFIwH (ORCPT ); Fri, 6 Mar 2020 03:52:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583484726; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wp2roWgLdqWzyepKSe0THPInKjX5W7pwk7INZWXYWgk=; b=Z6mDQtTH/Ph72h4jAuyCeYrLcqE7udmsOAIwj2vATya6YB4PUwQGMS5EocMin1Uor8zWNN uf+2+e8xpf7G/d2WI52hUMD4AzxmVK/EwXVU8g89AQNRPxQdC3LQk8c9AVzjE0tujarGRx QhgzqCt97nQIjA8q/8S/wK50lassd4c= 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-206-5v3qxgsVMTCiqaiV7xKwHQ-1; Fri, 06 Mar 2020 03:52:05 -0500 X-MC-Unique: 5v3qxgsVMTCiqaiV7xKwHQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AFAC8801E70; Fri, 6 Mar 2020 08:52:03 +0000 (UTC) Received: from krava (ovpn-205-205.brq.redhat.com [10.40.205.205]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 965C590779; Fri, 6 Mar 2020 08:52:01 +0000 (UTC) Date: Fri, 6 Mar 2020 09:51:58 +0100 From: Jiri Olsa To: Song Liu Cc: Networking , bpf , "quentin@isovalent.com" , Kernel Team , "ast@kernel.org" , "daniel@iogearbox.net" , "arnaldo.melo@gmail.com" , "jolsa@kernel.org" Subject: Re: [PATCH v4 bpf-next 0/4] bpftool: introduce prog profile Message-ID: <20200306085158.GC248782@krava> References: <20200304180710.2677695-1-songliubraving@fb.com> <20200304190807.GA168640@krava> <20200304204158.GD168640@krava> <20200304212931.GE168640@krava> <4C0824FE-37CB-4660-BAE0-0EAE8F6BF8A0@fb.com> <8855C490-F3E3-4FEB-B59E-C529667BDC30@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <8855C490-F3E3-4FEB-B59E-C529667BDC30@fb.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Content-Transfer-Encoding: quoted-printable Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Thu, Mar 05, 2020 at 08:03:53PM +0000, Song Liu wrote: SNIP > >> prog.c:1650:29: error: =E2=80=98struct profiler_bpf=E2=80=99 has no= member named =E2=80=98rodata=E2=80=99 > >> 1650 | __u32 m, cpu, num_cpu =3D obj->rodata->num_cpu; > >> | ^~ > >> prog.c: In function =E2=80=98profile_open_perf_events=E2=80=99: > >> prog.c:1810:19: error: =E2=80=98struct profiler_bpf=E2=80=99 has no= member named =E2=80=98rodata=E2=80=99 > >> 1810 | sizeof(int), obj->rodata->num_cpu * obj->rodata->num_metr= ic); > >> | ^~ > >> prog.c:1810:42: error: =E2=80=98struct profiler_bpf=E2=80=99 has no= member named =E2=80=98rodata=E2=80=99 > >> 1810 | sizeof(int), obj->rodata->num_cpu * obj->rodata->num_metr= ic); > >> | ^~ > >> prog.c:1825:26: error: =E2=80=98struct profiler_bpf=E2=80=99 has no= member named =E2=80=98rodata=E2=80=99 > >> 1825 | for (cpu =3D 0; cpu < obj->rodata->num_cpu; cpu++) { > >> | ^~ > >> prog.c: In function =E2=80=98do_profile=E2=80=99: > >> prog.c:1904:13: error: =E2=80=98struct profiler_bpf=E2=80=99 has no= member named =E2=80=98rodata=E2=80=99 > >> 1904 | profile_obj->rodata->num_cpu =3D num_cpu; > >> | ^~ > >> prog.c:1905:13: error: =E2=80=98struct profiler_bpf=E2=80=99 has no= member named =E2=80=98rodata=E2=80=99 > >> 1905 | profile_obj->rodata->num_metric =3D num_metric; > >> | ^~ > >> make: *** [Makefile:129: prog.o] Error 1 > >=20 > > I guess you need a newer version of clang that supports global data i= n BPF programs.=20 >=20 > Hi Jiri, >=20 > Have you got chance to test this with latest clang?=20 yep, got it compiled with new clang I was testing in on bpftrace programs and couldn't made it work, because it relies on BTF info.. so I got stuck ;-) # bpftool prog profile id 241 duration 3 cycles instructions llc_misses Error: prog FD 3 doesn't have valid btf nit.. ^^^ you could display ID instead of FD in here I need to check if we can provide BTF info for bpftrace programs jirka