Fix for YB6498
v3 cover Fix for YB6498
The following changes since commit 9e99bcffec594cb5b4c3533200e8eb56d32e6a77:
insane: Ensure do_package_qa happens after do_packagedata (2014-07-11 23:20:04 +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 | 37 ++++++++++++++++++++++ meta/recipes-kernel/latencytop/latencytop_0.5.bb | 3 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync-mount.patch
Signature · 1 line
1.9.1
PATCH v3 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 | 37 ++++++++++++++++++++++ meta/recipes-kernel/latencytop/latencytop_0.5.bb | 3 +- 2 files changed, 39 insertions(+), 1 deletion(-) 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 +37 -0
@@ -0,0 +1,37 @@ +Index: latencytop-0.5/fsync.c +=================================================================== +--- latencytop-0.5.orig/fsync.c 2014-07-14 13:25:27.657187985 +0300 ++++ latencytop-0.5/fsync.c 2014-07-14 13:26:12.033187979 +0300 +@@ -32,6 +32,7 @@ + #include <time.h> + #include <wchar.h> + #include <ctype.h> ++#include <sys/stat.h> + + #include <glib.h> + +@@ -142,16 +143,23 @@ + int enable_fsync_tracer(void) + { + int ret; ++ struct stat s_debug, s_mount_point; ++ + /* + * Steps to do: + * ++ * check if /sys/kernel/debug is mounted + * mount -t debugfs none /sys/kernel/debug/ + * cd /sys/kernel/debug/tracing + * echo fsync > current_tracer + * echo ftrace_printk > iter_ctrl + * echo 1 > tracing_on + */ +- ret = system("/bin/mount -t debugfs none /sys/kernel/debug/"); ++ ++ stat("/sys/kernel/debug/..", &s_debug); ++ if (stat("/sys/kernel/debug", &s_mount_point) != 0 || ++ (s_debug.st_dev == s_mount_point.st_dev)) ++ ret = system("/bin/mount -t debugfs none /sys/kernel/debug/"); + if (!ret) + return -1; + write_to_file("/sys/kernel/debug/tracing/current_tracer", "fsync");
meta/recipes-kernel/latencytop/latencytop_0.5.bb +2 -1
@@ -10,7 +10,8 @@ PR = "r3" 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 v3 1/1] latencytop: fix mount error
meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync-mount.patch
Quoted 17 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 | 37 ++++++++++++++++++++++ meta/recipes-kernel/latencytop/latencytop_0.5.bb | 3 +- 2 files changed, 39 insertions(+), 1 deletion(-)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 +0
-0
This patch file needs Signed-off-by and Upstream-Status tags. Also have you submitted this change to the upstream community?
Sau!
Quoted 23 lines
meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync-mount.patch new file +22
-0@@ -0,0 +1,37 @@ +Index: latencytop-0.5/fsync.c +=================================================================== +--- latencytop-0.5.orig/fsync.c 2014-07-14 13:25:27.657187985 +0300 ++++ latencytop-0.5/fsync.c 2014-07-14 13:26:12.033187979 +0300 +@@ -32,6 +32,7 @@ + #include <time.h> + #include <wchar.h> + #include <ctype.h> ++#include <sys/stat.h> + + #include <glib.h> + +@@ -142,16 +143,23 @@ + int enable_fsync_tracer(void) + { + int ret; ++ struct stat s_debug, s_mount_point; ++ + /* + * Steps to do: + * ++ * check if /sys/kernel/debug is mounted
meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync-mount.patch line 32
Quoted 10 lines
meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync-mount.patch new file +10
-0+ * mount -t debugfs none /sys/kernel/debug/ + * cd /sys/kernel/debug/tracing + * echo fsync > current_tracer + * echo ftrace_printk > iter_ctrl + * echo 1 > tracing_on + */ +- ret = system("/bin/mount -t debugfs none /sys/kernel/debug/"); ++ ++ stat("/sys/kernel/debug/..", &s_debug); ++ if (stat("/sys/kernel/debug", &s_mount_point) != 0 ||
Why do two stats here? Can't you stat an entry inside of the /sys/kernel/debug directory?
Sau!
Quoted 20 lines
meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync-mount.patch new file +5
-0++ (s_debug.st_dev == s_mount_point.st_dev)) ++ ret = system("/bin/mount -t debugfs none /sys/kernel/debug/"); + if (!ret) + return -1; + write_to_file("/sys/kernel/debug/tracing/current_tracer", "fsync");meta/recipes-kernel/latencytop/latencytop_0.5.bb +2
-1@@ -10,7 +10,8 @@ PR = "r3" 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"
Re: [PATCH v3 1/1] latencytop: fix mount error
Quoted 2 lines · Saul Wold
Why do two stats here? Can't you stat an entry inside of the
/sys/kernel/debugdirectory?
It's the idiomatic "is this a mount point" test: look at the device number inside and outside the hopeful mount point, and if they're different then there's a mount. You need to stat twice to determine this.
Ross