Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2745725ybk; Tue, 12 May 2020 07:11:05 -0700 (PDT) X-Google-Smtp-Source: APiQypK+F4vpt730ufKuNBijKefL1buGv3CMQ+CkUuvgauZOMvTe/APjIBsYmBwtIubUe9aWA0CG X-Received: by 2002:a17:906:a39a:: with SMTP id k26mr17110287ejz.172.1589292665612; Tue, 12 May 2020 07:11:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589292665; cv=none; d=google.com; s=arc-20160816; b=cGWPBdC8SiLvYn/5Ereui6J4Xqayz2X/WXvjQ0/gVORt4Yz6MMgOt711mLgD6hwG46 /wiuQOUkcON+zQlCB8M3amsQsAeChS4kzuQGXgaGPqF2AN/b09Pk2K/S0C+anLxvfRRu whXryMu01Ise602G40El1FYJ4Z01On/fqXLkpRllp1wrxrSm2GXsImqQcCUcsyd2f9YO keIFztlPMSqxNQbLZNlDRndyzA12/odeLxYCEpTKSu0JqRMoqtka+BgWwDLnShP5XO0Q 0IRsjL5MM8oS+RFMbuyX9Fv+ltk6b4pu6ECxvR8rgYIINJmAsV0uYU7sSgHHdGFebT5D WC+Q== 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:date:from :dkim-signature; bh=6/uIsxWQn8xUBY6PuZWN340e2D798d3iUe7b5tSjlu4=; b=rjw8N/IMoUD4q7X4Ek0dN+zyw6YlvEdik1lkUfCm5FkZf8yRPn72yuNb/w+a5j/Scf YOI2QMCISGPDbY0al4Aq0GykpcP6elwTUqRAYOS+m9A843xbKb5uOo6lVyOtstYKa7W4 HUI0vV4LjCsLXr/3eGkEoP6HkGZnOfo7Ad04gVsTpyOVAKZEeu6VlOHB3okYzAMzdSJr 36UUH4BIfPz0ForhB20grZbtZucdExyxn1lly0t5hUxCV7VGjR5hlY7eMBw4WcGQPF2N 5xDOd0b+Ahu7fEpis6FxMnT5nZEQUZsmkOjdpNf8rzX69lcvn8RPMiHJltGVJ4gj88g0 B8bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jZUEDTd9; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b5si8964247edq.191.2020.05.12.07.10.41; Tue, 12 May 2020 07:11:05 -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=@gmail.com header.s=20161025 header.b=jZUEDTd9; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730138AbgELOJI (ORCPT + 99 others); Tue, 12 May 2020 10:09:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727859AbgELOJH (ORCPT ); Tue, 12 May 2020 10:09:07 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 646EBC061A0C for ; Tue, 12 May 2020 07:09:07 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id y22so1019711qki.3 for ; Tue, 12 May 2020 07:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=6/uIsxWQn8xUBY6PuZWN340e2D798d3iUe7b5tSjlu4=; b=jZUEDTd9Pbyxy86CFcIgLT3Xq+vWSzd+naUcc1wuiyzIb19DQ3oPCcriApygsVi/fK zrkvdQQXLd6B5ygxVuuhgIOblr764uGadJG12herxFL/OnZGWAxs3AvytnCp8AYjkLf9 AqJY1azQlzlJSaWOHOh83tez8n8MOC1Lhlcr8pfzy4pFO+ZVJgEfNTTF7+NOEnnregS6 peS9ohxm1hfKJkiszWpAM9KzYzMWIFOwR7vHD7sgXhvWOSJWTH2ozLigW6NH09vYbwLN SMFUzsAxlvufVKdXZJNvlCMtJBQZRNj+v8sT1B9SkK0Ex2ZfMMvilbOHJg2Xk4NBWnVB Huog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6/uIsxWQn8xUBY6PuZWN340e2D798d3iUe7b5tSjlu4=; b=lghNUfFVKfqkdHwudpcyLH3Yoj9Cj31jrDwfVp3zlCXo3KQQpfdyA8eWZ9f18er3/N mTjGMLhbR1+mxWi8TRtJio5oiKwwr39eMQVKpKSZO4ERP+3CbTvHV24T930evA9LH2Ia SO7D2+yaO+01wi1qJIgzxiOn7C/98zKBwdf+k1SVNDGrN4F9/NkqL/QwT9TYPR8foMGq yT0s1pn7diTNYFZYjCLYcbCMtAbmiX03nA3Y+E9zYTY1UOE9fgOF71ntGJV2zlR1RrAW isfDqFpgRxr1sxWIGTBKpQGVywmgvVn/sX6DXbzPipxVGPzj1Hg3+r2E4KGq1wJatIby pJJg== X-Gm-Message-State: AGi0PuboAbUR2S8rSooEDtjkuM241+m4Te5NRLAEx9Q+N+ovtokVaa5d XaLKeWBkrTRyC2C2YOJ66PyfJtfHXJg= X-Received: by 2002:a05:620a:816:: with SMTP id s22mr21389690qks.348.1589292546495; Tue, 12 May 2020 07:09:06 -0700 (PDT) Received: from quaco.ghostprotocols.net ([179.97.37.151]) by smtp.gmail.com with ESMTPSA id c25sm5880872qkm.119.2020.05.12.07.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2020 07:09:06 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id D1EB740AFD; Tue, 12 May 2020 11:09:02 -0300 (-03) Date: Tue, 12 May 2020 11:09:02 -0300 To: Jiri Olsa 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: <20200512140902.GK28888@kernel.org> References: <20200512122310.3154754-1-jolsa@kernel.org> <20200512133223.GI28888@kernel.org> <20200512133609.GA3158213@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200512133609.GA3158213@krava> X-Url: http://acmel.wordpress.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, May 12, 2020 at 03:36:09PM +0200, Jiri Olsa escreveu: > 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 don't need to, this hasn't hit torvalds/master, it'll be in the next merge window, the one for 5.8. > > you forgot to add the Fixes: line, lemme try to find this... > > oops, sorry > >Fixes: 3c29d4483e85 ("perf annotate: Add basic support for bpf_image") I did it already, and: [acme@five perf]$ git tag --contains 3c29d4483e85 perf-core-for-mingo-5.8-20200420 perf-core-for-mingo-5.8-20200506 perf-for-bpf-2020-05-06 [acme@five perf]$ So can't go to perf/urgent at the moment. - Arnaldo > 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 > > > -- - Arnaldo