Fix for YB6498
cover Fix for YB6498
The following changes since commit 6879c3c903ec7d08cf0240281c83d85b4a42b6db:
maintainers.inc: add info for libical (2014-07-08 11:20:14 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib roxana/YB6498
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=roxana/YB6498
Roxana Ciobanu (1):
latencytop: fix mount error
.../latencytop-0.5/latencytop-fsync-mount.patch | 17 +++++++++++++++++ meta/recipes-kernel/latencytop/latencytop_0.5.bb | 5 +++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync-mount.patch
Signature · 1 line
1.9.1
PATCH 1/1 latencytop: fix mount error
Added a check to ensure debugfs is not mounted before trying to mount it, because sysfs.sh already mounts it.
[ YOCTO #6498 ]
--- .../latencytop-0.5/latencytop-fsync-mount.patch | 17 +++++++++++++++++ meta/recipes-kernel/latencytop/latencytop_0.5.bb | 5 +++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync-mount.patch
meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync-mount.patch new file +17 -0
@@ -0,0 +1,17 @@ +Index: latencytop-0.5/fsync.c +=================================================================== +--- latencytop-0.5.orig/fsync.c 2014-07-09 16:56:32.565238023 +0300 ++++ latencytop-0.5/fsync.c 2014-07-09 17:12:00.553237913 +0300 +@@ -151,8 +151,10 @@ + * echo ftrace_printk > iter_ctrl + * echo 1 > tracing_on + */ +- ret = system("/bin/mount -t debugfs none /sys/kernel/debug/"); +- if (!ret) ++ ret = system("if ! grep -q debugfs /proc/filesystems; then" ++ " /bin/mount -t debugfs none /sys/kernel/debug/" ++ " else false; fi"); ++ if (!ret) + return -1; + write_to_file("/sys/kernel/debug/tracing/current_tracer", "fsync"); + write_to_file("/sys/kernel/debug/tracing/iter_ctrl", "ftrace_printk");
meta/recipes-kernel/latencytop/latencytop_0.5.bb +3 -2
@@ -6,11 +6,12 @@ LIC_FILES_CHKSUM = "file://latencytop.c;endline=23;md5=ee9ea9b1415356e5734adad4a DEPENDS = "virtual/libintl ncurses glib-2.0 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gtk+', '', d)}" -PR = "r3" +PR = "r4" SRC_URI = "http://www.latencytop.org/download/latencytop-${PV}.tar.gz \ file://latencytop-makefile.patch \ - file://latencytop-fsync.patch" + file://latencytop-fsync.patch \ + file://latencytop-fsync-mount.patch" SRC_URI[md5sum] = "73bb3371c6ee0b0e68e25289027e865c" SRC_URI[sha256sum] = "9e7f72fbea7bd918e71212a1eabaad8488d2c602205d2e3c95d62cd57e9203ef"
Signature · 1 line
1.9.1
Re: [PATCH 1/1] latencytop: fix mount error
Quoted 25 lines · Roxana Ciobanu
Added a check to ensure debugfs is not mounted before trying to mount it, because
sysfs.shalready mounts it.[ YOCTO #6498 ]
Signed-off-by Roxana Ciobanu <[email protected]>--- .../latencytop-0.5/latencytop-fsync-mount.patch | 17 +++++++++++++++++ meta/recipes-kernel/latencytop/latencytop_0.5.bb | 5 +++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync-mount.patchmeta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync-mount.patch new file +7
-0@@ -0,0 +1,17 @@ +Index: latencytop-0.5/fsync.c +=================================================================== +--- latencytop-0.5.orig/fsync.c 2014-07-09 16:56:32.565238023 +0300 ++++ latencytop-0.5/fsync.c 2014-07-09 17:12:00.553237913 +0300 +@@ -151,8 +151,10 @@ + * echo ftrace_printk > iter_ctrl + * echo 1 > tracing_on
meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync-mount.patch line 17
Quoted 10 lines
meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync-mount.patch new file +10
-0+ */ +- ret = system("/bin/mount -t debugfs none /sys/kernel/debug/"); +- if (!ret) ++ ret = system("if ! grep -q debugfs /proc/filesystems; then" ++ " /bin/mount -t debugfs none /sys/kernel/debug/" ++ " else false; fi"); ++ if (!ret) + return -1; + write_to_file("/sys/kernel/debug/tracing/current_tracer", "fsync"); + write_to_file("/sys/kernel/debug/tracing/iter_ctrl", "ftrace_printk");
I'm not sure an upstream would accept what amounts to shell in the system() call. Could we try listing that directories contents and then only call the mount if the directory is empty/does not exist?
That patch should then be able to be sent upstream...
Cheers,
Richard
Quoted 22 lines
meta/recipes-kernel/latencytop/latencytop_0.5.bb +3
-2@@ -6,11 +6,12 @@ LIC_FILES_CHKSUM = "file://latencytop.c;endline=23;md5=ee9ea9b1415356e5734adad4a DEPENDS = "virtual/libintl ncurses glib-2.0 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gtk+', '', d)}" -PR = "r3" +PR = "r4" SRC_URI = "http://www.latencytop.org/download/latencytop-${PV}.tar.gz \ file://latencytop-makefile.patch \ - file://latencytop-fsync.patch" + file://latencytop-fsync.patch \ + file://latencytop-fsync-mount.patch" SRC_URI[md5sum] = "73bb3371c6ee0b0e68e25289027e865c" SRC_URI[sha256sum] = "9e7f72fbea7bd918e71212a1eabaad8488d2c602205d2e3c95d62cd57e9203ef"Signature · 1 line
1.9.1
Re: [PATCH 1/1] latencytop: fix mount error
Quoted 3 lines · Richard Purdie
Quoted 2 lines · Roxana Ciobanu
Added a check to ensure debugfs is not mounted before trying to mount it, because
sysfs.shalready mounts it.
Using stat() you should be able to identify if /debug is a mount point, which will avoid the shell tests.
Ross