Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp993951ybt; Fri, 19 Jun 2020 20:55:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyi7WNK15/MD8Pur0URqV+kh056Sogi65n5+U3UIgah60XTh5mIzUFREcfdnFFeCQDF4B22 X-Received: by 2002:a50:cfc4:: with SMTP id i4mr6306785edk.252.1592625341120; Fri, 19 Jun 2020 20:55:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592625341; cv=none; d=google.com; s=arc-20160816; b=WARiueUCofxkz5/e7Qs2aZpu6hIDecjz/uZZo77eY4EoYZ6/AUg3nzBFRyUG10QSl+ 9N9rIVVV+rCKlWmjq8akJbnmxOW997H/1NbsA6b8Gi7PRd1bSQvbav3+tpZuKyqrnYye svE4lfxKss6YSg650jxTQWFXokLXIq9dzSRikk377NaAkFMFP1Ol91wZPLRM0T9bDt80 hlhMaVAEvLF6scPOqJu6Yy11vaORR9ApXRK1xCmgQr9I77ZS9fec2YetKdjAwlS3ebwH txQVqR6K/XC9RgniUxPyLJ0oJeVeXZEPkO/5Abr8nMPOmJ2LEjujSnmiEwTszzNDNxkM IMjw== 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=Z+klMCbUJWC0qdXPX8h+Cia8oLfmpiuZvksVGR0h05A=; b=r7oyK/hCBlWyp6Ii+dDw9YkYbuxF5FP1xQrptvE1ba0Ar3SZA0LYGzwnj/YNHmFKGA lir2JmSFuBQIJNxGvuxu7FBe7To3ib39n5NC3uezma1yQooHCQJpYs+os59JBjzE9d3m JtVRd25L3IKsCa0OBmY/3hBBunqmFWQNRLOVNiGOLLDGUrtJle651Hd3ioy/iC9rmmMz 4SJZjsIaNy7/qrwJfSF/OG19DXV2HlnpIPtdDnIn+UENZQw5IxML7E264j1wcuTFPODx pVSHM/hjMKxRtKZsQa+kDJtOZVa2EFVkXpbkIcPq58MhabcD4nJKX0kfLFiOyZZqMIz/ NiLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gApwQ8fU; 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 di10si4806229edb.84.2020.06.19.20.55.19; Fri, 19 Jun 2020 20:55:41 -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=@kernel.org header.s=default header.b=gApwQ8fU; 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 S2394822AbgFSQ2Q (ORCPT + 99 others); Fri, 19 Jun 2020 12:28:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:50222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389567AbgFSOzX (ORCPT ); Fri, 19 Jun 2020 10:55:23 -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 DE742206F7; Fri, 19 Jun 2020 14:55:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592578523; bh=iA6IPZ+8Tod7dXsCMS4bm29UsmZAqdxGD/VBkEX85WA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gApwQ8fUuMkPGQUol59wztbqLeKv//5cxY6FZgS+f4i4MAiTJsgWnRJsxKsoV7GRc 4+prbIyD+jy3kFCkx/XZ0bfSWWm7TM+IfkifuLRTnMZLgfCMeyCaxXrIrB3My9EpPI L0TeeTHqdOOZ8GpvsInaJPSODDApBhHfiHm3lzgw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yuxuan Shui , Masami Hiramatsu , Jiri Olsa , Namhyung Kim , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.19 024/267] perf probe: Accept the instance number of kretprobe event Date: Fri, 19 Jun 2020 16:30:09 +0200 Message-Id: <20200619141650.031116312@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141648.840376470@linuxfoundation.org> References: <20200619141648.840376470@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 [ Upstream commit c6aab66a728b6518772c74bd9dff66e1a1c652fd ] Since the commit 6a13a0d7b4d1 ("ftrace/kprobe: Show the maxactive number on kprobe_events") introduced to show the instance number of kretprobe events, the length of the 1st format of the kprobe event will not 1, but it can be longer. This caused a parser error in perf-probe. Skip the length check the 1st format of the kprobe event to accept this instance number. Without this fix: # perf probe -a vfs_read%return Added new event: probe:vfs_read__return (on vfs_read%return) You can now use it in all perf tools, such as: perf record -e probe:vfs_read__return -aR sleep 1 # perf probe -l Semantic error :Failed to parse event name: r16:probe/vfs_read__return Error: Failed to show event list. And with this fixes: # perf probe -a vfs_read%return ... # perf probe -l probe:vfs_read__return (on vfs_read%return) Fixes: 6a13a0d7b4d1 ("ftrace/kprobe: Show the maxactive number on kprobe_events") Reported-by: Yuxuan Shui Signed-off-by: Masami Hiramatsu Tested-by: Yuxuan Shui Cc: Jiri Olsa Cc: Namhyung Kim Cc: stable@vger.kernel.org Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=207587 Link: http://lore.kernel.org/lkml/158877535215.26469.1113127926699134067.stgit@devnote2 Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/probe-event.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index a22e1f538aea..4dd79e08cb7b 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -1753,8 +1753,7 @@ int parse_probe_trace_command(const char *cmd, struct probe_trace_event *tev) fmt1_str = strtok_r(argv0_str, ":", &fmt); fmt2_str = strtok_r(NULL, "/", &fmt); fmt3_str = strtok_r(NULL, " \t", &fmt); - if (fmt1_str == NULL || strlen(fmt1_str) != 1 || fmt2_str == NULL - || fmt3_str == NULL) { + if (fmt1_str == NULL || fmt2_str == NULL || fmt3_str == NULL) { semantic_error("Failed to parse event name: %s\n", argv[0]); ret = -EINVAL; goto out; -- 2.25.1