Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1467501ybt; Thu, 9 Jul 2020 07:46:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUjKBJy4vGMm2XTE0I1m6ZXLEsyfXHl/jVTwpLRIeDZrma0VLuN9IBqdHrOw0RCly/0YHS X-Received: by 2002:a17:906:915:: with SMTP id i21mr58691327ejd.313.1594305979265; Thu, 09 Jul 2020 07:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594305979; cv=none; d=google.com; s=arc-20160816; b=V0MN8wwdFXIP3GaWWsTKwfJLtVpFRd7SXJ93cRMjyjev3mlNNhX+eUN4noJ+Xtil7r BZb6EKRjuCKLjGLyjqO/lQ10NTuPNRpLPpIjqTse2dp/noKCypLEOILWwM++8nZjqWmM LX+sAYVqX5dpFqWarBNhrBeTVodbC1+XdLnyE4VZa9ixYndfkMuxKK9cCvsb9Joxh41m bR05Riyn/NuRQvB2wuNHQXOqd0+tVQgCO9Fp+ViGRPnT4zz2/1Zbco+kc3CfRAmxCXx3 n/uyuzQAc9Sjp9rRqrzGI/pwkd5JomPP7Jnm4/43d7mA4I4tPJwqHl2dvBz/mrRbFv9T KOuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Wazb14eoY5csHacP0wFdnJkN+reaIXVX3HtoStc49JU=; b=LvLqlAk6D31sji+FM1SjcXodycbilA6oIk+591Lg+t2rKTFwvJ76j1WuZNU326LyxE OkdSUkSYhki0eL0vsGCM7UBW6Q8sqtSUOcPEYeIw11S6GLRYyzt6GbZFFRkQ0XiGZN/E H3Gugjk0/bbAD8HXzru11sqZgCSIiKcX5qjcAhNVkTOpLgi3q2OCXGrwaQ+ISUOX4GTe 4d55447BxMXIj87q1i7L/xVdHtTKzeG9NhwrIKlH8JeIsuVGoHdWuSJ6yDVDsY3ZAZvb 6YweoL0VxE12L6+CzjIjPgeoxZXlBSE8/oyw4uaO6aekxG7j1dPsLA2h0adpJ8aRFc10 rLxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@firstfloor.org header.s=mail header.b=IJ4zxh3w; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk14si1932704ejb.640.2020.07.09.07.45.52; Thu, 09 Jul 2020 07:46: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=@firstfloor.org header.s=mail header.b=IJ4zxh3w; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727772AbgGIOp1 (ORCPT + 99 others); Thu, 9 Jul 2020 10:45:27 -0400 Received: from one.firstfloor.org ([193.170.194.197]:36224 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726475AbgGIOp1 (ORCPT ); Thu, 9 Jul 2020 10:45:27 -0400 X-Greylist: delayed 510 seconds by postgrey-1.27 at vger.kernel.org; Thu, 09 Jul 2020 10:45:26 EDT Received: by one.firstfloor.org (Postfix, from userid 503) id 1F20E867DA; Thu, 9 Jul 2020 16:37:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=firstfloor.org; s=mail; t=1594305464; bh=xxUNKBrT5+W3Ou+a/E3ro6XLN+oqaa1s44HJ/vlvdBw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IJ4zxh3w+Tq38/dHIP9kanA5fiNbMVg1gnjueNWa54vaIP6/g5a2DMqJjEOScQYTd J26R5ONYpQhZgG238dAftGchgMr/jLtSzXpC79xCaeHU5jx9/HlqyvvFxcW70GwTOf M+xO3IiJxC4E1QhXU+Fv1iD+EiiWHspe0pZ0GORo= Date: Thu, 9 Jul 2020 07:37:43 -0700 From: Andi Kleen To: Masami Hiramatsu Cc: Arnaldo Carvalho de Melo , Arnaldo Carvalho de Melo , Oleg Nesterov , Srikar Dronamraju , linux-kernel@vger.kernel.org, Andi Kleen , Andi Kleen Subject: Re: [PATCH 2/4] perf-probe: Fix wrong variable warning when the probe point is not found Message-ID: <20200709143743.gux2xsfq4wo2xeo3@two.firstfloor.org> References: <159428201109.56570.3802208017109058146.stgit@devnote2> <159428203219.56570.8289435784233418736.stgit@devnote2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <159428203219.56570.8289435784233418736.stgit@devnote2> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 09, 2020 at 05:07:12PM +0900, Masami Hiramatsu wrote: > Fix a wrong "variable not found" warning when the probe point is > not found in the debuginfo. > Since the debuginfo__find_probes() can return 0 even if it does not > find given probe point in the debuginfo, fill_empty_trace_arg() can > be called with tf.ntevs == 0 and it can warn a wrong warning. > To fix this, reject ntevs == 0 in fill_empty_trace_arg(). > > E.g. without this patch; > > # perf probe -x /lib64/libc-2.30.so -a "memcpy arg1=%di" > Failed to find the location of the '%di' variable at this address. > Perhaps it has been optimized out. > Use -V with the --range option to show '%di' location range. > Added new events: > probe_libc:memcpy (on memcpy in /usr/lib64/libc-2.30.so with arg1=%di) > probe_libc:memcpy (on memcpy in /usr/lib64/libc-2.30.so with arg1=%di) > > You can now use it in all perf tools, such as: > > perf record -e probe_libc:memcpy -aR sleep 1 > > With this; > > # perf probe -x /lib64/libc-2.30.so -a "memcpy arg1=%di" > Added new events: > probe_libc:memcpy (on memcpy in /usr/lib64/libc-2.30.so with arg1=%di) > probe_libc:memcpy (on memcpy in /usr/lib64/libc-2.30.so with arg1=%di) > > You can now use it in all perf tools, such as: > > perf record -e probe_libc:memcpy -aR sleep 1 > > > Reported-by: Andi Kleen > Fixes: cb4027308570 ("perf probe: Trace a magic number if variable is not found") > Cc: stable@vger.kernel.org > Signed-off-by: Masami Hiramatsu Tested-by: Andi Kleen Except for the minor nit on the message all patches look good to me. -Andi