mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH v2] Add flashbench tool
Date: Thu, 15 Mar 2012 10:57:43 +0100	[thread overview]
Message-ID: <20120315095743.GO20481@pengutronix.de> (raw)
In-Reply-To: <1331804658-11335-1-git-send-email-bernhard@bwalle.de>

On Thu, Mar 15, 2012 at 10:44:18AM +0100, Bernhard Walle wrote:
> From: Bernhard Walle <walle@corscience.de>
> 
> This patch adds the flashbench tool from Linaro Project
> git://git.linaro.org/people/arnd/flashbench.git. See also
> http://lwn.net/Articles/428584/. Because there is no tarball, I
> exported the current git repo and put it on my server.
> 
> The default maximum buffer size of 64 MiB (the buffer is allocated 4
> times) was too large for my device, so I patched the tool and added an
> option in the ptxdist menu.
> 
> Tested with a custom OMAP3 board which is similar to the Devkit8000.
> 
> Signed-off-by: Bernhard Walle <walle@corscience.de>
> ---
> v2: Correct URL (FIXME) in rules/flashbench.in.
> 
>  ...o-specify-MAX_BUFSIZE-during-compile-time.patch |   37 +++++++++++
>  patches/flashbench-20120222/series                 |    4 ++
>  rules/flashbench.in                                |   31 +++++++++
>  rules/flashbench.make                              |   68 ++++++++++++++++++++
>  4 files changed, 140 insertions(+)
>  create mode 100644 patches/flashbench-20120222/0001-Allow-to-specify-MAX_BUFSIZE-during-compile-time.patch
>  create mode 100644 patches/flashbench-20120222/series
>  create mode 100644 rules/flashbench.in
>  create mode 100644 rules/flashbench.make
> 
> diff --git a/patches/flashbench-20120222/0001-Allow-to-specify-MAX_BUFSIZE-during-compile-time.patch b/patches/flashbench-20120222/0001-Allow-to-specify-MAX_BUFSIZE-during-compile-time.patch
> new file mode 100644
> index 0000000..cc9505b
> --- /dev/null
> +++ b/patches/flashbench-20120222/0001-Allow-to-specify-MAX_BUFSIZE-during-compile-time.patch
> @@ -0,0 +1,37 @@
> +From: Bernhard Walle <walle@corscience.de>
> +Date: Wed, 14 Mar 2012 16:52:47 +0100
> +Subject: [PATCH] Allow to specify MAX_BUFSIZE during compile time
> +
> +The default value of 64 MiB is too large for small embedded systems.
> +
> +Signed-off-by: Bernhard Walle <walle@corscience.de>
> +---
> + Makefile |    2 +-
> + dev.c    |    2 ++
> + 2 files changed, 3 insertions(+), 1 deletion(-)
> +
> +diff --git a/Makefile b/Makefile
> +index 8fbd119..01771b0 100644
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -1,5 +1,5 @@
> + CC	:= gcc
> +-CFLAGS	:= -O2 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -g2
> ++CFLAGS	:= -O2 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -g2 $(EXTRA_CFLAGS)
> + LDFLAGS := -lrt
> + 
> + all: flashbench erase
> +diff --git a/dev.c b/dev.c
> +index f1718be..73a9b3f 100644
> +--- a/dev.c
> ++++ b/dev.c
> +@@ -22,7 +22,9 @@
> + 
> + #include "dev.h"
> + 
> ++#ifndef MAX_BUFSIZE
> + #define MAX_BUFSIZE (64 * 1024 * 1024)
> ++#endif
> + 
> + static inline long long time_to_ns(struct timespec *ts)
> + {
> diff --git a/patches/flashbench-20120222/series b/patches/flashbench-20120222/series
> new file mode 100644
> index 0000000..8ac1f19
> --- /dev/null
> +++ b/patches/flashbench-20120222/series
> @@ -0,0 +1,4 @@
> +# generated by git-ptx-patches
> +#tag:base --start-number 1
> +0001-Allow-to-specify-MAX_BUFSIZE-during-compile-time.patch
> +# 2284485069f201f5dd31c217b70f51e0  - git-ptx-patches magic
> diff --git a/rules/flashbench.in b/rules/flashbench.in
> new file mode 100644
> index 0000000..6f44015
> --- /dev/null
> +++ b/rules/flashbench.in
> @@ -0,0 +1,31 @@
> +## SECTION=test_suites
> +
> +config FLASHBENCH
> +	tristate
> +	prompt "flashbench"

make this a menuconfig please, with the proper whitespace padding.

> +	help
> +	  Identify characteristics of flash media
> +
> +	  This is the tool used to identify the properties of
> +	  SD cards and other media for the Linaro flash memory
> +	  survey at [1]. The latest version should be available
> +	  at [2]. Please also check out the article on lwn.net [3].
> +
> +	  [1] https://wiki.linaro.org/WorkingGroups/KernelConsolidation/Projects/FlashCardSurvey
> +	  [2] git clone git://git.linaro.org/people/arnd/flashbench.git
> +	  [3] http://lwn.net/Articles/428584/
> +
> +if FLASHBENCH
> +
> +config FLASHBENCH_MAX_BUFSIZE
> +	string
> +	prompt "Maximum flashbench buffer size in bytes"
> +	default 67108864

I think a value in MB would be nicer here.

Michael

> +	help
> +	  This is the maximum buffer size flashbench uses during operationg.
> +	  The buffer gets allocated 4 times, so take that into account when
> +	  choosing a buffer. The default is 64 MiB.
> +
> +endif
> +
> +# vim: set ft=kconfig:
> diff --git a/rules/flashbench.make b/rules/flashbench.make
> new file mode 100644
> index 0000000..f71f0c8
> --- /dev/null
> +++ b/rules/flashbench.make
> @@ -0,0 +1,68 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2012 by Bernhard Walle <walle@corscience.de>
> +#
> +# See CREDITS for details about who has contributed to this project.
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_FLASHBENCH) += flashbench
> +
> +#
> +# Paths and names
> +#
> +FLASHBENCH_VERSION	:= 20120222
> +FLASHBENCH_MD5		:= 3d99608022b50e891e5f66d7c637d8b1
> +FLASHBENCH		:= flashbench-$(FLASHBENCH_VERSION)
> +FLASHBENCH_SUFFIX	:= tar.gz
> +FLASHBENCH_URL		:= http://bwalle.de/programme/$(FLASHBENCH).$(FLASHBENCH_SUFFIX)
> +FLASHBENCH_SOURCE	:= $(SRCDIR)/$(FLASHBENCH).$(FLASHBENCH_SUFFIX)
> +FLASHBENCH_DIR		:= $(BUILDDIR)/$(FLASHBENCH)
> +FLASHBENCH_LICENSE	:= GPL v2
> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +FLASHBENCH_CONF_TOOL	:= NO
> +FLASHBENCH_MAKE_ENV	:= $(CROSS_ENV)
> +FLASHBENCH_MAKE_OPT	:= CC=$(CROSS_CC) \
> +	EXTRA_CFLAGS=-DMAX_BUFSIZE=$(PTXCONF_FLASHBENCH_MAX_BUFSIZE)
> +
> +# ----------------------------------------------------------------------------
> +# Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/flashbench.install:
> +	@$(call targetinfo)
> +	install -d $(FLASHBENCH_PKGDIR)/usr/sbin/
> +	install -m0755 $(FLASHBENCH_DIR)/flashbench $(FLASHBENCH_PKGDIR)/usr/sbin
> +	install -m0755 $(FLASHBENCH_DIR)/erase $(FLASHBENCH_PKGDIR)/usr/sbin
> +	@$(call touch)
> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/flashbench.targetinstall:
> +	@$(call targetinfo)
> +
> +	@$(call install_init, flashbench)
> +	@$(call install_fixup, flashbench,PRIORITY,optional)
> +	@$(call install_fixup, flashbench,SECTION,base)
> +	@$(call install_fixup, flashbench,AUTHOR,"Bernhard Walle <walle@corscience.de>")
> +	@$(call install_fixup, flashbench,DESCRIPTION,missing)
> +
> +	@$(call install_copy, flashbench, 0, 0, 0755, -, /usr/sbin/flashbench)
> +	@$(call install_copy, flashbench, 0, 0, 0755, -, /usr/sbin/erase)
> +
> +	@$(call install_finish, flashbench)
> +
> +	@$(call touch)
> +
> +# vim: syntax=make
> -- 
> 1.7.9.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

      reply	other threads:[~2012-03-15  9:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-15  9:44 Bernhard Walle
2012-03-15  9:57 ` Michael Olbrich [this message]

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=20120315095743.GO20481@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /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