On Mon, 18 Jan 2021 11:22:27 +0100 Alexander Potapenko <glider@xxxxxxxxxx> wrote: > > If you do use tracefs, add it to the top level tracing directory (no need > > to have instances of it), and rename it to "kernel_warnings", as > > "error_report" is too close to the existing "error_log" which holds error > > messages of syntactic errors done by users entering in commands to some of > > the special files. > > Will do. Is it conventional to add a new dentry* to struct trace_array for that? > If not, maybe it's better to create this dir in > error_report_notify_setup(), like this is done e.g. for > /sys/kernel/tracing/trace_stat - just to loosen the coupling? Yeah, keep the dentry static in your own code. No need to add it to the trace_array. The dentry's in the trace array are for instances (as there are more than one of instance of them). > > > That is, /sys/kernel/tracing/kernel_warnings/ would be your error_report/ > > directory you have now. > > WDYT about "kernel_errors" or "kernel_error_reports"? > "warnings" suggest we'll be notifying about any occurrence of WARN(), > which is not what we are planning to do. > Also, shall I rename the library/config/etc. accordingly (to e.g. > CONFIG_KERNEL_WARN_NOTIFY)? I'm fine with "kernel_errors" as that helps to differentiate what they are. Also, you may want to add a field about this in the documentation under Documentation/trace/ftrace.rst (just a reference) and add a separate file called, kernel_errors.rst. -- Steve