Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3071446rdh; Mon, 27 Nov 2023 06:04:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFu5asKlIHkJ7P2spTwFHxIu30xS1+Ll2fRtryTptzqjLCs7wO2Lv/ivrJ9XpcHWaT4jovj X-Received: by 2002:a05:6a20:6a07:b0:18a:6639:e331 with SMTP id p7-20020a056a206a0700b0018a6639e331mr20086212pzk.13.1701093870493; Mon, 27 Nov 2023 06:04:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701093870; cv=none; d=google.com; s=arc-20160816; b=hXMsS0JDEGDZIltXyg3YiSl1jmzUNJbdbVcwQafSyIO/lhOs8JWtCT5op5K4hJL/Cn AhIj+fLZ4MTF/8w25s+aqUXM4gxTtnZFRcuwuiYLq6x9TdInT/2mvPFIvyNlHAJRVQ4t oElT/ktLM5PH+o8u4GB9W5PHK9MCdin5FFVlSO9dWKKAAvQN1HdBFdRUlQ1zUz5RJVo5 d6+i1MJSQCZTj8LXcPsMTAMbE8CLnxKz3d2OEVeWtZgK6hx0LRmz9w0QCTe1OQny/xBf nMN8o+JZkRBV59FMLOnrwBgWQT1CY1j8S6gtDfoVKTQ4WWca+Gl3ngnjY8sSzbcx4x3X /MSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3rTm6qnkpyoUbdO9pnPymratIgRDvFcln4lBmuOF0tk=; fh=SIgps5XdV0XNwjZfT2uAI7g3mrspDldK9Qs8qQAfoa4=; b=bs4/1RmI68vO8ZkZ0uE0RloSLdh/fSU/aLA412ltLNnAs+H83bm4p9FNRYCHozhhUX ns/ga/RqFnkIFqEm0rIJR8j+9oSBpQIezaGqXnK9O1E6ASLJHkdjc5I02IcRJNp6HEER pGiV5PjlqjcGimTjAwzLneQKwbBHKcDTHwuC1W/jWXosfd/mASWkynfEm6/9AdhYvCoU AmH3CoWxCkRxz/8TIJOGmsZY/w8nw0vTAYNsYB5G+Ze8fX+GqXO+PP/+oNCmWnzZu7Pq lTIW5cvU44KUCq9nTJueOYycyR6PzVTOddh99KE2sBTh3hyMSngIPKQU3FeEt+BbDvUP Ttsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=StF3J+UU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id f36-20020a635564000000b005be2531664esi9473518pgm.261.2023.11.27.06.04.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 06:04:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=StF3J+UU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 19BC2809E72E; Mon, 27 Nov 2023 06:04:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233421AbjK0OD4 (ORCPT + 99 others); Mon, 27 Nov 2023 09:03:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233658AbjK0OBt (ORCPT ); Mon, 27 Nov 2023 09:01:49 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6C2530D8 for ; Mon, 27 Nov 2023 05:58:59 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90F89C43397; Mon, 27 Nov 2023 13:58:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701093539; bh=VzChugqmxn2FZXPNNk2q4QjwiB/rKZhvHsJJiY0UHmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=StF3J+UU6tCL5CyM81pYCy3Cfu06EKgjhGYYqeHACqc8h3qjo/R5LPj6FxcxdBZCe G6Er7lE1w3KWnu4uBjb276MDK+hyOE3pIYp7mcQ8pEdZmXHVg7TOOawHH6J1xI9AKS zDtlG4tPQkdt4z3GqWfRjGj18AbkrBjoxtLiMkayQDSvAoH891rn+qf9CIckjr9wcX in/nEsaOfuGQNg1AChD8YidvWVArQsZEu3f9zhNSD+M9vMFS4kelrdOtm8rn9JHejX UDw2/iRDniGSfEw3X2uqOnaisb0h3hEmkxA9VdpCjQ7AI/7ReHyzEui18MUg6jVfFj fQufGmB2aP/zg== 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 v3 29/33] tracing/fprobe: Remove nr_maxactive from fprobe Date: Mon, 27 Nov 2023 22:58:53 +0900 Message-Id: <170109353263.343914.17085363307950852857.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <170109317214.343914.4784420430328654397.stgit@devnote2> References: <170109317214.343914.4784420430328654397.stgit@devnote2> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 27 Nov 2023 06:04:15 -0800 (PST) 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 c60d0d9f1a95..59d2ef8d9552 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) @@ -973,12 +971,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]; @@ -999,33 +996,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); @@ -1035,12 +1012,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, @@ -1094,8 +1065,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 */ @@ -1171,8 +1141,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));