From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.170 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796160358; b=eiRp9HxRU8VuS83cKmLIzVUFZEeujuCxb8Q/6FQSq2CqgMT9YUFXr0EX+iUYqHxHAYFP SRj4JTm9LAr0ikiYHB7QqOpQRYBVNK/Vq1ZbTbdqRvADJM976u1BC6c7qxEtDUuWpHQxa lLJo7lACxv9dE7Q/cWN8MjLDAffEGQDhFrFo56gO9z0MNmewuZcuwU5ZACxLbCQl2Z2w2 Jdt0pNJXtbm1Pe3dQoAyv8jDezue1ZtaJsio8AOj/7AonQuv7wjKo+LFVW59lWtMT/nT+ j0dXkpsdWQsmiHDdy8T865o1SB6TaPHa4a/c98wBgvNEwm3Vcv6lQQUT9LynZzo19OA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796160358; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Content-Type:Date:Message-Id:Cc:Subject:From:To:In-Reply-To: References:Content-Transfer-Encoding:MIME-Version; bh=+YeL8ZhcGOnNrSKytabC+BR0t76VnE2cHFWOJqIRWWQ=; b=agIyg1X/ZViDyvbw2i+/KcBdigGdz786B9e1GBfNUTqqkaMaXSfaxvgk56O0JFp8lHOn U0koYiWR/cg1a9bQce6XPKXny7CGzdHcu5IU7YroMca+tPRkQhVhvfEHG+qhk3iVtxQ7H tp8YJnlFCcmsgCmFzawEn7S8NapxJpCed3gx9XKwLZcDeVUrIwDKrTP7/e/W7eKEwJz8D CwolbliQ6uDi2WVys6O5evTEK7KID0YpfpyPKS9JD8ecYUFeptC9Z/fqIBUUxtzHDehZ8 QH+9tvwzg9gEhvCU+thySPSJmyIX3pc7boPRHplLoSc8v6gqCg83oZddV3/hdjj8U+g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=eNuuAEjb; arc=none smtp.remote-ip=209.85.215.170 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22837606A325 for ; Tue, 1 Dec 2026 21:25:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 22837606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=eNuuAEjb Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-cdb2dfcca94so5296776a12.1 for ; Tue, 01 Dec 2026 13:25:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796160357; x=1796765157; darn=vger.kernel.org; h=mime-version:content-transfer-encoding:references:in-reply-to:to :from:subject:cc:message-id:date:content-type:from:to:cc:subject :date:message-id:reply-to:content-type; bh=+YeL8ZhcGOnNrSKytabC+BR0t76VnE2cHFWOJqIRWWQ=; b=eNuuAEjbvALaoBcbuERBelLfFPoThulU/WFG+TTBSSy8zotjz6SWC5pNvyd0oXUanA 3v/tKx6ouqxyotQKFbLpzA5BDRwMWHAVghYtHZRDvodT5Hu+Kmu0WsH521rxwdD6pRIH 0awxbd5uHcOxLwxWKtqMyrHA4vH7iEH8U+sObeHNz8+fIy2kUwHJK4C+Z9WVwMzNI6W5 RpWG71hGnfcg9uuobWGw4l/3GXYZnoqYJKEj2PUZhY99DGBTm5CyEQDBmwQMsn2YJWKF MgPfgrJ8MllYGt9tS3XPvb5c/Qd7UOgirgjeVrBT3p6kCwXYxKZHS3loDagpl2YVIeUB JcCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796160357; x=1796765157; h=mime-version:content-transfer-encoding:references:in-reply-to:to :from:subject:cc:message-id:date:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=+YeL8ZhcGOnNrSKytabC+BR0t76VnE2cHFWOJqIRWWQ=; b=VEecoUxtN7I+mfgU6mcMCCp6n11u9CJiAc2kXrv+84GQfvhdefzKz7rKM9zCsAvvZC oHUH7QTS6a5lwLi9G49S1jH32Mv80hhY7c74BT2L9PaDju+1tEi6wSOdPEpzGDQhuhsl +Cosxw/tC2nufTIerSL/R3O6G3QzmRZ2M9Hxi/xlDT8oZJVuilNGTDBkPMdKxpeRCm+m yvNg2U71Gt9WOtKRkaCEmDZm95FH6ynuyxAhoiXGOWbhuq4pp5iHGY7mqAGNEfMz6VI8 oaeA6M4eP7+jgg5kbHVwnX/TzzHjMGPv8ceC08KNxnVLcc3BFQUSBoy+KCkTb3YzJoTQ qOUg== X-Forwarded-Encrypted: i=1; AL+hErEkgZQ09m5R/31VDZNfAuNdk6MDO9cBCXcfMd+s6lF8tN1AlCR03znGpgPdvhWhVzrN4lq1cHwPczsMQ44=@vger.kernel.org X-Gm-Message-State: APuU4Z/uLqzj1m7cz0hezeL5hwSxOFonMPNYyp95e9OZ54cqgh2yHRSq TYusXLilDFdjoG28LMu8/CaHT9CGXWUNluvb6JIKLEqPRNfyNlby5JqZU4bG+g== X-Gm-Gg: AZFdTZdAo9j+/p2r+hG9P8FIomAritug24r4lqY7V+R7Ykc3/21CXmGeJFKEt31RZ8c C/fJotkkpUk9tdkj3g1uwBZhLVgvz5QOK6FCd8Vsanb7lmLcDF4zwznVuIBB/5kYbpQNc2sZX/4 qOQAL/jmcSQkwAyN3cSDtvuyjLwMJLDA+9MSTIbVW1XbhJvgLDXIVoyh0H+0+65vqAd+4MwGA2Q MlPUrZbnVFky1xxtBQcmJ2ciD2AmhUTIv3xrBjRwplgPfi18YcoDkpQnP1wvwb0mU7sB2ILSRw1 FUcvCMgkIu4PN6Jh98kAXra3mIzm4RK7AzRz0XtNr75yz89ExMx7rj673B8CXqebV0+niHmM2lp QSp33DPqKhpMb2uAZT6G+qfh6+P8XrSS5bAoOLFRisvtCHiV5Swa9VJv+P90N6bYKjk6qlzrkNK FqVhfh0nmZ/XBnFLO9AXHPCLPIH09bElvQZT/dX+b2ml89TWW41CXR3f7WzD5KDzuy7tEAqmuNy ZoX+wIp3KsiwFuFu8SmkUcLm0baH9ZESHBvbXBrv0LTnupLa4ldG6o6fzJp15wVrYoYwYNzTapC /6mCzQQIQ/1IzeCx0kcY6hJxeAmfteqSO/a/UEXjw/HxfknKbXtP47+c0mM2PS48phKDUAgNu5e XIFhibZXWdoXDS1YeXLxXqp9I7SNiHXHnwYKtteLdnVm0FGrCC9PBi6k= X-Received: by 2002:a17:90b:2f8c:b0:3ab:3437:554f with SMTP id 98e67ed59e1d1-3b41c92a519mr37882394a91.29.1796160357151; Tue, 01 Dec 2026 13:25:57 -0800 (PST) Received: from localhost ([153.61.198.241]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b40578d771sm60628628a91.1.2026.12.01.13.25.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Dec 2026 13:25:56 -0800 (PST) Content-Type: text/plain; charset=UTF-8 Date: Tue, 01 Dec 2026 21:25:56 +0000 Message-Id: Cc: "Nam Cao" , "Wen Yang" , "Tobias Schaffner" , "Viktor Malik" , "Peter Zijlstra" , "John Ogness" Subject: Re: [PATCH v3 05/18] rv: Add generic monitor event tracepoints and BPF kfuncs From: "Alexei Starovoitov" To: "Gabriele Monaco" , , , , "Steven Rostedt" , "Masami Hiramatsu" In-Reply-To: <08aa4bd5bbe71cd546f17fa9240154d7de32966f.camel@redhat.com> References: <20261126130004.127155-1-gmonaco@redhat.com> <20261126130004.127155-6-gmonaco@redhat.com> <091bc888a43c8b690df49bdc2292dbbd967bdd91.camel@redhat.com> <08aa4bd5bbe71cd546f17fa9240154d7de32966f.camel@redhat.com> Content-Transfer-Encoding: 8bit X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 On Tue, Dec 01, 2026 at 07:42 AM Gabriele Monaco wrote: > But I agree, in its current shape, the tracepoint really looks like printk. > > What I'd really like to have is a structured version of this, e.g.: > > event_monitor(state, event, next) -> fmt "state x event -> next" That makes more sense. > This however needs me to pass a series of strings to the kfunc and the only > meaningful way without exploding in number of arguments is defining a struct > uniquely for this purpose. > > There's also the other issue with NULL termination you raised, so in the end I'd > probably need to do something like 2 rounds of memcpy to ensure data written to > the ring buffer. Porbably no need for copies. If your names are in rodata than __str suffix on kfunc args will do. Like: void bpf_rv_da_event(const char *mon__str, const int *id__nullable, const char *state__str, const char *event__str, const char *next_state__str); > If you don't have anything against using kfuncs themselves and passing a bunch > of (structured) strings, I can start drafting that and see how it behaves. No objections. I still feel you're too attached to printk-like output. You could have used existing ringbuf and passed binary data to user daemon. With event_monitor(state, event, next) you kinda doing one step in that direction.