>>> - if
(!fctx->filter_region(region, fctx))
>>> + if (fctx->filter_region &&
>>> + !fctx->filter_region(region,
>>> fctx))
>> No, I don't agree with these change. The filter_bus() and
>> filter_region() callbacks are mandatory because, like list, you need
>> to be prepared to handle dimms underneath the bus, and namespaces
>> underneath a region.
>
> The filter_bus() and filter_region() callbacks are mandatory in ndctl list,
> but not in ndctl monitor.
> Current design only monitors the events coming from DIMMs, does not monitor
> events coming from buses yet. When monitoring the events coming from DIMMs,
> we just need to put the DIMMs which match filters into a linklist using
> filter_dimm(). No additional actions will be taken on buses. It is the
> similar
> case as in ndctl list, when the command does not contain [--buses] option,
> filter_bus() will always return true.
Right, I'd prefer that you create a ->filter_bus() implementation for
your use case that always returns true rather than change the core to
allow a ->filter_bus() routine to be omitted. This way the core stays
generic for all use cases and the bus monitoring can be added without
touching the core.
OK, I see.
Thank you very much.