Article View: linux.kernel.netdev
Article #11795Re: [PATCH v7 0/4] tracing: improve symbolic printing
From: Johannes Berg
Date: Thu, 05 Nov 2026 16:26
Date: Thu, 05 Nov 2026 16:26
35 lines
10209 bytes
10209 bytes
On Thu, 2026-11-05 at 11:24 -0500, Steven Rostedt wrote:
> > Any objection to simply converting the __print_symbolic() sample? It
> > would look something like this:
>
> Actually, keeping them both would be very useful. That way one can see how
> to do it the other way. We can say, the old way is being deprecated so
> please use the new way.
What's the point? But OK, sure.
> > +/*
> > + * Alternatively, you could define a function for the names:
> > + *
> > + * The _lookup() function returns the string for the given value.
> > + *
> > + * The _show() function must
> > + * seq_printf(m, ", { %u, \"%s\" }", value, name);
> > + * for each value that userspace should be able to parse.
> > + */
> > +const char *sample_names2_lookup(unsigned long long value);
> > +void sample_names2_show(struct seq_file *m);
>
> Are the above going to be defined somewhere?
Well, it's a sample, and I wasn't even using "sample_names2" in the
below, so I didn't actually define it. I can flesh that out even more,
but I'm not sure it's worth it?
I reckon most users won't even need the dynamic way, but obviously part
of the reason I'm doing this is that I _do_ need the dynamic way for the
drop reasons, which are registered/built at runtime.
johannes
Technical Details
Message-ID:
<ba474cdb3bb30c3eaf4aafc6534d0e77cfde64d4.camel@sipsolutions.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357496-linux-kernel-netdev=dewy.ruReferences:
<20260922110955.363677-6-johannes@sipsolutions.net> <20261105091216.7b91db5a@gandalf.local.home> <8da2902c233de42ce756b3bfba5e5821f4dfa82b.camel@sipsolutions.net> <20261105112444.7873d9c9@gandalf.local.home>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357496-linux-kernel-netdev=dewy.ru From: johannes@sipsolutions.net (Johannes Berg) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH v7 0/4] tracing: improve symbolic printing Date: Thu, 05 Nov 2026 17:26:58 +0100 Organization: Usenet Network Message-ID: <ba474cdb3bb30c3eaf4aafc6534d0e77cfde64d4.camel@sipsolutions.net> References: <20260922110955.363677-6-johannes@sipsolutions.net> <20261105091216.7b91db5a@gandalf.local.home> <8da2902c233de42ce756b3bfba5e5821f4dfa82b.camel@sipsolutions.net> <20261105112444.7873d9c9@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: usenet.network; logging-data="3678517"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:qfTAo6CwEsH4UxtcTfyBwKrLV1o= sha256:16mfzGo3vNKCUUljKGufZT1RmY/thibeCucvOrsxxS0= sha1:Zo9l/YYT3/9jrpVbgm3ebHxpZWY= sha256:Qz5DfqNiae15vcdbr8QoJg2EQoJ0brgas4prrtHui+g= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id B03BB11301C; Thu, 5 Nov 2026 19:36:40 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=sipsolutions.net X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eAgurx71CEz1; Thu, 5 Nov 2026 19:36:37 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-357496-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=permerror header.from=sipsolutions.net X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id D617D113017; Thu, 5 Nov 2026 19:36:27 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id D1DED37B5B; Thu, 5 Nov 2026 16:27:27 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793896038; b=24uclr2yvK/k3RxZAdUe/EsF2+KoCoptj5/JfFILfY6VwMud3l3/9z4uDBxh3o5IHtpg OrxhSKXo5KmPK1w54xHKoRL71//5DshiM07/1iUzMbhNLcFU41ZZN+/cPzj4bXXgL+lJ0 r8MoPJoJKBTQoNd8nP8v5aT6xqLu/FSGf7PdglHx8uaZvyRKOIigiMuYhmLOz3eR1OALa 1V9D3wPUa+vLmHEOiJqamMgpcwpX3GRYns2hki78Zu4fzWztuTbjXjOsGfXrH6DMiDzgo Q+axgdI286oEZH7Gcl2R4F0NR+sFs55f3aQIN9SMgj/PMSFRHlKxX8xUBqCz4sGd0+w== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793896038; h=X-Original-To:Received:DKIM-Signature:Received:Message-ID:Subject: From:To:Cc:Date:In-Reply-To:References:Content-Type: Content-Transfer-Encoding:User-Agent:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:X-malware-bazaar; bh=eYQXe0kVk/iy4RnIgyOEwW7bf0V+nUHM2tfqY76sn3c=; b=13CZdtT6qkVX98VHlyH6nl/xARgiM9H+9PpP/yKuE/2vhLvt0eiik2VpS5qhe2tbeohy bMp15ScWZ1gKxZbDMgjZ+0Tw0EobCbxhPNHRIJwz7zvRERce/4U+0Wy2T7MXqvywfA4ZZ Q27QVWDUKa+DnTMEmNYVvwaV740F3xXIZ9DO4PqNM3A8QwndPMXtJ9VriUEILbRniyysB 4kPbTEnHPndmCMK/bjb+KbwxM9571HDFLW7YBX1vCWznKSuOfRMLt/h1F9pUj+Zt9j94X Xm+7O32V1iYWygMXjzbe+F9uCwajfHzj4/ZZOTyYyXRFSFZ3x8FuQpyIs00/iqxW5qQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=sipsolutions.net header.i=@sipsolutions.net header.a=rsa-sha256 header.s=mail header.b=GreaKXfU; dmarc=permerror header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 67C00606A330; Thu, 5 Nov 2026 16:27:18 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=sipsolutions.net header.i=@sipsolutions.net header.a=rsa-sha256 header.s=mail header.b=GreaKXfU X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=168.119.38.16 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793896024; b=sJNwfgqIkrLr4cbHtfjFczq+0yxZb3dD0Ttvo9xelAkWRIezFEdHOSrcca2yVF7ZNgVN Hnpu6ssspSTpwjzSgQTJzWFhuF5L9VeXTlHb9zIOMOfoo53xxSmrYvr0nEaKWqWXjxMHP 8oDotCSk+zYKWh97TISLa1KXVUtvZPneWw7IZzlho5y0VjjbtBXHJhbQdBknkhz9A2OSD ntOyRmsDl9/m9IvnGaJm24sN433ikSqx+yIBtIHhVNnr6t+UYyABJx/MDDGSQ2DSiUedU r7uvtubj7EMofQVqSddOICFPcT4+dnLZDnTIkUPOqLnZr1BcX4GNB8AgMhIaE2oR40Q== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793896024; h=DKIM-Signature:Received:Message-ID:Subject:From:To:Cc:Date: In-Reply-To:References:Content-Type:Content-Transfer-Encoding: User-Agent:MIME-Version:X-malware-bazaar; bh=eYQXe0kVk/iy4RnIgyOEwW7bf0V+nUHM2tfqY76sn3c=; b=3Ak0RvhIwXkEzsq78MqcxchD5hW+e29C7rXUhXMOtdzUWG9O0lvgTGm2CPS0h8ntWv3g AZbyUQFqPFqv9rINRl3Pwwi4kKL/5YMwF1qEgDpuKqnDVhkrIQZsaWDYiam4/uzkvkGEX R9cyB7IGc4BZiTB1i9sC6DV4QcoeBjIx9Dj9VlhybrsilHoyy8Dvmm/U6gJDBqXmhwlPD AQ5FDDkdExbdCjC1Dh1cN31IHFE5TsJNlZhM4+Lq4LpsQ+TeoVcODvoWSjAh8m65/ZLEA wVTQABcSH1jWb6bjHO462hp7eEE2JFlSE1b4PzND3XvoM1N0pT6dwi1Gqig7+wfqnOQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=permerror header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass header.d=sipsolutions.net header.i=@sipsolutions.net header.a=rsa-sha256 header.s=mail header.b=GreaKXfU; arc=none smtp.remote-ip=168.119.38.16 X-Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 171A4606A332; Thu, 5 Nov 2026 16:27:03 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dmarc=permerror header.from=sipsolutions.net X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=eYQXe0kVk/iy4RnIgyOEwW7bf0V+nUHM2tfqY76sn3c=; t=1793896023; x=1795105623; b=GreaKXfUgBJZ9m8CSPkVSaWKliPzJVSLEqKuvEeMUs6U41F kbg/9TEZ2ToIXu0HcFylVscleILe7CZweq7ocpklVtH+gv4nOxv7a2Mmmf74lwX5WQQdBuPzkLpkI vfSWll4Iauv6Mh6N9Ga3NML8PqyODxSrfkGB8RX4PYScODrc3Ugje7i777aSsQw0Z6UdsJ3M5eVDz tbFJDFo1ZxR8hpEaR9UKrpavHdclOmjHgdgz4A25fEFT+ePBFruo91uGKjJMZOZ4I4yUJ+TquLl7B 0ZSKUFli0YGYozCLWOctCqAzXjQCVVbXcb+FZcFSVsEgnQVC++JBGFN9Vs4FNhcQ==; X-Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__ECDSA_SECP256R1_SHA256__AES_256_GCM:256) (Exim 4.98.2) (envelope-from <johannes@sipsolutions.net>) id 1xP0Il-000000088Go-18VR; Thu, 05 Nov 2026 17:26:59 +0100 X-Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Masami Hiramatsu <mhiramat@kernel.org>, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, Ilya Maximets <i.maximets@ovn.org>, Matthieu Baerts <matttbe@kernel.org>, Aaron Conole <aconole@redhat.com>, Eelco Chaudron <echaudro@redhat.com>, dev@openvswitch.org, Adrian Moreno <amorenoz@redhat.com>, Antoine Tenart <atenart@kernel.org> X-In-Reply-To: <20261105112444.7873d9c9@gandalf.local.home> X-User-Agent: Evolution 3.60.2 (3.60.2-3.fc44) X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-malware-bazaar: not-scanned