1. 03 1月, 2017 1 次提交
  2. 25 10月, 2016 1 次提交
  3. 12 1月, 2016 1 次提交
    • J
      tools subcmd: Add missing NORETURN define for parse-options.h · 24b1e5d7
      Josh Poimboeuf 提交于
      parse-options.h uses the NORETURN macro without defining it.  perf
      doesn't see a build error because it defines the macro in util.h before
      including parse-options.h.  But any other tool including it will see an
      error.
      
      Define the macro in parse-options.h (if not already defined) so that
      other tools can include it.
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Bernd Petrovitsch <bernd@petrovitsch.priv.at>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Chris J Arges <chris.j.arges@canonical.com>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Pedro Alves <palves@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: live-patching@vger.kernel.org
      Cc: x86@kernel.org
      Link: http://lkml.kernel.org/r/6c16294ac6dbe5e2ca28fd935fe4389996588564.1450442274.git.jpoimboe@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      24b1e5d7
  4. 18 12月, 2015 3 次提交
  5. 17 12月, 2015 1 次提交
  6. 14 12月, 2015 2 次提交
    • W
      perf tools: Make options always available, even if required libs not linked · 48e1cab1
      Wang Nan 提交于
      This patch keeps options of perf builtins same in all conditions. If
      one option is disabled because of compiling options, users should be
      notified.
      
      Masami suggested another implementation in [1] that, by adding a
      OPTION_NEXT_DEPENDS option before those options in the 'struct option'
      array, options parser knows an option is disabled. However, in some
      cases this array is reordered (options__order()). In addition, in
      parse-option.c that array is const, so we can't simply merge
      information in decorator option into the affacted option.
      
      This patch chooses a simpler implementation that, introducing a
      set_option_nobuild() function and two option parsing flags. Builtins
      with such options should call set_option_nobuild() before option
      parsing. The complexity of this patch is because we want some of options
      can be skipped safely. In this case their arguments should also be
      consumed.
      
      Options in 'perf record' and 'perf probe' are fixed in this patch.
      
      [1] http://lkml.kernel.org/g/50399556C9727B4D88A595C8584AAB3752627CD4@GSjpTKYDCembx32.service.hitachi.net
      
      Test result:
      
      Normal case:
      
        # ./perf probe --vmlinux /tmp/vmlinux sys_write
        Added new event:
          probe:sys_write      (on sys_write)
      
        You can now use it in all perf tools, such as:
      
      	perf record -e probe:sys_write -aR sleep 1
      
      Build with NO_DWARF=1:
      
        # ./perf probe -L sys_write
          Error: switch `L' is not available because NO_DWARF=1
      
         Usage: perf probe [<options>] 'PROBEDEF' ['PROBEDEF' ...]
            or: perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]
            or: perf probe [<options>] --del '[GROUP:]EVENT' ...
            or: perf probe --list [GROUP:]EVENT ...
            or: perf probe [<options>] --funcs
      
          -L, --line <FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]>
                                Show source code lines.
                                (not built-in because NO_DWARF=1)
      
        # ./perf probe -k /tmp/vmlinux sys_write
          Warning: switch `k' is being ignored because NO_DWARF=1
        Added new event:
          probe:sys_write      (on sys_write)
      
        You can now use it in all perf tools, such as:
      
      	perf record -e probe:sys_write -aR sleep 1
      
        # ./perf probe --vmlinux /tmp/vmlinux sys_write
          Warning: option `vmlinux' is being ignored because NO_DWARF=1
        Added new event:
        [SNIP]
      
        # ./perf probe -l
         Usage: perf probe [<options>] 'PROBEDEF' ['PROBEDEF' ...]
            or: perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]
      ...
          -k, --vmlinux <file>  vmlinux pathname
                                (not built-in because NO_DWARF=1)
          -L, --line <FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]>
                                Show source code lines.
                                (not built-in because NO_DWARF=1)
      ...
          -V, --vars <FUNC[@src][+OFF|%return|:RL|;PT]|SRC:AL|SRC;PT>
                                Show accessible variables on PROBEDEF
                                (not built-in because NO_DWARF=1)
              --externs         Show external variables too (with --vars only)
                                (not built-in because NO_DWARF=1)
              --no-inlines      Don't search inlined functions
                                (not built-in because NO_DWARF=1)
              --range           Show variables location range in scope (with --vars only)
                                (not built-in because NO_DWARF=1)
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1450089563-122430-14-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      48e1cab1
    • J
      perf tools: Convert parse-options.c internal functions to static · 408cf34c
      Josh Poimboeuf 提交于
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/c027b5f47ec1055077f5650edb1c7ad37c191e6c.1449965119.git.jpoimboe@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      408cf34c
  7. 27 10月, 2015 2 次提交
  8. 06 5月, 2015 1 次提交
  9. 20 3月, 2015 1 次提交
  10. 29 10月, 2014 2 次提交
  11. 17 7月, 2014 1 次提交
  12. 15 3月, 2014 1 次提交
  13. 28 11月, 2013 1 次提交
  14. 04 11月, 2013 1 次提交
  15. 03 10月, 2012 1 次提交
  16. 07 12月, 2010 1 次提交
  17. 18 5月, 2010 4 次提交
    • A
      perf options: Type check all the remaining OPT_ variants · edb7c60e
      Arnaldo Carvalho de Melo 提交于
      OPT_SET_INT was renamed to OPT_SET_UINT since the only use in these
      tools is to set something that has an enum type, that is builtin
      compatible with unsigned int.
      
      Several string constifications were done to make OPT_STRING require a
      const char * type.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      edb7c60e
    • A
      perf options: Type check OPT_BOOLEAN and fix the offenders · 8035458f
      Arnaldo Carvalho de Melo 提交于
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8035458f
    • A
      perf options: Check v type in OPT_U?INTEGER · 1967936d
      Arnaldo Carvalho de Melo 提交于
      To avoid problems like the one fixed by Stephane Eranian in 3de29cab, now
      we'll got this instead:
      
      	bench/sched-messaging.c:259: error: negative width in bit-field ‘<anonymous>’
      	bench/sched-messaging.c:261: error: negative width in bit-field ‘<anonymous>’
      
      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 <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1967936d
    • A
      perf options: Introduce OPT_UINTEGER · c100edbe
      Arnaldo Carvalho de Melo 提交于
      For unsigned int options to be parsed, next patches will make use of it.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c100edbe
  18. 17 5月, 2010 1 次提交
    • A
      perf options: Introduce OPT_U64 · 6ba85cea
      Arnaldo Carvalho de Melo 提交于
      We have things like user_interval (-c/--count) in 'perf record' that
      needs this.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6ba85cea
  19. 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
  20. 25 9月, 2009 1 次提交
  21. 19 9月, 2009 1 次提交
  22. 03 7月, 2009 1 次提交
    • F
      perf_counter tools: Add new OPT_CALLBACK_DEFAULT option · 5a4b1817
      Frederic Weisbecker 提交于
      There is no predefined macro to create an option that can have
      a custom value or a default one if none is given.
      
      This patch provides a new helper OPT_CALLBACK_DEFAULT() which
      defines such kind of option.
      
      For example, considering an option -c, we want to get the
      default value in the following cases:
      
          perf command -c -d
          perf command -d -c
      
      And the foo value when it's given:
      
          perf command -c foo -d
          perf command -d -c foo
      
      That's also why PARSE_OPT_LASTARG_DEFAULT is extended here to
      support default values whatever the position of the option, not
      only in the end.
      
      Should it now be renamed to PARSE_OPT_ARG_DEFAULT ?
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: git@vger.kernel.org
      LKML-Reference: <1246550301-8954-2-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5a4b1817
  23. 01 7月, 2009 1 次提交
    • I
      perf_counter tools: Add more warnings and fix/annotate them · f37a291c
      Ingo Molnar 提交于
      Enable -Wextra. This found a few real bugs plus a number
      of signed/unsigned type mismatches/uncleanlinesses. It
      also required a few annotations
      
      All things considered it was still worth it so lets try with
      this enabled for now.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f37a291c
  24. 07 6月, 2009 1 次提交
  25. 03 6月, 2009 1 次提交
    • P
      perf record: Use long arg for counter period · e61078a0
      Peter Zijlstra 提交于
      I wrote this to test the extended period emulation, we might as
      well merge it.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: John Kacur <jkacur@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e61078a0
  26. 27 4月, 2009 1 次提交
  27. 20 4月, 2009 1 次提交