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=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, 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 B47DBC3B18C for ; Thu, 13 Feb 2020 16:23:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A2CB2082F for ; Thu, 13 Feb 2020 16:23:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="aTN8QghA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727772AbgBMQX6 (ORCPT ); Thu, 13 Feb 2020 11:23:58 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:40445 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727999AbgBMQX5 (ORCPT ); Thu, 13 Feb 2020 11:23:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581611035; 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=i18q2PNF44L0tvEOum/zQP+bXFTOtAUWikKBvD1Xl0I=; b=aTN8QghAxBqaZCI2hEypV2eY7ZAA6/n/1THZk6YF0iAGRdfir46BDZBP4ozpVtSZu46Yg6 ydAOM/baQQQ6YNftfzYQkHZwcLbVXDS8aN6J6MbeKzujSVG+f3zWinV+s9qGqliZGhWsuV dA+irRW7h5WFDQ2iTCuqDGzSFH4GRCQ= 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-321-eTXqlYJSOLi-Ox_QbJVGwg-1; Thu, 13 Feb 2020 11:23:49 -0500 X-MC-Unique: eTXqlYJSOLi-Ox_QbJVGwg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7E6C88018A7; Thu, 13 Feb 2020 16:23:47 +0000 (UTC) Received: from krava (unknown [10.43.17.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A36E25C1BB; Thu, 13 Feb 2020 16:23:44 +0000 (UTC) Date: Thu, 13 Feb 2020 17:23:42 +0100 From: Jiri Olsa To: =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= Cc: Jiri Olsa , Alexei Starovoitov , Daniel Borkmann , Netdev , bpf , Andrii Nakryiko , Yonghong Song , Song Liu , Martin KaFai Lau , Jakub Kicinski , David Miller , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , John Fastabend , Jesper Dangaard Brouer Subject: Re: [PATCH 00/14] bpf: Add trampoline and dispatcher to /proc/kallsyms Message-ID: <20200213162342.GB296320@krava> References: <20200208154209.1797988-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Content-Transfer-Encoding: quoted-printable Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Mon, Feb 10, 2020 at 04:51:08PM +0100, Bj=F6rn T=F6pel wrote: > On Sat, 8 Feb 2020 at 16:42, Jiri Olsa wrote: > > > > hi, > > this patchset adds trampoline and dispatcher objects > > to be visible in /proc/kallsyms. The last patch also > > adds sorting for all bpf objects in /proc/kallsyms. > > >=20 > Thanks for working on this! >=20 > I'm probably missing something with my perf setup; I've applied your > patches, and everything seem to work fine from an kallsyms > perspective: >=20 > # grep bpf_dispatcher_xdp /proc/kallsyms > ... > ffffffffc0511000 t bpf_dispatcher_xdp [bpf] >=20 > However, when I run > # perf top >=20 > I still see the undecorated one: > 0.90% [unknown] [k] 0xffffffffc0511037 >=20 > Any ideas? heya, the code is little rusty and needs some fixing :-\ with the patch below on top of Arnaldo's perf/urgent branch, there's one workaround for now: # perf record --vmlinux /proc/kallsyms=20 ^C[ perf record: Woken up 0 times to write data ] [ perf record: Captured and wrote 18.954 MB perf.data (348693 samples) = ] # perf report --kallsyms /proc/kallsyms | grep bpf_trampoline_13795 0.01% sched-messaging kallsyms [k] = bpf_trampoline_13795 0.00% perf kallsyms [k] = bpf_trampoline_13795 0.00% :47547 kallsyms [k] = bpf_trampoline_13795 0.00% :47546 kallsyms [k] = bpf_trampoline_13795 0.00% :47544 kallsyms [k] = bpf_trampoline_13795 with recent kcore/vmlinux changes we neglected kallsyms fallback, I'm preparing changes that will detect and use it automaticaly jirka --- diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index fb5c2cd44d30..463ada5117f8 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -742,6 +742,7 @@ static int machine__process_ksymbol_register(struct m= achine *machine, map->start =3D event->ksymbol.addr; map->end =3D map->start + event->ksymbol.len; maps__insert(&machine->kmaps, map); + dso__set_loaded(dso); } =20 sym =3D symbol__new(map->map_ip(map, map->start),