Ok, Here's what I have in mind;
Introduce a statctr_base_t type which represents a group of counters on
the same proc file, have statctr_base_init and statctr_base_cleanup
to create and destroy these datatypes. Each line in the /proc file
will be of the form
Here are the changed and new interfaces:
1. int statctr_init(statctr_t *statctr, unsigned long value,
statctr_base_t *base, const char *countername, int flags);
2. void statctr_cleanup(statctr_t *);
3. int statctr_base_init(statctr_base_t *base,
struct proc_dir_entry *procbase, const char *procname);
4. extern void statctr_base_cleanup(satctr_base_t *base);
Does this look ok?
> Not sure about that, though ... really depends on how
> expensive stat+open+read+close is compared to parsing a
> file with multiple fields.
Also, when you group counters into a single file, you inadvertently
end up reading counters you may not require at that time.
Reads to statctrs are not as cheap as cpu local writes. You'll have to
take that into account too i guess .....
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to firstname.lastname@example.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/