1. 20 10月, 2015 6 次提交
    • I
      perf bench mem: Change 'cycle' to 'cycles' · b14f2d35
      Ingo Molnar 提交于
      So 'perf bench mem memset/memcpy' has a CPU cycles measurement method,
      but calls it 'cycle' (singular) throughout the code, which makes it
      harder to read.
      
      Rename all related functions, variables and options to a plural 'cycles'
      nomenclature.
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/1445241870-24854-8-git-send-email-mingo@kernel.org
      [ s/--cycle/--cycles/g in perf-bench man page ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b14f2d35
    • I
      perf bench: Remove the prefaulting complication from 'perf bench mem mem*' · 6db175c7
      Ingo Molnar 提交于
      So 'perf bench mem memcpy/memset' has elaborate code to measure
      memcpy()/memset() performance both with freshly allocated buffers (which
      includes initial page fault overhead) and with preallocated buffers.
      
      But the thing is, the resulting bandwidth results are mostly
      meaningless, because page faults dominate so much of the cost.
      
      It might make sense to measure cache cold vs. cache hot performance, but
      the code does not do this.
      
      So remove this complication, and always prefault the ranges before using
      them.
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/1445241870-24854-6-git-send-email-mingo@kernel.org
      [ Remove --no-prefault, --only-prefault from docs, noticed by David Ahern ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6db175c7
    • I
      perf bench: Rename 'mem-memcpy.c' => 'mem-functions.c' · 9b2fa7f3
      Ingo Molnar 提交于
      So mem-memcpy.c started out as a simple memcpy() benchmark, then it grew
      memset() functionality and now I plan to add string copy benchmarks as
      well.
      
      This makes the file name a misnomer: rename it to the more generic
      mem-functions.c name.
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/1445241870-24854-5-git-send-email-mingo@kernel.org
      [ The "rename" was introducing __unused, wasn't removing the old file,
        and didn't update tools/perf/bench/Build, fix it ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9b2fa7f3
    • I
      perf bench: Eliminate unused argument from bench_mem_common() · 2946f59a
      Ingo Molnar 提交于
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/1445241870-24854-4-git-send-email-mingo@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2946f59a
    • I
      perf bench: Default to all routines in 'perf bench mem' · 27619741
      Ingo Molnar 提交于
      So few people know that the --routine option to 'perf bench memcpy/memset'
      exists, and would not know that it's capable of testing the kernel's
      memcpy/memset implementations.
      
      Furthermore, 'perf bench mem all' will not run all routines:
      
      	vega:~> perf bench mem all
      	# Running mem/memcpy benchmark...
      	Routine default (Default memcpy() provided by glibc)
      	# Copying 1MB Bytes ...
      
      	     894.454383 MB/Sec
      	       3.844734 GB/Sec (with prefault)
      
      	# Running mem/memset benchmark...
      	Routine default (Default memset() provided by glibc)
      	# Copying 1MB Bytes ...
      
      	       1.220703 GB/Sec
      	       9.042245 GB/Sec (with prefault)
      
      Because misleadingly the 'all' refers to 'all sub-benchmarks', not 'all
      sub-benchmarks and routines'.
      
      Fix all this by making the memcpy/memset routine to default to 'all',
      which results in all the benchmarks being run:
      
      	triton:~> perf bench mem all
      	# Running mem/memcpy benchmark...
      	Routine default (Default memcpy() provided by glibc)
      	# Copying 1MB Bytes ...
      
      	       1.448906 GB/Sec
      	       4.957170 GB/Sec (with prefault)
      	Routine x86-64-unrolled (unrolled memcpy() in arch/x86/lib/memcpy_64.S)
      	# Copying 1MB Bytes ...
      
      	       1.614153 GB/Sec
      	       4.379204 GB/Sec (with prefault)
      	Routine x86-64-movsq (movsq-based memcpy() in arch/x86/lib/memcpy_64.S)
      	# Copying 1MB Bytes ...
      
      	       1.570036 GB/Sec
      	       4.264465 GB/Sec (with prefault)
      	Routine x86-64-movsb (movsb-based memcpy() in arch/x86/lib/memcpy_64.S)
      	# Copying 1MB Bytes ...
      
      	       1.788576 GB/Sec
      	       6.554111 GB/Sec (with prefault)
      
      	# Running mem/memset benchmark...
      	Routine default (Default memset() provided by glibc)
      	# Copying 1MB Bytes ...
      
      	       2.082223 GB/Sec
      	       9.126752 GB/Sec (with prefault)
      	Routine x86-64-unrolled (unrolled memset() in arch/x86/lib/memset_64.S)
      	# Copying 1MB Bytes ...
      
      	       5.710892 GB/Sec
      	       8.346688 GB/Sec (with prefault)
      	Routine x86-64-stosq (movsq-based memset() in arch/x86/lib/memset_64.S)
      	# Copying 1MB Bytes ...
      
      	       9.765625 GB/Sec
      	      12.520032 GB/Sec (with prefault)
      	Routine x86-64-stosb (movsb-based memset() in arch/x86/lib/memset_64.S)
      	# Copying 1MB Bytes ...
      
      	       9.668936 GB/Sec
      	      12.682630 GB/Sec (with prefault)
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/1445241870-24854-3-git-send-email-mingo@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      27619741
    • I
      perf bench: Improve the 'perf bench mem memcpy' code readability · 13839ec4
      Ingo Molnar 提交于
       - improve the readability of initializations
       - fix unnecessary double negations
       - fix ugly line breaks
       - fix other small details
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/1445241870-24854-2-git-send-email-mingo@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      13839ec4
  2. 04 3月, 2015 2 次提交
  3. 23 2月, 2015 1 次提交
  4. 09 12月, 2014 3 次提交
  5. 18 7月, 2014 1 次提交
  6. 20 6月, 2014 1 次提交
  7. 09 10月, 2013 1 次提交
  8. 22 7月, 2013 1 次提交
  9. 09 7月, 2013 1 次提交
  10. 11 9月, 2012 1 次提交
    • I
      perf tools: Use __maybe_used for unused variables · 1d037ca1
      Irina Tirdea 提交于
      perf defines both __used and __unused variables to use for marking
      unused variables. The variable __used is defined to
      __attribute__((__unused__)), which contradicts the kernel definition to
      __attribute__((__used__)) for new gcc versions. On Android, __used is
      also defined in system headers and this leads to warnings like: warning:
      '__used__' attribute ignored
      
      __unused is not defined in the kernel and is not a standard definition.
      If __unused is included everywhere instead of __used, this leads to
      conflicts with glibc headers, since glibc has a variables with this name
      in its headers.
      
      The best approach is to use __maybe_unused, the definition used in the
      kernel for __attribute__((unused)). In this way there is only one
      definition in perf sources (instead of 2 definitions that point to the
      same thing: __used and __unused) and it works on both Linux and Android.
      This patch simply replaces all instances of __used and __unused with
      __maybe_unused.
      Signed-off-by: NIrina Tirdea <irina.tirdea@intel.com>
      Acked-by: NPekka Enberg <penberg@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1347315303-29906-7-git-send-email-irina.tirdea@intel.com
      [ committer note: fixed up conflict with a116e05d in builtin-sched.c ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1d037ca1
  11. 03 7月, 2012 1 次提交
  12. 28 6月, 2012 1 次提交
  13. 31 1月, 2012 1 次提交
  14. 25 1月, 2012 1 次提交
  15. 26 11月, 2010 1 次提交
    • H
      perf bench: Print both of prefaulted and no prefaulted results by default · 49ce8fc6
      Hitoshi Mitake 提交于
      After applying this patch, perf bench mem memcpy prints
      both of prefualted and without prefaulted score of memcpy().
      
      New options --no-prefault and --only-prefault are added
      to print single result, mainly for scripting usage.
      
      Usage example:
      
       | mitake@X201i:~/linux/.../tools/perf% ./perf bench mem memcpy -l 500MB
       | # Running mem/memcpy benchmark...
       | # Copying 500MB Bytes ...
       |
       |      634.969014 MB/Sec
       |        4.828062 GB/Sec (with prefault)
       | mitake@X201i:~/linux/.../tools/perf% ./perf bench mem memcpy -l 500MB --only-prefault
       | # Running mem/memcpy benchmark...
       | # Copying 500MB Bytes ...
       |
       |        4.705192 GB/Sec (with prefault)
       | mitake@X201i:~/linux/.../tools/perf% ./perf bench mem memcpy -l 500MB --no-prefault
       | # Running mem/memcpy benchmark...
       | # Copying 500MB Bytes ...
       |
       |      642.725568 MB/Sec
      Signed-off-by: NHitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: h.mitake@gmail.com
      Cc: Miao Xie <miaox@cn.fujitsu.com>
      Cc: Ma Ling <ling.ma@intel.com>
      Cc: Zhao Yakui <yakui.zhao@intel.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      LKML-Reference: <1290668693-27068-1-git-send-email-mitake@dcl.info.waseda.ac.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      49ce8fc6
  16. 14 4月, 2010 1 次提交
    • I
      perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() · c0555642
      Ian Munsie 提交于
      Parsing an option from the command line with OPT_BOOLEAN on a
      bool data type would not work on a big-endian machine due to the
      manner in which the boolean was being cast into an int and
      incremented. For example, running 'perf probe --list' on a
      PowerPC machine would fail to properly set the list_events bool
      and would therefore print out the usage information and
      terminate.
      
      This patch makes OPT_BOOLEAN work as expected with a bool
      datatype. For cases where the original OPT_BOOLEAN was
      intentionally being used to increment an int each time it was
      passed in on the command line, this patch introduces OPT_INCR
      with the old behaviour of OPT_BOOLEAN (the verbose variable is
      currently the only such example of this).
      
      I have reviewed every use of OPT_BOOLEAN to verify that a true
      C99 bool was passed. Where integers were used, I verified that
      they were only being used for boolean logic and changed them to
      bools to ensure that they would not be mistakenly used as ints.
      The major exception was the verbose variable which now uses
      OPT_INCR instead of OPT_BOOLEAN.
      Signed-off-by: NIan Munsie <imunsie@au.ibm.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Cc: <stable@kernel.org> # NOTE: wont apply to .3[34].x cleanly, please backport
      Cc: Git development list <git@vger.kernel.org>
      Cc: Ian Munsie <imunsie@au1.ibm.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Eric B Munson <ebmunson@us.ibm.com>
      Cc: Valdis.Kletnieks@vt.edu
      Cc: WANG Cong <amwang@redhat.com>
      Cc: Thiago Farina <tfransosi@gmail.com>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      Cc: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1271147857-11604-1-git-send-email-imunsie@au.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c0555642
  17. 03 4月, 2010 1 次提交
  18. 24 11月, 2009 1 次提交
  19. 22 11月, 2009 1 次提交
    • H
      perf bench: Make the mem/memcpy tests more user-friendly · 12eac0bf
      Hitoshi Mitake 提交于
      mem-memcpy.c uses perf event system calls to obtain CPU clocks.
      And it suddenly dies with BUG_ON() when it running on Linux
      doesn't support perf event.
      
      Also fail at calloc() can occur easily when too large
      length is passed. Fail of calloc() causes sudden death
      with assert().
      
      These behaviours are not friendly. So I fixed the treating of
      errors.
      Signed-off-by: NHitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1258688237-3797-1-git-send-email-mitake@dcl.info.waseda.ac.jp>
      [ v2: improved a few small details ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      12eac0bf
  20. 19 11月, 2009 1 次提交
    • H
      perf bench: Add memcpy() benchmark · 827f3b49
      Hitoshi Mitake 提交于
      'perf bench mem memcpy' is a benchmark suite for measuring memcpy()
      performance.
      
      Example on a Intel(R) Core(TM)2 Duo CPU E6850 @ 3.00GHz:
      
      | % perf bench mem memcpy -l 1GB
      | # Running mem/memcpy benchmark...
      | # Copying 1MB Bytes from 0xb7d98008 to 0xb7e99008 ...
      |
      |     726.216412 MB/Sec
      Signed-off-by: NHitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1258471212-30281-1-git-send-email-mitake@dcl.info.waseda.ac.jp>
      [ v2: updated changelog, clarified history of builtin-bench.c ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      827f3b49