Re: [PATCH] sched_ext: Provides a sysfs 'events' to expose core event counters

From: Tejun Heo
Date: Mon Feb 10 2025 - 12:29:16 EST


Hello,

On Mon, Feb 10, 2025 at 11:36:43PM +0900, Changwoo Min wrote:
...
> +#define scx_attr_event_show(buf, at, events, kind) ({ \
> + sysfs_emit_at(buf, at, "%40s: %16llu\n", #kind, (events)->kind); \
> +})

It's nice to format things in tabular forms but things under /sys lean more
towards simpler formatting, so maybe just do "%s %16llu\n"?

> static struct attribute *scx_global_attrs[] = {
> &scx_attr_state.attr,
> &scx_attr_switch_all.attr,
> &scx_attr_nr_rejected.attr,
> &scx_attr_hotplug_seq.attr,
> &scx_attr_enable_seq.attr,
> + &scx_attr_events.attr,

This probably should belong to the root/ subdir as we'd probably want to
keep the event counter separate per scheduler instance in the
multi-scheduler future.

Thanks.

--
tejun