From patchwork Fri Dec 8 10:30:07 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: 175757 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5364676vqy; Fri, 8 Dec 2023 02:31:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IFMmnp8ldvnnTlKdKPBpjFrYwm4SeoDI8IOb8gwvSi0iHjYo1EQf2pmnCnHAxn3wH03ax0U X-Received: by 2002:a05:6e02:485:b0:35d:59a2:2e1 with SMTP id b5-20020a056e02048500b0035d59a202e1mr4164078ils.129.1702031501002; Fri, 08 Dec 2023 02:31:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702031500; cv=none; d=google.com; s=arc-20160816; b=nvBLbfLATUkZJIPNX9pq26OufSkd2CZholoMe+5KO9BKR0QlkVz/4bv+0VGIZxQFmu c6HCD7hvIReAAubAy87beBV7nGBft2MhsxniIBoCAwuMnKn0kWoeJfk+btTzYCP5ZYjP 3rUGJV4e5SW3LsjoW1/DYjLTqxgCkGPYZWC37/3VQGY9CXzp5DzyTJShY6qj9rpe8Cma UnBoxFwP9nYHR9xA+atdQD2chtq50hpvp8IuR1NJMjz1Q/bOJjhhHxlsys+D5IvKQAJS xmiWuZwteMQd4JWzX6s7FQqtBw6HbJ9n9G/A2Pn3QsoCdgGDRpv4heEkcavWz3VKvJe3 rDCA== 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=TfMRFkzBB7vh9il89fw23mjYo+w5nH5084NawZeD+xo=; fh=SIgps5XdV0XNwjZfT2uAI7g3mrspDldK9Qs8qQAfoa4=; b=mhZdtwLJ+5cLZy/CVoK703jpPxMpxYblgYb587fIc/TXUl1uMi6jfkMErXZv9nGIjS tHV/lLNk2T63bwO99FqtIHXlw9LKJ6TzkX3k3U+ls0rKQV4i8bK8Z0+as3P23ISMcez7 Lw6ZV4nFqbKDYGPmI9FOcFm7Z90MFZvY1qxu3xbiWBROJqihAGHF9i45pELuTp/FiDNb EYppRMgNRTIXBTP17J3/Xjpdt96WvFVta5CftGgCyMol8PLxsbvC1cQySbtPaXXtwNsK KYD0j6a1ZUIyhFoUqclhW3KRzxFd8JrCRI7hauNz2XNDEGaubwsQlknvIJ1B0ORNoyGV N5GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N84DsEjf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id bv129-20020a632e87000000b0056a36ac322fsi1273845pgb.514.2023.12.08.02.31.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 02:31:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N84DsEjf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 4B43A8374BA6; Fri, 8 Dec 2023 02:31:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573607AbjLHKbJ (ORCPT + 99 others); Fri, 8 Dec 2023 05:31:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573533AbjLHKak (ORCPT ); Fri, 8 Dec 2023 05:30:40 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D72751703 for ; Fri, 8 Dec 2023 02:30:14 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EB17C433C7; Fri, 8 Dec 2023 10:30:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702031414; bh=VVauZgXIlWYIcHDkYwErITV9yot6GwNuKuwbq9iJmVQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N84DsEjfrrBzs3l6Oi0bpHtxyHQtNf4qlTHzhhtRsboAvSsJmaqL7T0VEaA/2laCl UTuuLLpNKIm6tJkAriMKZwKIdaf3C8yCYeTPaWSvRhwMd++3CTo23rAtE3DXhJIiu9 h2ZGUcPJZY92ijdmvkAyVOmMhDnfyRL6sMPTm/6ireSVOZeE8D+cswuw/GzVDQGQHN kWyKyea1Zv7YfgeQuyIb4PvB8MTiZhya+X0RpOPfR2pR1wieYcV31XEILTz5UjH/Fc QCFCJw4sFRb1ErM0xU7epMM2Tlu3mhjzHBnzjrk0NjaPE6UWsOLtN9npU/sTnMns2O ThXOO/Y2zfakQ== 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 v4 29/33] tracing/fprobe: Remove nr_maxactive from fprobe Date: Fri, 8 Dec 2023 19:30:07 +0900 Message-Id: <170203140741.579004.12565529293650029395.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <170203105427.579004.8033550792660734570.stgit@devnote2> References: <170203105427.579004.8033550792660734570.stgit@devnote2> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Fri, 08 Dec 2023 02:31:38 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784709383155011873 X-GMAIL-MSGID: 1784709383155011873 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));