From patchwork Mon Dec 18 13:17:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 180417 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1240480dyi; Mon, 18 Dec 2023 05:32:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGZ8rhGRUmUfI4B5K5hVZyanqA0cTGpo95306Sv0P/KM9Zf8zQGeh6xD5Tqa5x2f6X2cm0 X-Received: by 2002:a17:903:2ace:b0:1d3:95c1:622a with SMTP id lw14-20020a1709032ace00b001d395c1622amr2065526plb.117.1702906332960; Mon, 18 Dec 2023 05:32:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702906332; cv=none; d=google.com; s=arc-20160816; b=lMpdQKq3a6QLPXqw4jMRPO8Trk46KrODpOMUU6ABIw3cBVS4Ev/kO/osEAN/pIOMda /y8vpM/iot2BOubtdsLg7EzMkjccSe4eR+3/3hAN/Gcj7v/AasWB51LurTRq3Kv+yzs8 9ttI3yikPU8d5VqUUHKaL4highWCmyhH7AtwVR/7J1S3jiidtnseR6n/o8bQr6RyKdS5 3xFqztfiKkMhPbl/9xXQhTx+QNfGwjqBWUJB3uU4WTJPLrNFB6bymJbW0SCpAYK6V6iS o8P8l9vosIJHS5uXqiR9B5Ql7cRs9UKAXo/gwiKaP/7cPKrZt+VF0sIu1uCbQ9DXv1co gkLg== ARC-Message-Signature: i=1; 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=TfMRFkzBB7vh9il89fw23mjYo+w5nH5084NawZeD+xo=; fh=SIgps5XdV0XNwjZfT2uAI7g3mrspDldK9Qs8qQAfoa4=; b=I7t2WJAzgRwK9A0Lr3E3sKAA35sSXMgFvTx9MQQ9MpVBfbNIUSosmMOLnjfrVsEACB srEKYHjGzUTraJA5pLfyPtnvmG5ckps25IGXSM9Ve+oetPjWfMH1Etl20rVmvpb6YKy7 dO1Hryaz0QuqZoGVHQFuUMroi+Ga662l63tWY0aJUtpx8gRNMZRhrA7/xFk6WI20DZLC Xnk+aHkUyurx8VGxJANu3JOCSE0eso0Qrgg/dS7jQKdo4ca3r5SVVZp551x2dYOBXi1V iI+EYo1af69yy4KYqS8RFKpMaxszJqEqK7sqtNRoX95fz0Cb0LNZpj7A+f5Rf0XNAvJv o11A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=suQeKfEd; spf=pass (google.com: domain of linux-kernel+bounces-3735-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3735-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u9-20020a170902e80900b001cf579f758asi1442158plg.437.2023.12.18.05.32.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 05:32:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3735-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=suQeKfEd; spf=pass (google.com: domain of linux-kernel+bounces-3735-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3735-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 3FF59B22FEC for ; Mon, 18 Dec 2023 13:25:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D34EB76083; Mon, 18 Dec 2023 13:17:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="suQeKfEd" X-Original-To: linux-kernel@vger.kernel.org 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 F2784200A0; Mon, 18 Dec 2023 13:17:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07031C433C8; Mon, 18 Dec 2023 13:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702905448; bh=VVauZgXIlWYIcHDkYwErITV9yot6GwNuKuwbq9iJmVQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=suQeKfEd4Et1eriC7MqeTJy4U4mV/ZUcpOqL/VYKvfYsSiM8AwBMoimy7PSsx6cSD WgyJqFVw9EupEIPPkQ868SQ2J0Y2/HwCfVPO9xNNVUQihTIcsvf+CEw4uSyBtiasOl fSg4X0hrsdFWaNLXqmrBQIzMP1vA9EzdM719G3IvAg3c6s3RLtha2bWn+Kxe7AbXJH RYxud7h6QVaqeobq720dDsH2RT/2prDQon4/+YdshhNdhol55AL0CzoL7OR0FX6W4z 3xCf6sjga9GzcF5G1vR3K4XwWi5htgzvGovC3DzQdH5usQ61DsV3fHzblG+Sy79MxY OdcN9U2Cl09mA== 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 v5 29/34] tracing/fprobe: Remove nr_maxactive from fprobe Date: Mon, 18 Dec 2023 22:17:22 +0900 Message-Id: <170290544164.220107.7621004965571345174.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <170290509018.220107.1347127510564358608.stgit@devnote2> References: <170290509018.220107.1347127510564358608.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: 1785626711056662162 X-GMAIL-MSGID: 1785626711056662162 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 3982626c82e6..22cf51217b81 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));