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
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to