filedesc: export fdhold() and fddrop() functions sysctl_kern_proc_kqueue(): convert to use sbuf kinfo_knote: add knt_kq_fd member Note: this breaks kinfo_knote ABI FREEBSD_COMPAT32: add freebsd32_kevent_to_kevent32() helper converting struct kevent to struct kevent32 sysctl KERN_PROC_KQUEUE: implement compat32 Add NT_PROCSTAT_KQUEUES core note Suggested by: jhb sysctl KERN_PROC_KQUEUE: treat omitted kqfd as request to dump all kqueues libprocstat: change psc_type_info array to use designated initializers libprocstat: add knowledge about NT_PROCSTAT_KQUEUES core file section gcore(1): dump NT_PROCSTAT_KQUEUES section
Details
I dumped core with gcore, and then read kqueues events with procstat kqueues core.pid.
For compat32, I manually verified layouts of 32bit-compiled struct kinfo_knote vs. kinfo_knote32 using gdb ptype/o pahole command.
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Break ABI even more, by adding scratch fields before type-specific union.
Limit the size of copying by maxlen.
lib/libprocstat/core.c | ||
---|---|---|
60 | Can this be const too? | |
sys/kern/kern_event.c | ||
2986 | Rather than exporting fdhold() and allowing implementation details from kern_descrip.c to leak out, can we add a callback interface to kern_descrip.c? Something like int fget_remote_all(struct proc *p, void (*cb)(int, struct file *, void *), void *arg); Then, invoke the callback on each file in the table, and here the callback is just if (fp->f_type == DTYPE_KQUEUE) { kq = fp->f_data; error = kern_proc_kqueue_report(...); } with s and compat32 passed via an opaque structure. | |
3000 | imin() is wrong for size_t-sized parameters. |
fget_remote_foreach()
constify array in libprocstat/core.c
Use MIN() instead of imin() for size_t.