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
- Reviewers
jhb markj - Commits
- rG1c3d6532ca29: libprocstat: add knowledge about NT_PROCSTAT_KQUEUES core file section
rG10626f7384f9: gcore(1): dump NT_PROCSTAT_KQUEUES section
rGba2fb6b367fd: libprocstat: change psc_type_info array to use designated initializers
rGdebcd4c05701: libprocstat: constify psc_type_info[]
rGab9b296498fe: sysctl KERN_PROC_KQUEUE: treat omitted kqfd as request to dump all kqueues
rG5e7c43ff02dc: Add NT_PROCSTAT_KQUEUES core note
rGfa8fdd80dff9: sysctl KERN_PROC_KQUEUE: implement compat32
rG6534c17326b2: FREEBSD_COMPAT32: add freebsd32_kevent_to_kevent32() helper
rG9d1e7a7e8e8b: kinfo_knote: add knt_kq_fd member
rGfee6a52e4338: sysctl_kern_proc_kqueue(): convert to use sbuf
rG4b69f1fab66d: descriptors: add fget_remote_foreach()
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 Not Applicable - Unit
Tests Not Applicable
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 ↗ | (On Diff #152322) | Can this be const too? |
sys/kern/kern_event.c | ||
2986 ↗ | (On Diff #152322) | 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 ↗ | (On Diff #152322) | 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.