UBUNTU: SAUCE: trace: add trace events for open(), exec() and uselib()
On Tue, Oct 27, 2009 at 10:05:32AM +0000, Scott James Remnant wrote:
> This patch uses TRACE_EVENT to add tracepoints for the open(), > exec() and uselib() syscalls so that ureadahead can cheaply trace > the boot sequence to determine what to read to speed up the next. > > It's not upstream because it will need to be rebased onto the syscall > trace events whenever that gets merged, and is a stop-gap. > > Signed-off-by: Scott James Remnant <scott@ubuntu.com> > --- > fs/exec.c | 8 +++++ > fs/open.c | 4 ++ > include/trace/events/fs.h | 71 +++++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 83 insertions(+), 0 deletions(-) > create mode 100644 include/trace/events/fs.h > > diff --git a/fs/exec.c b/fs/exec.c > index 172ceb6..c936999 100644 > --- a/fs/exec.c > +++ b/fs/exec.c > @@ -56,6 +56,8 @@ > #include <linux/fsnotify.h> > #include <linux/fs_struct.h> > > +#include <trace/events/fs.h> > + > #include <asm/uaccess.h> > #include <asm/mmu_context.h> > #include <asm/tlb.h> > @@ -130,6 +132,10 @@ SYSCALL_DEFINE1(uselib, const char __user *, library) > > fsnotify_open(file->f_path.dentry); > > + tmp = getname(library); > + trace_uselib(tmp); > + putname(library); > + So the other two tracepoints look basically sane and cheap when off. This one does add this getname/putname pair. This appears to allocate another copy of the filename and copy it from userspace. getname() may fail to allocate memory and return a failure code, as the trace point does not appear to check the string is valid would you not need to check ERR_PTR(tmp) before calling the tracepint. Can we not just hold the current filename a smidge longer and use that one, that would be a lot less expensive me thinks if slightly more complex as a patch. This would make sure we could log it if we did it and avoid the cost? -apw -- kernel-team mailing list kernel-team@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/kernel-team |
UBUNTU: SAUCE: trace: add trace events for open(), exec() and uselib()
> Can we not just hold the current filename a smidge longer and use that one,
> that would be a lot less expensive me thinks if slightly more complex as > a patch. This would make sure we could log it if we did it and avoid > the cost? After discussing this it seems the uselib modifications are not required therefore we can drop that part while we sort out the issues here. Without that part: Acked-by: Andy Whitcroft <apw@canonical.com> -apw -- kernel-team mailing list kernel-team@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/kernel-team |
| All times are GMT. The time now is 10:58 AM. |
VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.