Re: [PATCH 11/15] tools lib api: Add mount support for fs

From: Steven Rostedt
Date: Fri Sep 04 2015 - 10:20:52 EST


On Fri, 4 Sep 2015 10:14:28 -0400
RaphaÃl Beamonte <raphael.beamonte@xxxxxxxxx> wrote:

> 2015-09-02 3:56 GMT-04:00 Jiri Olsa <jolsa@xxxxxxxxxx>:
> > Adding name__mount (where name is in sysfs,procfs,debugfs,tracefs)
> > interface that tries to mount the filesystem in case no mount is found.
> >
> > Link: http://lkml.kernel.org/n/tip-ja49vwfiq2qqkmoxx9yk26lm@xxxxxxxxxxxxxx
> > Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
> > ---
> > tools/lib/api/fs/fs.c | 44 +++++++++++++++++++++++++++++++++++++++-----
> > tools/lib/api/fs/fs.h | 15 +++++++++++----
> > 2 files changed, 50 insertions(+), 9 deletions(-)
>
> Why automatic mounting the **fs filesystems?
> Isn't it better to let the user decide when and where to mount it if
> s/he forgot to do it before? Forcing a mount is also potentially
> forcing to umount then mount when mounting has been forgotten before.
>

tracefs and debugfs have known locations to be mounted at. That's why
the kernel supplies it (/sys/kernel/debug and /sys/kernel/trace). Why
should we bother the user with this? trace-cmd does the same thing. It
automatically mounts the filesystems if they are not mounted.

Would you rather have the tool fail and say "please mount the
trace or debugfs file system"? Even if it asked before doing so, that
would become rather annoying.

Running perf and trace-cmd should just work, and not expect the user to
do more work than can be easily done by the tool.

-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/