Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2722152ybk; Tue, 12 May 2020 06:38:20 -0700 (PDT) X-Google-Smtp-Source: APiQypK76ANGfWPA83xpqujuvhw30kENYCUcKI+SZOn+BVTuiINJm1btus1sdKtdcaTJjJ8LQtFK X-Received: by 2002:a17:906:4e46:: with SMTP id g6mr17181284ejw.36.1589290699984; Tue, 12 May 2020 06:38:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589290699; cv=none; d=google.com; s=arc-20160816; b=mFiJ6wAwPD9or1cDL4ue+wlXc9G1nEAMQa+sJrZ6WXblGV4aDYFlt4Uv5HLB6DP4/d nVx8eqslmJJxtKmBT16VDyEvGEfx3EXHIpx4eYH7K+na/NBdOaB+ux2CK/c7kyFclUUL 5D0xW3FE4zeez+FFpkcirxMen+umu+43j/NKdBkVTCgYMYtDq31FhQCPIawQudv4jOAf Dg6weD19xmqas/XDUW6BjGdVW+aonQfkGPAlI1Bmu9QzblOEL3NZWVF/fN5ZCLFQLclC dIZ2q6FETjdgIaLKt2gRLO7INPkwDCZK4gypIKBhT+N6WBcxF5L4sA0wKUdXKvphxF0+ h6TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Zhd4EclVoiE+Xr9KIfrEkpLY2xHNwgQDIDz5FfT0LGI=; b=Y9BRpJ62Jok05JhL3nn0z+vKY/rw9A7Q7RCicUi5h17SagdkVrajTqBYaSJCPPNsrb fRdosqXcwEJOdv71wZDly6Djj8I7TTrpEx+hdxhxzuMaidPuWh7AJ9FO420Qyjz7Jc2D mLorgGw/1ox+np3xal0trzidQ6/QvBV77N+IgAr3lDI81P35J6U5g+SfHIpB7zfWafYI leM7wkr7xRTq+m0IM/19n/1MKziRU9pQqN44Oh1J3L/805PFcaewpBurLzSxJ0kSTJvV qrNBkom/iA9w/4yeMGsAPsWAGJLKy7vg/B98ukdV9hwehRti9DL1dmhrlvuJqJQjKipa bmuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LfIPGwGQ; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o3si8081423edb.156.2020.05.12.06.37.56; Tue, 12 May 2020 06:38:19 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=LfIPGwGQ; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730085AbgELNgU (ORCPT + 99 others); Tue, 12 May 2020 09:36:20 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:42794 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729568AbgELNgS (ORCPT ); Tue, 12 May 2020 09:36:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589290577; 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=Zhd4EclVoiE+Xr9KIfrEkpLY2xHNwgQDIDz5FfT0LGI=; b=LfIPGwGQ+Zq1R8W+uYuU/3TRSivleNFfQyq3KLQP6uf5BeegdAUlI/WLPRhFSmwTU+KnUo IzrK1UifZnPs/dWA2iWBj/zEmWUGGD/dR/T73cyJx7+H4BBQRMVuzX3KpCk56Z0J7015ZS +t0Fvye1zvn+aiG1qblEbOJ5hY0y6+A= 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-30-OLYvPviWN6yOc43l2QVwWg-1; Tue, 12 May 2020 09:36:13 -0400 X-MC-Unique: OLYvPviWN6yOc43l2QVwWg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2D7C8106BF7E; Tue, 12 May 2020 13:36:12 +0000 (UTC) Received: from krava (unknown [10.40.194.31]) by smtp.corp.redhat.com (Postfix) with SMTP id 1C8E553E3B; Tue, 12 May 2020 13:36:09 +0000 (UTC) Date: Tue, 12 May 2020 15:36:09 +0200 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Adrian Hunter , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan Subject: Re: [PATCH perf/urgent] perf tools: Fix is_bpf_image function logic Message-ID: <20200512133609.GA3158213@krava> References: <20200512122310.3154754-1-jolsa@kernel.org> <20200512133223.GI28888@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200512133223.GI28888@kernel.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 12, 2020 at 10:32:23AM -0300, Arnaldo Carvalho de Melo wrote: > Em Tue, May 12, 2020 at 02:23:10PM +0200, Jiri Olsa escreveu: > > Adrian reported that is_bpf_image is not working the way it was > > intended - passing on trampolines and dispatcher names. Instead > > it returned true for all the bpf names. > > > > The reason even this logic worked properly is that all bpf objects, > > even trampolines and dispatcher, were assigned DSO_BINARY_TYPE__BPF_IMAGE > > binary_type. > > > > The later for bpf_prog objects, the binary_type was fixed in bpf load event > > processing, which is executed after the ksymbol code. > > > > Fixing the is_bpf_image logic, so it properly recognizes trampoline > > and dispatcher objects. > > This is not applying on top of torvalds/master, not tip/perf/urgent, and right.. it's on top of your's perf/core.. I can rebase on perf/urgent > you forgot to add the Fixes: line, lemme try to find this... oops, sorry Fixes: 3c29d4483e85 ("perf annotate: Add basic support for bpf_image") jirka > > - Arnaldo > > > Reported-by: Adrian Hunter > > Signed-off-by: Jiri Olsa > > --- > > tools/perf/util/machine.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c > > index 8ed2135893bb..d5384807372b 100644 > > --- a/tools/perf/util/machine.c > > +++ b/tools/perf/util/machine.c > > @@ -738,8 +738,8 @@ int machine__process_switch_event(struct machine *machine __maybe_unused, > > > > static int is_bpf_image(const char *name) > > { > > - return strncmp(name, "bpf_trampoline_", sizeof("bpf_trampoline_") - 1) || > > - strncmp(name, "bpf_dispatcher_", sizeof("bpf_dispatcher_") - 1); > > + return strncmp(name, "bpf_trampoline_", sizeof("bpf_trampoline_") - 1) == 0 || > > + strncmp(name, "bpf_dispatcher_", sizeof("bpf_dispatcher_") - 1) == 0; > > } > > > > static int machine__process_ksymbol_register(struct machine *machine, > > -- > > 2.25.4 > > > > -- > > - Arnaldo >