Received: by 10.213.65.68 with SMTP id h4csp1772924imn; Mon, 19 Mar 2018 12:52:48 -0700 (PDT) X-Google-Smtp-Source: AG47ELtH6DHq49jTD80VyVVQfYtsxNdhn1azb959nXJL+td2qe/2qPSymiGo2oHtXiKH+jlXAt4j X-Received: by 10.98.98.194 with SMTP id w185mr11301134pfb.206.1521489168214; Mon, 19 Mar 2018 12:52:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521489168; cv=none; d=google.com; s=arc-20160816; b=m0IMasHXNmPpnjNdqwEB2jD0H9pe9ozjjMwgym4N4Nh6c8Wxf+cpiunT3VnP5xMxDv KyHSgYniGvIxcNSZTHRyo/vJpoozvBKnEV06uUylIg15oCqmbvYiFGODe23Fn8S6PMby Ql80gWTjPSBidTYy6USkSUWpjo6TwENpeu3Vp/D0MdEvAoLZHKNCbPUsDw79CnzeSL8m W5/vHPTLREpEimaFqjt6s8F+nkz/hH1zuv+oCrQf1DZKK3PJ6q72aIynT5VTMvvJ30Xj D8JVYF0wumVCO7eBP8JxtGE2c9/jSKd1xWOpHuCcsFFehHsVCxuit42uOUsWwIJUmweh oCVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=nktBnKoikKDSiVEENCBOKxGfur9hbNu1LaWmwSz5Ld0=; b=yBFpzhony8I1ID+2Q9CNA/r1OuFTOGt+iIzxktEt8bloCir2630GVmRWwc9+KXF521 j9spOTP+Wr24alBC6udalZAUFLNmGKIizM6FE/Ao5bC2s4HXsGtemVJWrPr6H1dD816T AZT7txq7jg50m3JvcPrY8GVIJfXSDVX8DRuMksh/26sJkOP0nl1EKBQimgmd8MR4bJa+ K/7XgXCEV5254+K8v6JyF2bEwz1qksk+ZwCsrWtNDDFzyOOfglnBG51vU/4MwxmBUOOY O/ESa9KY3tZRRFZVviqg8ELrSSGgSEvR2gqh7idHdE+pdbX6z/WS1r68JOetxBjecsDO Unjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e63si459146pfb.268.2018.03.19.12.52.34; Mon, 19 Mar 2018 12:52:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030917AbeCSSTt (ORCPT + 99 others); Mon, 19 Mar 2018 14:19:49 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47356 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969381AbeCSSTl (ORCPT ); Mon, 19 Mar 2018 14:19:41 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B32EC1192; Mon, 19 Mar 2018 18:19:40 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kefeng Wang , Masami Hiramatsu , Hanjun Guo , Jiri Olsa , Peter Zijlstra , Wang Nan , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.9 042/241] perf probe: Return errno when not hitting any event Date: Mon, 19 Mar 2018 19:05:07 +0100 Message-Id: <20180319180752.941046771@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kefeng Wang [ Upstream commit 70946723eeb859466f026274b29c6196e39149c4 ] On old perf, when using 'perf probe -d' to delete an inexistent event, it returns errno, eg, -bash-4.3# perf probe -d xxx || echo $? Info: Event "*:xxx" does not exist. Error: Failed to delete events. 255 But now perf_del_probe_events() will always set ret = 0, different from previous del_perf_probe_events(). After this, it returns errno again, eg, -bash-4.3# ./perf probe -d xxx || echo $? "xxx" does not hit any event. Error: Failed to delete events. 254 And it is more appropriate to return -ENOENT instead of -EPERM. Signed-off-by: Kefeng Wang Acked-by: Masami Hiramatsu Cc: Hanjun Guo Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Wang Nan Fixes: dddc7ee32fa1 ("perf probe: Fix an error when deleting probes successfully") Link: http://lkml.kernel.org/r/1489738592-61011-1-git-send-email-wangkefeng.wang@huawei.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/perf/builtin-probe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c @@ -442,9 +442,9 @@ static int perf_del_probe_events(struct } if (ret == -ENOENT && ret2 == -ENOENT) - pr_debug("\"%s\" does not hit any event.\n", str); - /* Note that this is silently ignored */ - ret = 0; + pr_warning("\"%s\" does not hit any event.\n", str); + else + ret = 0; error: if (kfd >= 0)