mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] oprofile: Add patch to use busybox icm opcontrol
@ 2012-05-28 12:42 Bart vdr. Meulen
  2012-05-30  7:21 ` Michael Olbrich
  0 siblings, 1 reply; 2+ messages in thread
From: Bart vdr. Meulen @ 2012-05-28 12:42 UTC (permalink / raw)
  To: ptxdist

From: "Bart vdr. Meulen" <bartvdrmeulen@gmail.com>

When using busybox wc the '-m' (count chars) option is not supported,
use the '-c' (count bytes) option which gives the same count result,
in this case because non-unicode characters are counted

Signed-off-by: Bart vdr. Meulen <bartvdrmeulen@gmail.com>
---
 .../001-make-opcontrol-busybox-compatible.patch    |   24 ++++++++++++++++++++
 patches/oprofile-0.9.6/series                      |    1 +
 2 files changed, 25 insertions(+)
 create mode 100644 patches/oprofile-0.9.6/001-make-opcontrol-busybox-compatible.patch
 create mode 100644 patches/oprofile-0.9.6/series

diff --git a/patches/oprofile-0.9.6/001-make-opcontrol-busybox-compatible.patch b/patches/oprofile-0.9.6/001-make-opcontrol-busybox-compatible.patch
new file mode 100644
index 0000000..43f9bd5
--- /dev/null
+++ b/patches/oprofile-0.9.6/001-make-opcontrol-busybox-compatible.patch
@@ -0,0 +1,24 @@
+Use -c to count characters instead of -m
+
+When using busybox wc the '-m' (count chars) option is not supported,
+use the '-c' (count bytes) option which gives the same count result
+in this case because the count is done over non-unicode characters.
+
+Signed-off-by: Bart vdr. Meulen <bartvdrmeulen@gmail.com>
+---
+ utils/opcontrol |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: oprofile-0.9.6/utils/opcontrol
+===================================================================
+--- oprofile-0.9.6.orig/utils/opcontrol
++++ oprofile-0.9.6/utils/opcontrol
+@@ -1240,7 +1240,7 @@ check_event_mapping_data()
+ 			fi
+ 		fi
+ 	fi
+-	len=`echo -n $event_num | wc -m`
++	len=`echo -n $event_num | wc -c`
+ 	num_chars_in_grpid=`expr $len - 2`
+ 	GRP_NUM_VAL=`echo | awk '{print substr("'"${event_num}"'",1,"'"${num_chars_in_grpid}"'")}'`
+ 	if [ "$GRP_NUM_CK_VAL" = "" ] ; then
diff --git a/patches/oprofile-0.9.6/series b/patches/oprofile-0.9.6/series
new file mode 100644
index 0000000..1dbb427
--- /dev/null
+++ b/patches/oprofile-0.9.6/series
@@ -0,0 +1 @@
+001-make-opcontrol-busybox-compatible.patch
-- 
1.7.9.5


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ptxdist] [PATCH] oprofile: Add patch to use busybox icm opcontrol
  2012-05-28 12:42 [ptxdist] [PATCH] oprofile: Add patch to use busybox icm opcontrol Bart vdr. Meulen
@ 2012-05-30  7:21 ` Michael Olbrich
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Olbrich @ 2012-05-30  7:21 UTC (permalink / raw)
  To: ptxdist

On Mon, May 28, 2012 at 02:42:29PM +0200, Bart vdr. Meulen wrote:
> From: "Bart vdr. Meulen" <bartvdrmeulen@gmail.com>
> 
> When using busybox wc the '-m' (count chars) option is not supported,
> use the '-c' (count bytes) option which gives the same count result,
> in this case because non-unicode characters are counted

We already have 0.9.7, which includes this fix.

mol

> Signed-off-by: Bart vdr. Meulen <bartvdrmeulen@gmail.com>
> ---
>  .../001-make-opcontrol-busybox-compatible.patch    |   24 ++++++++++++++++++++
>  patches/oprofile-0.9.6/series                      |    1 +
>  2 files changed, 25 insertions(+)
>  create mode 100644 patches/oprofile-0.9.6/001-make-opcontrol-busybox-compatible.patch
>  create mode 100644 patches/oprofile-0.9.6/series
> 
> diff --git a/patches/oprofile-0.9.6/001-make-opcontrol-busybox-compatible.patch b/patches/oprofile-0.9.6/001-make-opcontrol-busybox-compatible.patch
> new file mode 100644
> index 0000000..43f9bd5
> --- /dev/null
> +++ b/patches/oprofile-0.9.6/001-make-opcontrol-busybox-compatible.patch
> @@ -0,0 +1,24 @@
> +Use -c to count characters instead of -m
> +
> +When using busybox wc the '-m' (count chars) option is not supported,
> +use the '-c' (count bytes) option which gives the same count result
> +in this case because the count is done over non-unicode characters.
> +
> +Signed-off-by: Bart vdr. Meulen <bartvdrmeulen@gmail.com>
> +---
> + utils/opcontrol |    2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +Index: oprofile-0.9.6/utils/opcontrol
> +===================================================================
> +--- oprofile-0.9.6.orig/utils/opcontrol
> ++++ oprofile-0.9.6/utils/opcontrol
> +@@ -1240,7 +1240,7 @@ check_event_mapping_data()
> + 			fi
> + 		fi
> + 	fi
> +-	len=`echo -n $event_num | wc -m`
> ++	len=`echo -n $event_num | wc -c`
> + 	num_chars_in_grpid=`expr $len - 2`
> + 	GRP_NUM_VAL=`echo | awk '{print substr("'"${event_num}"'",1,"'"${num_chars_in_grpid}"'")}'`
> + 	if [ "$GRP_NUM_CK_VAL" = "" ] ; then
> diff --git a/patches/oprofile-0.9.6/series b/patches/oprofile-0.9.6/series
> new file mode 100644
> index 0000000..1dbb427
> --- /dev/null
> +++ b/patches/oprofile-0.9.6/series
> @@ -0,0 +1 @@
> +001-make-opcontrol-busybox-compatible.patch
> -- 
> 1.7.9.5
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-30  7:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-28 12:42 [ptxdist] [PATCH] oprofile: Add patch to use busybox icm opcontrol Bart vdr. Meulen
2012-05-30  7:21 ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox