From patchwork Fri Mar 24 14:57:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 95963 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp108941obz; Fri, 24 Mar 2017 08:44:24 -0700 (PDT) X-Received: by 10.98.204.25 with SMTP id a25mr9796903pfg.6.1490370264811; Fri, 24 Mar 2017 08:44:24 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1si2815890pli.337.2017.03.24.08.44.24; Fri, 24 Mar 2017 08:44:24 -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; dkim=fail header.i=@infradead.org; 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 S936488AbdCXPoV (ORCPT + 18 others); Fri, 24 Mar 2017 11:44:21 -0400 Received: from merlin.infradead.org ([205.233.59.134]:58388 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936458AbdCXPoF (ORCPT ); Fri, 24 Mar 2017 11:44:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=jK/m68t7hiLTKE1jpD1vCorjb4aYZueTMb3V5U9Au60=; b=hSdWw3ycCJZembbV1XlncBwvw 0vOf5oPWm5V85Y01E0OvhX7YWjH/LkNfyrJR3LFyKA4qF7n3TvnTix9JmROUIPCFGLNSE11qUscCx OH69GGOEBblX+WylgZpyUWLPM8fBE+WSPILUPPY5ACmcSLDTM5Ka+Xq2SQ41c1O6vo2Ta2cYePkJ3 Z7JDOA34iGUj4xQWjhtQOMxzKl06hrAWs6GSajR9QXBL9ZgqomT+O0aG9uRYTh4jBB1HcyN1C+CMu yKLB/YMGZAeZ/Lg+1HHX62ybt9Osrxve931zhqtv9J0q/33ExfSTK5bKdb5vcmaez5Jn+TfhWNopY Bv8z+yhCA==; Received: from [179.97.44.90] (helo=jouet.infradead.org) by merlin.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1crQjX-00047x-3S; Fri, 24 Mar 2017 15:02:31 +0000 Received: by jouet.infradead.org (Postfix, from userid 1000) id E06C71445C5; Fri, 24 Mar 2017 12:02:27 -0300 (-03) From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Kefeng Wang , Hanjun Guo , Jiri Olsa , Peter Zijlstra , Wang Nan , Arnaldo Carvalho de Melo Subject: [PATCH 02/20] perf probe: Return errno when not hitting any event Date: Fri, 24 Mar 2017 11:57:13 -0300 Message-Id: <20170324145731.29350-3-acme@kernel.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170324145731.29350-1-acme@kernel.org> References: <20170324145731.29350-1-acme@kernel.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by merlin.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kefeng Wang 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 --- tools/perf/builtin-probe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.9.3 diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index 1fcebc31a508..51cdc230f6ca 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c @@ -442,9 +442,9 @@ static int perf_del_probe_events(struct strfilter *filter) } 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)