From patchwork Tue Feb 6 15:13:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 197505 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1613796dyb; Tue, 6 Feb 2024 07:22:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFtI9di59VYYB7gjs3MyA6HVi149py1VR5eJ/X+SbKcvZmmm0R03NWt1asurjXFoYTY6kil X-Received: by 2002:a05:6402:7c5:b0:560:5c58:dfc4 with SMTP id u5-20020a05640207c500b005605c58dfc4mr2064964edy.1.1707232950832; Tue, 06 Feb 2024 07:22:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707232950; cv=pass; d=google.com; s=arc-20160816; b=mK44lNrT5IY4OGiw4qIGU8oruHmdf64dthj2QoF1fuhtOsh6gzBql/xA1oCEBvwde0 QxoXv2VysO4TiicLgrmdcKUXFxSGO8lvxMK7ZW14kMXoZIzWu7hoBjy4KxfuSmBpAJhZ VkaQ+WrmMB3GwSqe8smjmXmO9JfdgjxUZ0/Dd7bwSGt8njrVcgz4x4zUAaieoCYCacAJ JyQ479si6CS7wFnbu3t/FOnqNdr5d0Ak5SYNgpqS7yJ9UAUeqSPPBWnukVkx/n/m75Ga DlmFFYzVRQP7MV5ZJqLVz+Ry8duAwRp1pFCDI9zIyof4dM2EOoMaIuucfZZi0jf0ZC1m 8hKg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=j926EWqfo0g9vIUVygZM8OTFYJPm6KP/dXgYh+R7ao4=; fh=hYZ9odOhlbS4Lt5xSxaJ6GBbixZepTApesR4vQ9sRdM=; b=KSD5cOq5eJv6El++xXFu7bGf6tRsStSpvWxcCbqEfauTwqAZdZihPpvVYPekH7GIl3 otcArnIF1FxGXbo0C8uZiEloHYUnF0d42Y92AIm4ZTprdIu8EMnRohKzLmU9sfo6Hpfm URQPTdGM5OO/aV3kFYjQJKNQs2E4gwrZtqsgOwwx/C9nYTWNGGeGS0KwNxZcAV9C+Ds3 i5dOvsq8eTy5fNh74Nk12PFffN2NWRAaplvd2IbcQG89UVX3TbyGFnFZ2v2r3CwVCwqA PWa5IDSNvnMqNPTXdzQpf4k+zl4ZYaAgWGCSHtSvZ2S6DlKAMpLULyMW+Ok+api5sUwR E06g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=olbKQznT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55218-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55218-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWcY6YeyElU43I1Yq3oUZBRN+Yj46PK1uSROCSSJp+FwUOMWBV8879/HSFvwSbn3OaobPZDdSzztL0fgJIxyIyiLlozFQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bo15-20020a0564020b2f00b0055ef4fb4170si1232509edb.56.2024.02.06.07.22.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 07:22:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55218-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=olbKQznT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55218-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55218-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4258E1F22414 for ; Tue, 6 Feb 2024 15:22:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E105113C1CC; Tue, 6 Feb 2024 15:13:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="olbKQznT" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07EF8134751; Tue, 6 Feb 2024 15:13:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707232423; cv=none; b=QwFXtlz99IQgt8CDUMaNnfSus0O9IDnjafl5Fh92tS7qxAgrgXkZIzMTQ27jI6jUgMMh/BgmdFJhB0ANgBO+UDXtEtRbYRpf9Uqczn1S8IkNE7NaMrkElo7vYrJLtKUF3zGlogm6NNlj58Km5Vuj5Yhdq7MMqNlhQjX3NFIIRMo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707232423; c=relaxed/simple; bh=V7BE8q0MmiFvaddSn9SJAfAslRoLC7k0iroDoA8t4/U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=hxrF5Fjz7zCN9L8wWZ1o3PbpRIbLo2y/M0TL1WEB+5Z5NBxoapcYreO4zakOq8OQRcEWnWMi6n+BVdGh3PcMbJON5VefpcdFkebnGXuuspDs5HYP/i/xagw9ZfYzh2B9H9KFM11PkhLus7XJ4Olnp0YjcUgmIJpWwy1+6ojshdE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=olbKQznT; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67007C433C7; Tue, 6 Feb 2024 15:13:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707232422; bh=V7BE8q0MmiFvaddSn9SJAfAslRoLC7k0iroDoA8t4/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=olbKQznTE5mHYwrXPgaz/iJTvcrAClApN17NqE5mKbxyOlzRZIHq/madhzYg3ljEO D8jQIYwYtCmeTlwE5gTg5y84ZbjgW0gxCXk65wNgzJM+KqOvlOeE44vc5slYfrL/xW m13XUqvlwFUYfO1+B8RHZ0BiOmmO/v4H8kOL3WtDMghaCK9ED8mmBeVCBhT7vMwTTk 9636QXyBzXsjCBO5XehVtc1CPeHK0OZI2wCDA/Zlb9l4cFNsUqRrPW/VhyjMawA0qG u0T6rWLRZOIFd3/PZ9Nfzt9JkgT7bORHUBVAkACjOsftoQaJZC+LZWUF3xih4pRk6T lLM3hK+AlqMiQ== From: "Masami Hiramatsu (Google)" To: Alexei Starovoitov , Steven Rostedt , Florent Revest Cc: linux-trace-kernel@vger.kernel.org, LKML , Martin KaFai Lau , bpf , Sven Schnelle , Alexei Starovoitov , Jiri Olsa , Arnaldo Carvalho de Melo , Daniel Borkmann , Alan Maguire , Mark Rutland , Peter Zijlstra , Thomas Gleixner , Guo Ren Subject: [PATCH v7 33/36] tracing/fprobe: Remove nr_maxactive from fprobe Date: Wed, 7 Feb 2024 00:13:37 +0900 Message-Id: <170723241719.502590.13823632735930550091.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <170723204881.502590.11906735097521170661.stgit@devnote2> References: <170723204881.502590.11906735097521170661.stgit@devnote2> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790163498991396671 X-GMAIL-MSGID: 1790163498991396671 From: Masami Hiramatsu (Google) Remove depercated fprobe::nr_maxactive. This involves fprobe events to rejects the maxactive number. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v2: - Newly added. --- include/linux/fprobe.h | 2 -- kernel/trace/trace_fprobe.c | 44 ++++++------------------------------------- 2 files changed, 6 insertions(+), 40 deletions(-) diff --git a/include/linux/fprobe.h b/include/linux/fprobe.h index 08b37b0d1d05..c28d06ddfb8e 100644 --- a/include/linux/fprobe.h +++ b/include/linux/fprobe.h @@ -47,7 +47,6 @@ struct fprobe_hlist { * @nmissed: The counter for missing events. * @flags: The status flag. * @entry_data_size: The private data storage size. - * @nr_maxactive: The max number of active functions. (*deprecated) * @entry_handler: The callback function for function entry. * @exit_handler: The callback function for function exit. * @hlist_array: The fprobe_hlist for fprobe search from IP hash table. @@ -56,7 +55,6 @@ struct fprobe { unsigned long nmissed; unsigned int flags; size_t entry_data_size; - int nr_maxactive; int (*entry_handler)(struct fprobe *fp, unsigned long entry_ip, unsigned long ret_ip, struct ftrace_regs *regs, diff --git a/kernel/trace/trace_fprobe.c b/kernel/trace/trace_fprobe.c index 7d2a66135f83..d96de0dbc0cb 100644 --- a/kernel/trace/trace_fprobe.c +++ b/kernel/trace/trace_fprobe.c @@ -375,7 +375,6 @@ static struct trace_fprobe *alloc_trace_fprobe(const char *group, const char *event, const char *symbol, struct tracepoint *tpoint, - int maxactive, int nargs, bool is_return) { struct trace_fprobe *tf; @@ -395,7 +394,6 @@ static struct trace_fprobe *alloc_trace_fprobe(const char *group, tf->fp.entry_handler = fentry_dispatcher; tf->tpoint = tpoint; - tf->fp.nr_maxactive = maxactive; ret = trace_probe_init(&tf->tp, event, group, false); if (ret < 0) @@ -974,12 +972,11 @@ static int __trace_fprobe_create(int argc, const char *argv[]) * FETCHARG:TYPE : use TYPE instead of unsigned long. */ struct trace_fprobe *tf = NULL; - int i, len, new_argc = 0, ret = 0; + int i, new_argc = 0, ret = 0; bool is_return = false; char *symbol = NULL; const char *event = NULL, *group = FPROBE_EVENT_SYSTEM; const char **new_argv = NULL; - int maxactive = 0; char buf[MAX_EVENT_NAME_LEN]; char gbuf[MAX_EVENT_NAME_LEN]; char sbuf[KSYM_NAME_LEN]; @@ -1000,33 +997,13 @@ static int __trace_fprobe_create(int argc, const char *argv[]) trace_probe_log_init("trace_fprobe", argc, argv); - event = strchr(&argv[0][1], ':'); - if (event) - event++; - - if (isdigit(argv[0][1])) { - if (event) - len = event - &argv[0][1] - 1; - else - len = strlen(&argv[0][1]); - if (len > MAX_EVENT_NAME_LEN - 1) { - trace_probe_log_err(1, BAD_MAXACT); - goto parse_error; - } - memcpy(buf, &argv[0][1], len); - buf[len] = '\0'; - ret = kstrtouint(buf, 0, &maxactive); - if (ret || !maxactive) { + if (argv[0][1] != '\0') { + if (argv[0][1] != ':') { + trace_probe_log_set_index(0); trace_probe_log_err(1, BAD_MAXACT); goto parse_error; } - /* fprobe rethook instances are iterated over via a list. The - * maximum should stay reasonable. - */ - if (maxactive > RETHOOK_MAXACTIVE_MAX) { - trace_probe_log_err(1, MAXACT_TOO_BIG); - goto parse_error; - } + event = &argv[0][2]; } trace_probe_log_set_index(1); @@ -1036,12 +1013,6 @@ static int __trace_fprobe_create(int argc, const char *argv[]) if (ret < 0) goto parse_error; - if (!is_return && maxactive) { - trace_probe_log_set_index(0); - trace_probe_log_err(1, BAD_MAXACT_TYPE); - goto parse_error; - } - trace_probe_log_set_index(0); if (event) { ret = traceprobe_parse_event_name(&event, &group, gbuf, @@ -1095,8 +1066,7 @@ static int __trace_fprobe_create(int argc, const char *argv[]) } /* setup a probe */ - tf = alloc_trace_fprobe(group, event, symbol, tpoint, maxactive, - argc, is_return); + tf = alloc_trace_fprobe(group, event, symbol, tpoint, argc, is_return); if (IS_ERR(tf)) { ret = PTR_ERR(tf); /* This must return -ENOMEM, else there is a bug */ @@ -1172,8 +1142,6 @@ static int trace_fprobe_show(struct seq_file *m, struct dyn_event *ev) seq_putc(m, 't'); else seq_putc(m, 'f'); - if (trace_fprobe_is_return(tf) && tf->fp.nr_maxactive) - seq_printf(m, "%d", tf->fp.nr_maxactive); seq_printf(m, ":%s/%s", trace_probe_group_name(&tf->tp), trace_probe_name(&tf->tp));