1. 13 9月, 2017 1 次提交
    • T
      perf config: Allow creating empty config set for config file autogeneration · 55421b4f
      Taeung Song 提交于
      When there isn't a config file (e.g. ~/.perfconfig) or it has nothing,
      the config set wasn't created.
      
      If the config set does not exist, a config file can't be autogenerated.
      
      So allow creating a empty config set in the above case,
      then we can support the config file autogeneration.
      
      Before:
      
        $ rm -f ~/.perfconfig
        $ perf config --user report.children=false
      
        $ cat ~/.perfconfig
        cat: /root/.perfconfig: No such file or directory
      
      But I think it should work even if there isn't a config file.
      
      After:
      
        $ rm -f ~/.perfconfig
        $ perf config --user report.children=false
      
        $ cat ~/.perfconfig
        # this file is auto-generated.
        [report]
            children = false
      
      NOTE:
      
      As a result, if perf_config_set__init() fails, it looks as if the config
      set isn't freed. But it isn't a problem.  Because the config set will be
      freed by perf_config_set__delete() at the end of cmd_config().
      Signed-off-by: NTaeung Song <treeze.taeung@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/1504754336-9824-1-git-send-email-treeze.taeung@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      55421b4f
  2. 21 7月, 2017 1 次提交
  3. 27 6月, 2017 3 次提交
  4. 25 4月, 2017 2 次提交
  5. 20 4月, 2017 2 次提交
  6. 31 3月, 2017 1 次提交
  7. 27 1月, 2017 2 次提交
    • A
      perf tools: Propagate perf_config() errors · ecc4c561
      Arnaldo Carvalho de Melo 提交于
      Previously these were being ignored, sometimes silently.
      
      Stop doing that, emitting debug messages and handling the errors.
      
      Testing it:
      
        $ cat ~/.perfconfig
        cat: /home/acme/.perfconfig: No such file or directory
        $ perf stat -e cycles usleep 1
      
         Performance counter stats for 'usleep 1':
      
                 938,996      cycles:u
      
             0.003813731 seconds time elapsed
      
        $ perf top --stdio
        Error:
        You may not have permission to collect system-wide stats.
      
        Consider tweaking /proc/sys/kernel/perf_event_paranoid,
        <SNIP>
        [ perf record: Captured and wrote 0.019 MB perf.data (7 samples) ]
        [acme@jouet linux]$ perf report --stdio
        # To display the perf.data header info, please use --header/--header-only options.
        # Overhead  Command  Shared Object      Symbol
        # ........  .......  .................  .........................
          71.77%  usleep   libc-2.24.so       [.] _dl_addr
          27.07%  usleep   ld-2.24.so         [.] _dl_next_ld_env_entry
           1.13%  usleep   [kernel.kallsyms]  [k] page_fault
        $
        $ touch ~/.perfconfig
        $ ls -la ~/.perfconfig
        -rw-rw-r--. 1 acme acme 0 Jan 27 12:14 /home/acme/.perfconfig
        $
        $ perf stat -e instructions usleep 1
      
         Performance counter stats for 'usleep 1':
      
                 244,610      instructions:u
      
             0.000805383 seconds time elapsed
      
        $
        [root@jouet ~]# chown acme.acme ~/.perfconfig
        [root@jouet ~]# perf stat -e cycles usleep 1
          Warning: File /root/.perfconfig not owned by current user or root, ignoring it.
      
         Performance counter stats for 'usleep 1':
      
                 937,615      cycles
      
             0.000836931 seconds time elapsed
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-j2rq96so6xdqlr8p8rd6a3jx@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ecc4c561
    • A
      perf config: Do not consider an error not to have any perfconfig file · afc45cf5
      Arnaldo Carvalho de Melo 提交于
      While propagating the errors from perf_config(), which were being
      completely ignored, everything stopped working for people without a
      ~/.perfconfig file, because the perf_config_set__init() was considering
      an error not to have a .perfconfig file, duh, fix it by checking the
      errno after the failed stat() call.
      
      It should also not return an error when it says it is ignoring the file,
      and also a empty file should not return an error either.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Taeung Song <treeze.taeung@gmail.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: 8beeb00f ("perf config: Use new perf_config_set__init() to initialize config set")
      Link: http://lkml.kernel.org/n/tip-ygpbab3apbs6l8wr97xedwks@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      afc45cf5
  8. 15 11月, 2016 2 次提交
  9. 24 6月, 2016 1 次提交
    • T
      perf config: Introduce new init() and exit() · 8a0a9c7e
      Taeung Song 提交于
      Many sub-commands use perf_config() but everytime perf_config() is
      called, perf_config() always read config files.  (i.e. user config
      '~/.perfconfig' and system config '$(sysconfdir)/perfconfig')
      
      But it is better to use the config set that already contains all config
      key-value pairs to avoid this repetitive work reading the config files
      in perf_config(). (the config set mean a static variable 'config_set')
      
      In other words, if new perf_config__init() is called, only first time
      'config_set' is initialized collecting all configs from the config
      files.  And then we could use new perf_config() like old perf_config().
      When a sub-command finished, free the config set by perf_config__exit()
      at run_builtin().
      
      If we do, 'config_set' can be reused wherever perf_config() is called
      and a feature of old perf_config() is the same as new perf_config() work
      without the repetitive work that read the config files.
      
      In summary, in order to use features about configuration,
      we can call the functions at perf.c and other source files as below.
      
          # initialize a config set
          perf_config__init()
      
          # configure actual variables from a config set
          perf_config()
      
          # eliminate allocated config set
          perf_config__exit()
      
          # destroy existing config set and initialize a new config set.
          perf_config__refresh()
      Signed-off-by: NTaeung Song <treeze.taeung@gmail.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1466691272-24117-3-git-send-email-treeze.taeung@gmail.com
      [ 'init' counterpart is 'exit', not 'finish' ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8a0a9c7e
  10. 22 6月, 2016 1 次提交
  11. 14 6月, 2016 1 次提交
  12. 07 6月, 2016 4 次提交
  13. 14 4月, 2016 1 次提交
  14. 06 4月, 2016 1 次提交
  15. 30 3月, 2016 2 次提交
  16. 12 2月, 2016 1 次提交
  17. 18 12月, 2015 1 次提交
  18. 07 8月, 2015 1 次提交
    • W
      perf tools: Introduce llvm config options · aa61fd05
      Wang Nan 提交于
      This patch introduces [llvm] config section with 5 options. Following
      patches will use then to config llvm dynamica compiling.
      
      'llvm-utils.[ch]' is introduced in this patch for holding all
      llvm/clang related stuffs.
      
      Example:
      
        [llvm]
              # Path to clang. If omit, search it from $PATH.
      	clang-path = "/path/to/clang"
      
              # Cmdline template. Following line shows its default value.
              # Environment variable is used to passing options.
              #
              # *NOTE*: -D__KERNEL__ MUST appears before $CLANG_OPTIONS,
              # so user have a chance to use -U__KERNEL__ in $CLANG_OPTIONS
              # to cancel it.
      	clang-bpf-cmd-template = "$CLANG_EXEC -D__KERNEL__ $CLANG_OPTIONS \
      				  $KERNEL_INC_OPTIONS -Wno-unused-value \
      				  -Wno-pointer-sign -working-directory \
      				  $WORKING_DIR  -c $CLANG_SOURCE -target \
      				  bpf -O2 -o -"
      
              # Options passed to clang, will be passed to cmdline by
              # $CLANG_OPTIONS.
      	clang-opt = "-Wno-unused-value -Wno-pointer-sign"
      
              # kbuild directory. If not set, use /lib/modules/`uname -r`/build.
              # If set to "" deliberately, skip kernel header auto-detector.
      	kbuild-dir = "/path/to/kernel/build"
      
              # Options passed to 'make' when detecting kernel header options.
      	kbuild-opts = "ARCH=x86_64"
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Acked-by: NAlexei Starovoitov <ast@plumgrid.com>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kaixu Xia <xiakaixu@huawei.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1437477214-149684-1-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      aa61fd05
  19. 09 12月, 2014 2 次提交
  20. 26 9月, 2014 2 次提交
  21. 12 8月, 2014 1 次提交
  22. 08 7月, 2014 1 次提交
  23. 16 4月, 2014 1 次提交
  24. 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
  25. 30 5月, 2012 1 次提交
  26. 20 12月, 2011 1 次提交
  27. 28 9月, 2011 1 次提交
    • P
      doc: fix broken references · 395cf969
      Paul Bolle 提交于
      There are numerous broken references to Documentation files (in other
      Documentation files, in comments, etc.). These broken references are
      caused by typo's in the references, and by renames or removals of the
      Documentation files. Some broken references are simply odd.
      
      Fix these broken references, sometimes by dropping the irrelevant text
      they were part of.
      Signed-off-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      395cf969
  28. 09 8月, 2011 1 次提交