mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] flashbench: print strerror(3)
@ 2013-10-15 10:58 Andreas Bießmann
  2014-02-20 12:42 ` Andreas Bießmann
  2014-04-23 10:02 ` Andreas Bießmann
  0 siblings, 2 replies; 6+ messages in thread
From: Andreas Bießmann @ 2013-10-15 10:58 UTC (permalink / raw)
  To: PTXdist ML; +Cc: Andreas Bießmann

flashbench may end without any comment on error in setup (mostly ENOMEM on
allocating scratch buffer).
To avoid others searching again add strerror(3) to give a hint to the user.

Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
---
 .../0003-flashbench-printout-error.patch           |   33 ++++++++++++++++++++
 patches/flashbench-20120222/series                 |    3 +-
 2 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 patches/flashbench-20120222/0003-flashbench-printout-error.patch

diff --git a/patches/flashbench-20120222/0003-flashbench-printout-error.patch b/patches/flashbench-20120222/0003-flashbench-printout-error.patch
new file mode 100644
index 0000000..63c7453
--- /dev/null
+++ b/patches/flashbench-20120222/0003-flashbench-printout-error.patch
@@ -0,0 +1,33 @@
+From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= <andreas.biessmann@corscience.de>
+Date: Tue, 15 Oct 2013 12:37:48 +0200
+Subject: [PATCH] flashbench: printout error
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In order to get a clue _what_ happened printout the error string.
+
+Signed-off-by: Andreas Bießmann <andreas.biessmann@corscience.de>
+---
+ flashbench.c |    8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/flashbench.c b/flashbench.c
+index 0a1016f..5b553c7 100644
+--- a/flashbench.c
++++ b/flashbench.c
+@@ -19,7 +19,13 @@
+ 
+ typedef long long ns_t;
+ 
+-#define returnif(x) do { typeof(x) __x = (x); if (__x < 0) return (__x); } while (0)
++#define returnif(x) do {                                                      \
++	typeof(x) __x = (x);                                                      \
++	if (__x < 0) {                                                            \
++		fprintf(stderr, "flashbench: internal error '%s'\n", strerror(-__x)); \
++		return (__x);                                                         \
++	}                                                                         \
++	} while (0)
+ 
+ static ns_t ns_min(int count, ns_t data[])
+ {
diff --git a/patches/flashbench-20120222/series b/patches/flashbench-20120222/series
index b63b21f..82de47c 100644
--- a/patches/flashbench-20120222/series
+++ b/patches/flashbench-20120222/series
@@ -2,4 +2,5 @@
 #tag:base --start-number 1
 0001-Allow-to-specify-MAX_BUFSIZE-during-compile-time.patch
 0002-Add-lrt-to-LDLIBS-instead-of-LDFLAGS.patch
-# fa6c1da743f5dd6808f0f1b887b31657  - git-ptx-patches magic
+0003-flashbench-printout-error.patch
+# 429c331f680c7d428505b255597dd1f0  - git-ptx-patches magic
-- 
1.7.10.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] flashbench: print strerror(3)
  2013-10-15 10:58 [ptxdist] [PATCH] flashbench: print strerror(3) Andreas Bießmann
@ 2014-02-20 12:42 ` Andreas Bießmann
  2014-04-23 10:02 ` Andreas Bießmann
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Bießmann @ 2014-02-20 12:42 UTC (permalink / raw)
  To: ptxdist


[-- Attachment #1.1: Type: text/plain, Size: 2916 bytes --]

ping ...

On 10/15/2013 12:58 PM, Andreas Bießmann wrote:
> flashbench may end without any comment on error in setup (mostly ENOMEM on
> allocating scratch buffer).
> To avoid others searching again add strerror(3) to give a hint to the user.
> 
> Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
> ---
>  .../0003-flashbench-printout-error.patch           |   33 ++++++++++++++++++++
>  patches/flashbench-20120222/series                 |    3 +-
>  2 files changed, 35 insertions(+), 1 deletion(-)
>  create mode 100644 patches/flashbench-20120222/0003-flashbench-printout-error.patch
> 
> diff --git a/patches/flashbench-20120222/0003-flashbench-printout-error.patch b/patches/flashbench-20120222/0003-flashbench-printout-error.patch
> new file mode 100644
> index 0000000..63c7453
> --- /dev/null
> +++ b/patches/flashbench-20120222/0003-flashbench-printout-error.patch
> @@ -0,0 +1,33 @@
> +From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= <andreas.biessmann@corscience.de>
> +Date: Tue, 15 Oct 2013 12:37:48 +0200
> +Subject: [PATCH] flashbench: printout error
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +In order to get a clue _what_ happened printout the error string.
> +
> +Signed-off-by: Andreas Bießmann <andreas.biessmann@corscience.de>
> +---
> + flashbench.c |    8 +++++++-
> + 1 file changed, 7 insertions(+), 1 deletion(-)
> +
> +diff --git a/flashbench.c b/flashbench.c
> +index 0a1016f..5b553c7 100644
> +--- a/flashbench.c
> ++++ b/flashbench.c
> +@@ -19,7 +19,13 @@
> + 
> + typedef long long ns_t;
> + 
> +-#define returnif(x) do { typeof(x) __x = (x); if (__x < 0) return (__x); } while (0)
> ++#define returnif(x) do {                                                      \
> ++	typeof(x) __x = (x);                                                      \
> ++	if (__x < 0) {                                                            \
> ++		fprintf(stderr, "flashbench: internal error '%s'\n", strerror(-__x)); \
> ++		return (__x);                                                         \
> ++	}                                                                         \
> ++	} while (0)
> + 
> + static ns_t ns_min(int count, ns_t data[])
> + {
> diff --git a/patches/flashbench-20120222/series b/patches/flashbench-20120222/series
> index b63b21f..82de47c 100644
> --- a/patches/flashbench-20120222/series
> +++ b/patches/flashbench-20120222/series
> @@ -2,4 +2,5 @@
>  #tag:base --start-number 1
>  0001-Allow-to-specify-MAX_BUFSIZE-during-compile-time.patch
>  0002-Add-lrt-to-LDLIBS-instead-of-LDFLAGS.patch
> -# fa6c1da743f5dd6808f0f1b887b31657  - git-ptx-patches magic
> +0003-flashbench-printout-error.patch
> +# 429c331f680c7d428505b255597dd1f0  - git-ptx-patches magic
> 

anything wrong with this patchset?

Best regards

Andreas Bießmann


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

[-- Attachment #2: Type: text/plain, Size: 48 bytes --]

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] flashbench: print strerror(3)
  2013-10-15 10:58 [ptxdist] [PATCH] flashbench: print strerror(3) Andreas Bießmann
  2014-02-20 12:42 ` Andreas Bießmann
@ 2014-04-23 10:02 ` Andreas Bießmann
  2014-04-23 12:52   ` Michael Olbrich
  2014-04-26 13:37   ` Bernhard Walle
  1 sibling, 2 replies; 6+ messages in thread
From: Andreas Bießmann @ 2014-04-23 10:02 UTC (permalink / raw)
  To: ptxdist; +Cc: Walle Bernhard

Hi,

anything wrong with this patch?
Bernhard, I realized this code is on your server. Would you build a new 
version with this attached patch applied?

Best regards

Andreas Bießmann

Am 2013-10-15 12:58, schrieb Andreas Bießmann:
> flashbench may end without any comment on error in setup (mostly ENOMEM 
> on
> allocating scratch buffer).
> To avoid others searching again add strerror(3) to give a hint to the 
> user.
> 
> Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
> ---
>  .../0003-flashbench-printout-error.patch           |   33 
> ++++++++++++++++++++
>  patches/flashbench-20120222/series                 |    3 +-
>  2 files changed, 35 insertions(+), 1 deletion(-)
>  create mode 100644
> patches/flashbench-20120222/0003-flashbench-printout-error.patch
> 
> diff --git
> a/patches/flashbench-20120222/0003-flashbench-printout-error.patch
> b/patches/flashbench-20120222/0003-flashbench-printout-error.patch
> new file mode 100644
> index 0000000..63c7453
> --- /dev/null
> +++ b/patches/flashbench-20120222/0003-flashbench-printout-error.patch
> @@ -0,0 +1,33 @@
> +From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= 
> <andreas.biessmann@corscience.de>
> +Date: Tue, 15 Oct 2013 12:37:48 +0200
> +Subject: [PATCH] flashbench: printout error
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +In order to get a clue _what_ happened printout the error string.
> +
> +Signed-off-by: Andreas Bießmann <andreas.biessmann@corscience.de>
> +---
> + flashbench.c |    8 +++++++-
> + 1 file changed, 7 insertions(+), 1 deletion(-)
> +
> +diff --git a/flashbench.c b/flashbench.c
> +index 0a1016f..5b553c7 100644
> +--- a/flashbench.c
> ++++ b/flashbench.c
> +@@ -19,7 +19,13 @@
> +
> + typedef long long ns_t;
> +
> +-#define returnif(x) do { typeof(x) __x = (x); if (__x < 0) return
> (__x); } while (0)
> ++#define returnif(x) do {
>          \
> ++	typeof(x) __x = (x);                                                 
>      \
> ++	if (__x < 0) {                                                       
>      \
> ++		fprintf(stderr, "flashbench: internal error '%s'\n", 
> strerror(-__x)); \
> ++		return (__x);                                                       
>   \
> ++	}                                                                    
>      \
> ++	} while (0)
> +
> + static ns_t ns_min(int count, ns_t data[])
> + {
> diff --git a/patches/flashbench-20120222/series
> b/patches/flashbench-20120222/series
> index b63b21f..82de47c 100644
> --- a/patches/flashbench-20120222/series
> +++ b/patches/flashbench-20120222/series
> @@ -2,4 +2,5 @@
>  #tag:base --start-number 1
>  0001-Allow-to-specify-MAX_BUFSIZE-during-compile-time.patch
>  0002-Add-lrt-to-LDLIBS-instead-of-LDFLAGS.patch
> -# fa6c1da743f5dd6808f0f1b887b31657  - git-ptx-patches magic
> +0003-flashbench-printout-error.patch
> +# 429c331f680c7d428505b255597dd1f0  - git-ptx-patches magic
> --
> 1.7.10.4

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] flashbench: print strerror(3)
  2014-04-23 10:02 ` Andreas Bießmann
@ 2014-04-23 12:52   ` Michael Olbrich
  2014-04-26 13:42     ` Bernhard Walle
  2014-04-26 13:37   ` Bernhard Walle
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Olbrich @ 2014-04-23 12:52 UTC (permalink / raw)
  To: ptxdist

Hi,

On Wed, Apr 23, 2014 at 12:02:41PM +0200, Andreas Bießmann wrote:
> anything wrong with this patch?

I remember looking at the patch, but it seems I never wrote a reply.
It's a bit ugly, because from what I can tell 'returnif' is called more
than once for some errors.
I don't really have a strong opinion either way, but I'd prefer it if it
was clean what will happen upstream here.

> Bernhard, I realized this code is on your server. Would you build a
> new version with this attached patch applied?

Bernhard, you created a tarball. Are you our upstream or is this from
somewhere else?

Michael

> Best regards
> 
> Andreas Bießmann
> 
> Am 2013-10-15 12:58, schrieb Andreas Bießmann:
> >flashbench may end without any comment on error in setup (mostly
> >ENOMEM on
> >allocating scratch buffer).
> >To avoid others searching again add strerror(3) to give a hint to
> >the user.
> >
> >Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
> >---
> > .../0003-flashbench-printout-error.patch           |   33
> >++++++++++++++++++++
> > patches/flashbench-20120222/series                 |    3 +-
> > 2 files changed, 35 insertions(+), 1 deletion(-)
> > create mode 100644
> >patches/flashbench-20120222/0003-flashbench-printout-error.patch
> >
> >diff --git
> >a/patches/flashbench-20120222/0003-flashbench-printout-error.patch
> >b/patches/flashbench-20120222/0003-flashbench-printout-error.patch
> >new file mode 100644
> >index 0000000..63c7453
> >--- /dev/null
> >+++ b/patches/flashbench-20120222/0003-flashbench-printout-error.patch
> >@@ -0,0 +1,33 @@
> >+From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?=
> ><andreas.biessmann@corscience.de>
> >+Date: Tue, 15 Oct 2013 12:37:48 +0200
> >+Subject: [PATCH] flashbench: printout error
> >+MIME-Version: 1.0
> >+Content-Type: text/plain; charset=UTF-8
> >+Content-Transfer-Encoding: 8bit
> >+
> >+In order to get a clue _what_ happened printout the error string.
> >+
> >+Signed-off-by: Andreas Bießmann <andreas.biessmann@corscience.de>
> >+---
> >+ flashbench.c |    8 +++++++-
> >+ 1 file changed, 7 insertions(+), 1 deletion(-)
> >+
> >+diff --git a/flashbench.c b/flashbench.c
> >+index 0a1016f..5b553c7 100644
> >+--- a/flashbench.c
> >++++ b/flashbench.c
> >+@@ -19,7 +19,13 @@
> >+
> >+ typedef long long ns_t;
> >+
> >+-#define returnif(x) do { typeof(x) __x = (x); if (__x < 0) return
> >(__x); } while (0)
> >++#define returnif(x) do {
> >         \
> >++	typeof(x) __x = (x);
> >\
> >++	if (__x < 0) {
> >\
> >++		fprintf(stderr, "flashbench: internal error '%s'\n",
> >strerror(-__x)); \
> >++		return (__x);
> >\
> >++	}
> >\
> >++	} while (0)
> >+
> >+ static ns_t ns_min(int count, ns_t data[])
> >+ {
> >diff --git a/patches/flashbench-20120222/series
> >b/patches/flashbench-20120222/series
> >index b63b21f..82de47c 100644
> >--- a/patches/flashbench-20120222/series
> >+++ b/patches/flashbench-20120222/series
> >@@ -2,4 +2,5 @@
> > #tag:base --start-number 1
> > 0001-Allow-to-specify-MAX_BUFSIZE-during-compile-time.patch
> > 0002-Add-lrt-to-LDLIBS-instead-of-LDFLAGS.patch
> >-# fa6c1da743f5dd6808f0f1b887b31657  - git-ptx-patches magic
> >+0003-flashbench-printout-error.patch
> >+# 429c331f680c7d428505b255597dd1f0  - git-ptx-patches magic
> >--
> >1.7.10.4
> 
> -- 
> 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] 6+ messages in thread

* Re: [ptxdist] [PATCH] flashbench: print strerror(3)
  2014-04-23 10:02 ` Andreas Bießmann
  2014-04-23 12:52   ` Michael Olbrich
@ 2014-04-26 13:37   ` Bernhard Walle
  1 sibling, 0 replies; 6+ messages in thread
From: Bernhard Walle @ 2014-04-26 13:37 UTC (permalink / raw)
  To: Andreas Bießmann, ptxdist

Hello,

Am 23.04.14 12:02, schrieb Andreas Bießmann:
> 
> anything wrong with this patch?
> Bernhard, I realized this code is on your server. Would you build a new
> version with this attached patch applied?

It doesn't make sense. I just uploaded a git snapshot to make it
available via HTTP. I can surely create an updated tarball, but it
should be in sync with mainline.

Honestly, I don't know what "current upstream" means.
https://gitorious.org/flashbench looks good.

Regards,
Bernhard


-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] flashbench: print strerror(3)
  2014-04-23 12:52   ` Michael Olbrich
@ 2014-04-26 13:42     ` Bernhard Walle
  0 siblings, 0 replies; 6+ messages in thread
From: Bernhard Walle @ 2014-04-26 13:42 UTC (permalink / raw)
  To: ptxdist

Am 23.04.14 14:52, schrieb Michael Olbrich:
>> > Bernhard, I realized this code is on your server. Would you build a
>> > new version with this attached patch applied?
> Bernhard, you created a tarball. Are you our upstream or is this from
> somewhere else?

No, it's from the git tree. Don't ask me about the URL, but the hash is:

  % gunzip -c flashbench-20120222.tar.gz |git get-tar-commit-id
  9ede0814d2f7fe1bf2ab47f1e37b796fe2264ede

  % git clone git://git.linaro.org/people/arnd/flashbench.git
  git show 9ede0814d2f7fe1bf2ab47f1e37b796fe2264ede

Okay, seems to be the correct tree.

If someone wants to update, I uploaded a new tarball as
flashbench-20140426.tar.gz. The old one is still there, of course.


Regards,
Bernhard


-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2014-04-26 13:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-15 10:58 [ptxdist] [PATCH] flashbench: print strerror(3) Andreas Bießmann
2014-02-20 12:42 ` Andreas Bießmann
2014-04-23 10:02 ` Andreas Bießmann
2014-04-23 12:52   ` Michael Olbrich
2014-04-26 13:42     ` Bernhard Walle
2014-04-26 13:37   ` Bernhard Walle

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