Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1425665lqp; Mon, 15 Apr 2024 06:24:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV4Yl5BLT30+mVJ6HCLKOsrPGyntjWrhToVZgpbQHw2YR8AEwb+GBYXo5dRXGwq5KEVKoFH1YRcPDkQGaq5SxFF+Y++nWf0hgzdxs7Ngw== X-Google-Smtp-Source: AGHT+IEiDghZyO5vKldnAWFRFkau8cmB2bs0AdFCjcp7LlnUMV3kGNktRFdLr83SNFsVFDKsYr4Y X-Received: by 2002:a05:6e02:13a8:b0:36b:2438:8805 with SMTP id h8-20020a056e0213a800b0036b24388805mr965581ilo.12.1713187454603; Mon, 15 Apr 2024 06:24:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713187454; cv=pass; d=google.com; s=arc-20160816; b=nPbjqJIeFbnzlIQm5BJ7X938IXwip4OBRGlvnY3cuyRdo6Dy6AT9sApn4ulMajSUGS URiHs8MIwEfCCyoMhxaGex04Hrnpoum9Fvo43c1ng4XKXKATBOl5tS15vewYVHuneov1 z3dFt3gJ5ZFXmYArvvMlirbkcx1NTDofNAMOnLrRShb8vEsDy9w8rDbuSXEk2zUpzIqd Nv47CKM2PepIo2AJaI3DaPJho+nn2PkFMXQl65N5ZUfegnqcO2jDUXbN3UBe14Zfh51w EDhxxcEuD47pRsDJ5Oricd8CaNdOU9UVy6XmXbqGAh5LxWlk/zMCgtMd3RRyhU1trQjc 36wQ== 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=shP68ATZ1L2kIHlfPA2LFjUb4QLODQkn6mHXNwj5U6M=; fh=SIgps5XdV0XNwjZfT2uAI7g3mrspDldK9Qs8qQAfoa4=; b=L+K5F8MFRd6ph3RU3XLBzbMhmxwH2Im2hdULGkUcJgAVhHpsiTqktNUFgIoRNkr7dN yptFZlM4IoIk7N2OTAaIHJQlrabPz2Db1DGXwm8TMtmJJXgTS97DT8T6UkHlYJuM4tym x+cypYmqSNrYIyO+5EQhpAEvH8tUvwt95HfQP4JwyYCFbrHPm0prkuaIMC0Ul4gqWr8L gL9BHQrBI+YaBE/zxwweYHp4nA0M2IWHwzaohAOaiA2F+3uw9uAiuTqiUaXQXObyKhUf 2XCWnh+3++0+F27a90CQv9imqmgCXhWe+CUxSWIEPVWedWcl6y9ssD+CWifhAQMNgfIm kM5Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ZrsU/J5M"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-145202-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145202-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id cb7-20020a056a02070700b005f0bc738b51si8321788pgb.619.2024.04.15.06.24.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 06:24:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145202-linux.lists.archive=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="ZrsU/J5M"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-145202-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145202-linux.lists.archive=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 C2AEBB21449 for ; Mon, 15 Apr 2024 13:16:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ADD8113D24A; Mon, 15 Apr 2024 12:55:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZrsU/J5M" 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 ADBD213CA9E; Mon, 15 Apr 2024 12:55:20 +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=1713185720; cv=none; b=CoLtlx5iZ0DeT6Nd3Ky57dAHfoSqWviyjNvt1QEnyAlIdhAgPlaB0jftfUwq+nNzrreyjw+y6xYQQQ7oU/0hFkeSwbUgH0TvC/qHpK8AzXxSVcJNAL9dQOIPoQNYqrnWvKNoxxZRKzvVqt5QV/vcL4rg1umqqRgFgUDVnkPTTCc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713185720; c=relaxed/simple; bh=6LRuOvaZstDE6JovoZfd2CiVZaFBRwbUc1jP+rvwiso=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=BQlwfKX57AbTW1TPzkymKxc+NGLiRDDnBUuXXkQy9zuropLWSllfTmp/QqiBpKLH6+OM7wtP3wTQBsqObJ4y+OQ/kPxtyV0/lHWucS/k1g55FKrMIIBKVHoPi3oU2VkMzYk6H2pgV+ZB1NTBju7UwqfIRE4TlAF6H/scf+1t1PM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZrsU/J5M; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88682C113CC; Mon, 15 Apr 2024 12:55:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713185720; bh=6LRuOvaZstDE6JovoZfd2CiVZaFBRwbUc1jP+rvwiso=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZrsU/J5M4ugAje7vgmqPWlt6Gd7AOPEFVLlHc9GNx6xYx+M0QX7NsKRh+e6o4pzP2 Ei819JA17zgUF1WKk6DYIQp8Rii7DL9oAufPT8gZWOksEJMXS0Q6EHJjKkTTEZqvwZ xU/GnB5sIPALnAp1CfPR8e/4SrZHV3AhDSyCHAkXR8wc/6EE/NnF2TxNdfpwmkpiuv vi72IcEBZRzEgyVSp+eVYElZHQnDNgkEbNhAB7Y06Rk0gRp8i1fw1T7e5lo0WGuqeq 4Qyjj2pAUxog4NVprK6IOdVnAZsjrHq4XuKAphJehj5PZD7e+BZAKr3awoqmPehAOy 7y+WtgIVJtahg== 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 v9 32/36] tracing/fprobe: Remove nr_maxactive from fprobe Date: Mon, 15 Apr 2024 21:55:14 +0900 Message-Id: <171318571427.254850.5462625198897117590.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <171318533841.254850.15841395205784342850.stgit@devnote2> References: <171318533841.254850.15841395205784342850.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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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 2d06bbd99601..a86b3e4df2a0 100644 --- a/include/linux/fprobe.h +++ b/include/linux/fprobe.h @@ -54,7 +54,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. @@ -63,7 +62,6 @@ struct fprobe { unsigned long nmissed; unsigned int flags; size_t entry_data_size; - int nr_maxactive; fprobe_entry_cb entry_handler; fprobe_exit_cb exit_handler; diff --git a/kernel/trace/trace_fprobe.c b/kernel/trace/trace_fprobe.c index 86cd6a8c806a..20ef5cd5d419 100644 --- a/kernel/trace/trace_fprobe.c +++ b/kernel/trace/trace_fprobe.c @@ -422,7 +422,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; @@ -442,7 +441,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, nargs); if (ret < 0) @@ -1021,12 +1019,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]; @@ -1048,33 +1045,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); @@ -1084,12 +1061,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, @@ -1147,8 +1118,7 @@ static int __trace_fprobe_create(int argc, const char *argv[]) goto out; /* 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 */ @@ -1230,8 +1200,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));