Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3300139ybb; Tue, 31 Mar 2020 02:24:44 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs4wAGxDdsuSg/pzB7B4kU5RVBSwVwqlY6+WHtHC9kUysj06mlyo0SoQeVqLfP1czy7Vbgp X-Received: by 2002:a4a:240f:: with SMTP id m15mr7461209oof.85.1585646684314; Tue, 31 Mar 2020 02:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585646684; cv=none; d=google.com; s=arc-20160816; b=LWGNuZtUefcL+EMw2JiADPS8IjyJrnHH2BtGdh7vUUh9y49nRfueu+sqfDY+aMZguA 4714L0ipJD4YEbnR6kaYsNIKqND4tiDQzZE2VpB0NOsYvuop7ppNDnPI54phDt1EBEAk 8yKu7cBrwKzvgYzmDGt3ReWRNcfrxFWUjO+R6tiKZg/lUpcXwuZqLYO7Zvk59V4uETHu 30Zxuu1cZHDMzfIlP50LJ1BlCIvaAV6ezRp0OFn8EWZsv3C/tyOqGNfKrdEsP0PEEK9x jGzHT1FdOxU1YZ51AN1sum4s0d6ym9eDjp3Ut5pQPwoZmUyS6PqRi7ceMLcbBRNZ29Bu coPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=K3LtJpPzlGMQpiEE2SXLXhISNftoNKd1bEkwlmA8vpM=; b=wjyJ2smqDSWodbIY1Xmcl98JOLYHGtm+wRR6JUK+7WbZfSbtFxwOJo6zMqTbvUk5vu 73HD16OYyCcrSYO6DXw0Q03BBjwy+cuLW5qvjD/fSpwo84gvLN+gXJyT+U30RQFuKGSy wTb7+d/2S/OMABZ9xc9459NfbZTq1KP5whp6jqMKrElq+RYjin690KaK2pF5DKfalWFX 9ZI8EKCAKpVovyIZVA4FPprOniA46hwiqSVZEjcUMde3339pJM7riW2Vrskb5EKRYACz mntkuaa1sVDuIvUFo0ULAkB21hY85QH+nHvoLuFZOMiJ5Sc4X+IwL1PgH8HFbYC/UtVC FhUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qKlBB3ek; 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 h9si7466390otr.176.2020.03.31.02.24.32; Tue, 31 Mar 2020 02:24:44 -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=pass header.i=@kernel.org header.s=default header.b=qKlBB3ek; 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 S1731036AbgCaJGa (ORCPT + 99 others); Tue, 31 Mar 2020 05:06:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:47860 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730719AbgCaJG2 (ORCPT ); Tue, 31 Mar 2020 05:06:28 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D94FE20787; Tue, 31 Mar 2020 09:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645587; bh=hxaACYMgVkwhDkMiuBu1XAJBQziyl4HbwW2YSQDvWU4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qKlBB3ekxUptMDjgc23y2hFslpuQkRswsUkYBI6ZXkHKCH2GAfsSZWHIDQsA5pQRa d5Am0GLBa6cy1XleF3MCaXnhyZcVioB+/hv58g4pZjxzb83gel+ZNeQL1f+8VBiMho LhwM0QGpJemeJIiywb7qaaDKTh97doz/1RYuXCqI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnaldo Carvalho de Melo , He Zhe , Masami Hiramatsu , Arnaldo Carvalho de Melo , Adrian Hunter , Jiri Olsa , Namhyung Kim Subject: [PATCH 5.5 098/170] perf probe: Fix to delete multiple probe event Date: Tue, 31 Mar 2020 10:58:32 +0200 Message-Id: <20200331085434.639847190@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masami Hiramatsu commit 6b8d68f1ce9266b05a55e93c62923ff51daae4c1 upstream. When we put an event with multiple probes, perf-probe fails to delete with filters. This comes from a failure to list up the event name because of overwrapping its name. To fix this issue, skip to list up the event which has same name. Without this patch: # perf probe -l \* probe_perf:map__map_ip (on perf_sample__fprintf_brstackoff:21@ probe_perf:map__map_ip (on perf_sample__fprintf_brstackoff:25@ probe_perf:map__map_ip (on append_inlines:12@util/machine.c in probe_perf:map__map_ip (on unwind_entry:19@util/machine.c in / probe_perf:map__map_ip (on map__map_ip@util/map.h in /home/mhi probe_perf:map__map_ip (on map__map_ip@util/map.h in /home/mhi # perf probe -d \* "*" does not hit any event. Error: Failed to delete events. Reason: No such file or directory (Code: -2) With it: # perf probe -d \* Removed event: probe_perf:map__map_ip # Fixes: 72363540c009 ("perf probe: Support multiprobe event") Reported-by: Arnaldo Carvalho de Melo Reported-by: He Zhe Signed-off-by: Masami Hiramatsu Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: stable@vger.kernel.org Link: http://lore.kernel.org/lkml/158287666197.16697.7514373548551863562.stgit@devnote2 Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman --- tools/perf/util/probe-file.c | 3 +++ 1 file changed, 3 insertions(+) --- a/tools/perf/util/probe-file.c +++ b/tools/perf/util/probe-file.c @@ -206,6 +206,9 @@ static struct strlist *__probe_file__get } else ret = strlist__add(sl, tev.event); clear_probe_trace_event(&tev); + /* Skip if there is same name multi-probe event in the list */ + if (ret == -EEXIST) + ret = 0; if (ret < 0) break; }