From: Saul Wold <sgw@linux.intel.com>
To: Roxana Ciobanu <roxana.ciobanu@intel.com>,
openembedded-core@lists.openembedded.org
Subject: Re: [PATCH v3 1/1] latencytop: fix mount error
Date: Mon, 14 Jul 2014 10:49:27 -0700 [thread overview]
Message-ID: <53C41827.7060002@linux.intel.com> (raw)
In-Reply-To: <bdbcbfeed06623ac20632e04036ff5eb15e53258.1405335436.git.roxana.ciobanu@intel.com>
On 07/14/2014 03:58 AM, Roxana Ciobanu wrote:
> Added a check to ensure debugfs is not mounted before trying
> to mount it, because sysfs.sh already mounts it.
>
> [ YOCTO #6498 ]
>
> Signed-off-by: Roxana Ciobanu <roxana.ciobanu@intel.com>
> ---
> .../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
>
> diff --git a/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync-mount.patch b/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync-mount.patch
> new file mode 100644
> index 0000000..9f2e120
> --- /dev/null
> +++ b/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync-mount.patch
This patch file needs Signed-off-by and Upstream-Status tags. Also have
you submitted this change to the upstream community?
Sau!
> @@ -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 ||
Why do two stats here? Can't you stat an entry inside of the
/sys/kernel/debug directory?
Sau!
> ++ (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");
> diff --git a/meta/recipes-kernel/latencytop/latencytop_0.5.bb b/meta/recipes-kernel/latencytop/latencytop_0.5.bb
> index 516e2c5..243f3d9 100644
> --- a/meta/recipes-kernel/latencytop/latencytop_0.5.bb
> +++ b/meta/recipes-kernel/latencytop/latencytop_0.5.bb
> @@ -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"
>
next prev parent reply other threads:[~2014-07-14 17:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-14 10:58 [PATCH v3 0/1] Fix for YB6498 Roxana Ciobanu
2014-07-14 10:58 ` [PATCH v3 1/1] latencytop: fix mount error Roxana Ciobanu
2014-07-14 17:49 ` Saul Wold [this message]
2014-07-14 18:56 ` Burton, Ross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53C41827.7060002@linux.intel.com \
--to=sgw@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=roxana.ciobanu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox