07 Feb, 2011

1 commit

  • GCC 4.6.0 in Fedora rawhide turned up some compile errors in tools/perf
    due to the -Werror=unused-but-set-variable flag.

    I've gone through and annotated some of the assignments that had side
    effects (ie: return value from a function) with the __used annotation,
    and in some cases, just removed unused code.

    In a few cases, we were assigning something useful, but not using it in
    later parts of the function.

    kyle@dreadnought:~/src% gcc --version
    gcc (GCC) 4.6.0 20110122 (Red Hat 4.6.0-0.3)

    Cc: Ingo Molnar
    LKML-Reference:
    Signed-off-by: Kyle McMartin
    [ committer note: Fixed up the annotation fixes, as that code moved recently ]
    Signed-off-by: Arnaldo Carvalho de Melo

    Kyle McMartin
     

26 Nov, 2010

2 commits

  • …_64.S memcpy routines via 'perf bench mem'

    This patch ports arch/x86/lib/memcpy_64.S to perf bench mem
    memcpy for benchmarking memcpy() in userland with tricky and
    dirty way.

    util/include/asm/cpufeature.h, util/include/asm/dwarf2.h, and
    util/include/linux/linkage.h are mostly dummy files with small
    wrappers, so that we are able to include memcpy_64.S
    unmodified.

    Signed-off-by: Hitoshi 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-2-git-send-email-mitake@dcl.info.waseda.ac.jp>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

    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: Hitoshi Mitake
    Cc: h.mitake@gmail.com
    Cc: Miao Xie
    Cc: Ma Ling
    Cc: Zhao Yakui
    Cc: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Paul Mackerras
    Cc: Frederic Weisbecker
    Cc: Steven Rostedt
    Cc: Andi Kleen
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Hitoshi Mitake
     

18 May, 2010

1 commit

  • To avoid problems like the one fixed by Stephane Eranian in 3de29ca, now
    we'll got this instead:

    bench/sched-messaging.c:259: error: negative width in bit-field ‘’
    bench/sched-messaging.c:261: error: negative width in bit-field ‘’

    Which is rather cryptic, but is how BUILD_BUG_ON_ZERO works, so kernel
    hackers should be already used to this.

    With it in place found some problems, fixed by changing the affected
    variables to sensible types or changed some OPT_INTEGER to OPT_UINTEGER.

    Next csets will go thru converting each of the remaining OPT_ so that
    review can be made easier by grouping changes per type per patch.

    Cc: Frédéric Weisbecker
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Cc: Tom Zanussi
    LKML-Reference:
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

14 Apr, 2010

1 commit

  • 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: Ian Munsie
    Acked-by: David S. Miller
    Cc: # NOTE: wont apply to .3[34].x cleanly, please backport
    Cc: Git development list
    Cc: Ian Munsie
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: KOSAKI Motohiro
    Cc: Hitoshi Mitake
    Cc: Rusty Russell
    Cc: Frederic Weisbecker
    Cc: Eric B Munson
    Cc: Valdis.Kletnieks@vt.edu
    Cc: WANG Cong
    Cc: Thiago Farina
    Cc: Masami Hiramatsu
    Cc: Xiao Guangrong
    Cc: Jaswinder Singh Rajput
    Cc: Arjan van de Ven
    Cc: OGAWA Hirofumi
    Cc: Mike Galbraith
    Cc: Tom Zanussi
    Cc: Anton Blanchard
    Cc: John Kacur
    Cc: Li Zefan
    Cc: Steven Rostedt
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Ian Munsie
     

08 Apr, 2010

1 commit


03 Apr, 2010

1 commit


14 Dec, 2009

2 commits

  • Here, tvec->tv_usec is "unsigned int" not "unsigned long".

    Since the type is different on every platform, it's probably
    best to just use long printf formats and cast.

    Signed-off-by: David S. Miller
    Cc: Peter Zijlstra
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    David Miller
     
  • This patch adds a new "all" pseudo subsystem and an "all" pseudo
    suite. These are for testing all subsystem and its all suite, or
    all suite of one subsystem.

    (This patch also contains a few trivial comment fixes for
    bench/* and output style fixes. I judged that there are no
    necessity to make them into individual patch.)

    Example of use:

    | % ./perf bench sched all # Test all suites of sched subsystem
    | # Running sched/messaging benchmark...
    | # 20 sender and receiver processes per group
    | # 10 groups == 400 processes run
    |
    | Total time: 0.414 [sec]
    |
    | # Running sched/pipe benchmark...
    | # Extecuted 1000000 pipe operations between two tasks
    |
    | Total time: 10.999 [sec]
    |
    | 10.999317 usecs/op
    | 90914 ops/sec
    |
    | % ./perf bench all # Test all suites of all subsystems
    | # Running sched/messaging benchmark...
    | # 20 sender and receiver processes per group
    | # 10 groups == 400 processes run
    |
    | Total time: 0.420 [sec]
    |
    | # Running sched/pipe benchmark...
    | # Extecuted 1000000 pipe operations between two tasks
    |
    | Total time: 11.741 [sec]
    |
    | 11.741346 usecs/op
    | 85169 ops/sec
    |
    | # Running mem/memcpy benchmark...
    | # Copying 1MB Bytes from 0x7ff33e920010 to 0x7ff3401ae010 ...
    |
    | 808.407437 MB/Sec

    Signed-off-by: Hitoshi Mitake
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Frederic Weisbecker
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Hitoshi Mitake
     

24 Nov, 2009

1 commit


22 Nov, 2009

1 commit

  • 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: Hitoshi Mitake
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Frederic Weisbecker
    LKML-Reference:
    [ v2: improved a few small details ]
    Signed-off-by: Ingo Molnar

    Hitoshi Mitake
     

19 Nov, 2009

1 commit

  • '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: Hitoshi Mitake
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Frederic Weisbecker
    LKML-Reference:
    [ v2: updated changelog, clarified history of builtin-bench.c ]
    Signed-off-by: Ingo Molnar

    Hitoshi Mitake
     

11 Nov, 2009

2 commits

  • This patch improves sched-message.c with more comfortable output.

    Change points are comment style description and
    formatting numerical values and its units.

    Example:

    | % perf bench sched messaging
    | # Running sched/messaging benchmark...
    | # 20 sender and receiver processes per group
    | # 10 groups == 400 processes run
    |
    | Total time: 1.490 [sec]

    Signed-off-by: Hitoshi Mitake
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Paul Mackerras

    Hitoshi Mitake
     
  • This patch improves sched-pipe.c with more comfortable output.

    Change points are comment style description and
    formatting numerical values and its units.

    Example:

    | % ./perf bench sched pipe
    | # Running sched/pipe benchmark...
    | # Extecuted 1000000 pipe operations between two tasks
    |
    | Total time:5.822 [sec]
    |
    | 5.822553 usecs/op
    | 171745 ops/sec

    Signed-off-by: Hitoshi Mitake
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Hitoshi Mitake
     

10 Nov, 2009

4 commits

  • Clean up initializers in bench.h:

    - No need to break the line for function prototypes, they are more
    readable in a single line. (even if checkpatch complains about it

    - We try to align definitions / structure fields vertically,
    to make it all a bit more readable.

    Signed-off-by: Ingo Molnar
    Signed-off-by: Hitoshi Mitake
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:

    Ingo Molnar
     
  • This patch modifies builtin-pipe.c for processing common
    options. The first option added is "--format".
    Users of perf bench will be able to specify output style by
    --format.

    Usage example:

    % ./perf bench sched pipe # with no style specify
    (executing 1000000 pipe operations between two tasks)

    Total time:5.855 sec
    5.855061 usecs/op
    170792 ops/sec

    % ./perf bench --format=simple sched pipe # specified simple
    5.988

    Signed-off-by: Hitoshi Mitake
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Paul Mackerras

    Hitoshi Mitake
     
  • This patch modifies bench/bench-messaging.c to adopt
    unified output formatting: --format option.

    Usage example:

    % ./perf bench sched messaging # with no style
    specify (20 sender and receiver processes per group)
    (10 groups == 400 processes run)

    Total time:1.431 sec

    % ./perf bench --format=simple sched messaging # specified
    simple 1.431

    Signed-off-by: Hitoshi Mitake
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Hitoshi Mitake
     
  • This patch adds some constants and extern declaration to
    bench.h. These are used for unified output formatting
    of 'perf bench'.

    Signed-off-by: Hitoshi Mitake
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Hitoshi Mitake
     

09 Nov, 2009

1 commit

  • Ingo reported this small 'perf bench sched pipe' output problem:

    | $ ./perf bench sched pipe
    | (executing 1000000 pipe operations between two tasks)
    |
    | Total time:4.898 sec
    | $ 4.898586 usecs/op
    | 204140 ops/sec
    |
    | the shell prompt came back before the usecs/op and ops/sec line
    | was printed. Process teardown race, lack of wait() or so?

    This caused by lack of calling waitpid() by parent process,
    so I added it.

    Signed-off-by: Hitoshi Mitake
    Cc: Rusty Russell
    Cc: Peter Zijlstra
    Cc: Paul Mackerras
    Cc: Mike Galbraith
    Cc: Arnaldo Carvalho de Melo
    Cc: Frederic Weisbecker
    Cc: Jiri Kosina
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Hitoshi Mitake
     

08 Nov, 2009

3 commits

  • This patch adds bench/sched-pipe.c.

    bench/sched-pipe.c is a benchmark program
    to measure performance of pipe() system call.
    This benchmark is based on pipe-test-1m.c by Ingo Molnar:

    http://people.redhat.com/mingo/cfs-scheduler/tools/pipe-test-1m.c

    Example of use:

    % perf bench sched pipe
    (executing 1000000 pipe operations between two tasks)

    Total time:4.499 sec
    4.499179 usecs/op
    222262 ops/sec

    % perf bench sched pipe -s -l 1000
    0.015

    Signed-off-by: Hitoshi Mitake
    Cc: Rusty Russell
    Cc: Peter Zijlstra
    Cc: Mike Galbraith
    Cc: Arnaldo Carvalho de Melo
    Cc: fweisbec@gmail.com
    Cc: Jiri Kosina
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Hitoshi Mitake
     
  • This patch adds bench/sched-messaging.c.

    This benchmark measures performance of scheduler and IPC
    mechanisms, and is based on hackbench by Rusty Russell.

    Example of usage:

    % perf bench sched messaging -g 20 -l 1000 -s
    5.432 # in sec

    % perf bench sched messaging # run with default
    options (20 sender and receiver processes per group)
    (10 groups == 400 processes run)

    Total time:0.308 sec

    % perf bench sched messaging -t -g 20 # # be multi-thread,
    with 20 groups (20 sender and receiver threads per group)
    (20 groups == 800 threads run)

    Total time:0.582 sec

    ( Rusty is the original author of hackbench.c and he said the code is
    and was under the GPLv2 so fine to be merged. )

    Signed-off-by: Hitoshi Mitake
    Acked-by: Rusty Russell
    Cc: Peter Zijlstra
    Cc: Mike Galbraith
    Cc: Arnaldo Carvalho de Melo
    Cc: fweisbec@gmail.com
    Cc: Jiri Kosina
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Hitoshi Mitake
     
  • This patch adds bench/ directory and bench/bench.h.

    bench/ directory will contain modules for bench subcommand.
    bench/bench.h is for listing prototypes of module functions.

    Signed-off-by: Hitoshi Mitake
    Cc: Rusty Russell
    Cc: Peter Zijlstra
    Cc: Mike Galbraith
    Cc: Arnaldo Carvalho de Melo
    Cc: fweisbec@gmail.com
    Cc: Jiri Kosina
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Hitoshi Mitake