Re: [PATCH v2 1/4] ftrace: Implement fs notification for preempt/irqsoff tracers

From: Steven Rostedt
Date: Sun May 05 2019 - 15:44:19 EST


On Sat, 4 May 2019 12:47:10 -0400
Joel Fernandes <joel@xxxxxxxxxxxxxxxxx> wrote:


> I agree with the general idea, but I don't really like how it is done in the
> patch.

+1

>
> We do have a notification mechanism already in the form of trace_pipe. Can we
> not improve that in some way to be notified of a new trace data? In theory,
> the trace_pipe does fit into the description in the documentation: "Reads
> from this file will block until new data is retrieved"
>
> More comment below:
>
>

> > + config PREEMPTIRQ_FSNOTIFY
> > + bool "Generate fsnotify events for the latency tracers"
> > + default n
> > + depends on (IRQSOFF_TRACER || PREEMPT_TRACER) && FSNOTIFY
> > + help
> > + This option will enable the generation of fsnotify events for the
> > + trace file. This makes it possible for userspace to be notified about
> > + modification of /sys/kernel/debug/tracing/trace through the inotify
> > + interface.
>
> Does this have to be a CONFIG option? If prefer if the code automatically
> does the notification and it is always enabled. I don't see any drawbacks of
> that.

I mentioned that anything it needs to be an option.


> > +#ifdef CONFIG_PREEMPTIRQ_FSNOTIFY
> > +
> > +static void trace_notify_workfn(struct work_struct *work)
> [snip]
>
> I prefer if this facility is available to other tracers as well such as
> the wakeup tracer which is similar in output (check
> Documentation/trace/ftrace.txt). I believe this should be a generic trace
> facility, and not tracer specific.


For what it's worth, I agree with everything Joel just stated.

Thanks,

-- Steve