1. 28 2月, 2015 1 次提交
    • M
      perf buildid-cache: Add --purge FILE to remove all caches of FILE · 8d8c8e4c
      Masami Hiramatsu 提交于
      Add --purge FILE to remove all caches of FILE.
      
      Since the current --remove FILE removes a cache which has
      same build-id of given FILE. Since the command takes a
      FILE path, it can confuse user who tries to remove cache
      about FILE path.
      
        -----
        # ./perf buildid-cache -v --add ./perf
        Adding 133b7b5486d987a5ab5c3ebf4ea14941f45d4d4f ./perf: Ok
        # (update the ./perf binary)
        # ./perf buildid-cache -v --remove ./perf
        Removing 305bbd1be68f66eca7e2d78db294653031edfa79 ./perf: FAIL
        ./perf wasn't in the cache
        -----
      Actually, the --remove's FAIL is not shown, it just silently fails.
      
      So, this patch adds --purge FILE action for such usecase.
      
      perf buildid-cache --purge FILE removes all caches which has same FILE
      path.
      
      In other words, it removes all caches including old binaries.
      
        -----
        # ./perf buildid-cache -v --add ./perf
        Adding 133b7b5486d987a5ab5c3ebf4ea14941f45d4d4f ./perf: Ok
        # (update the ./perf binary)
        # ./perf buildid-cache -v --purge ./perf
        Removing 133b7b5486d987a5ab5c3ebf4ea14941f45d4d4f ./perf: Ok
        -----
      
      BTW, if you want to purge all the caches, remove ~/.debug/* .
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20150227045026.1999.64084.stgit@localhost.localdomain
      [ s/dirname/dir_name/g to fix build on fedora14, where dirname is a global ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8d8c8e4c
  2. 27 2月, 2015 1 次提交
    • M
      perf buildid-cache: Add new buildid cache if update target is not cached · a50d11a1
      Masami Hiramatsu 提交于
      Add new buildid cache if the update target file is not cached.
      
      This can happen when an old binary is replaced by new one after caching
      the old one. In this case, user sees his operation just failed.
      
      But it does not look straight, since user just pass the binary "path",
      not "build-id".
      
        ----
        # ./perf buildid-cache --add ./perf
        (update ./perf to new binary)
        # ./perf buildid-cache --update ./perf
        ./perf wasn't in the cache
        #
        ----
      
      This patch adds given new binary to cache if the new binary is
      not cached. So we'll not see the above error.
      
        ----
        # ./perf buildid-cache --add ./perf
        (update ./perf to new binary)
        # ./perf buildid-cache --update ./perf
        #
        ----
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20150226065440.23912.1494.stgit@localhost.localdomainSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a50d11a1
  3. 11 2月, 2015 1 次提交
  4. 22 1月, 2015 1 次提交
  5. 09 12月, 2014 2 次提交
  6. 16 8月, 2014 1 次提交
  7. 14 8月, 2014 2 次提交
  8. 17 7月, 2014 1 次提交
  9. 01 2月, 2014 1 次提交
  10. 22 10月, 2013 1 次提交
  11. 14 10月, 2013 1 次提交
    • A
      perf buildid-cache: Add ability to add kcore to the cache · fc1b691d
      Adrian Hunter 提交于
      kcore can be used to view the running kernel object code.  However,
      kcore changes as modules are loaded and unloaded, and when the kernel
      decides to modify its own code.  Consequently it is useful to create a
      copy of kcore at a particular time.  Unlike vmlinux, kcore is not unique
      for a given build-id.  And in addition, the kallsyms and modules files
      are also needed.  The tool therefore creates a directory:
      
      	~/.debug/[kernel.kcore]/<build-id>/<YYYYmmddHHMMSShh>
      
      which contains: kcore, kallsyms and modules.
      
      Note that the copied kcore contains only code sections.  See the
      kcore_copy() function for how that is determined.
      
      The tool will not make additional copies of kcore if there is already
      one with the same modules at the same addresses.
      
      Currently, perf tools will not look for kcore in the cache.  That is
      addressed in another patch.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/525BF849.5030405@intel.com
      [ renamed 'index' to 'idx' to avoid shadowing string.h symbol in f12,
        use at least one member initializer when initializing a struct to
        zeros, also to fix the build on f12 ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fc1b691d
  12. 15 2月, 2013 1 次提交
  13. 09 12月, 2012 1 次提交
  14. 29 10月, 2012 2 次提交
  15. 03 10月, 2012 1 次提交
  16. 11 9月, 2012 2 次提交
    • 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
    • J
      perf tools: Back [vdso] DSO with real data · 7dbf4dcf
      Jiri Olsa 提交于
      Storing data for VDSO shared object, because we need it for the post
      unwind processing.
      
      The VDSO shared object is same for all process on a running system, so
      it makes no difference when we store it inside the tracer - perf.
      
      When [vdso] map memory is hit, we retrieve [vdso] DSO image and store it
      into temporary file.
      
      During the build-id processing phase, the [vdso] DSO image is stored in
      build-id db, and build-id reference is made inside perf.data. The
      build-id vdso file object is called '[vdso]'. We don't use temporary
      file name which gets removed when record is finished.
      
      During report phase the vdso build-id object is treated as any other
      build-id DSO object.
      
      Adding following API for vdso object:
      
        bool is_vdso_map(const char *filename)
          - returns true if the filename matches vdso map name
      
        struct dso *vdso__dso_findnew(struct list_head *head)
          - find/create proper vdso DSO object
      
        vdso__exit(void)
          - removes temporary VDSO image if there's any
      
      This change makes backtrace dwarf post unwind possible from [vdso] maps.
      
      Following output is current report of [vdso] sample dwarf backtrace:
      
        # Overhead  Command      Shared Object                         Symbol
        # ........  .......  .................  .............................
        #
            99.52%       ex  [vdso]             [.] 0x00007fff3ace89af
                         |
                         --- 0x7fff3ace89af
      
      Following output is new report of [vdso] sample dwarf backtrace:
      
        # Overhead  Command      Shared Object                         Symbol
        # ........  .......  .................  .............................
        #
            99.52%       ex  [vdso]             [.] 0x00000000000009af
                         |
                         --- 0x7fff3ace89af
                             main
                             __libc_start_main
                             _start
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1347295819-23177-5-git-send-email-jolsa@redhat.com
      [ committer note: s/ALIGN/PERF_ALIGN/g to cope with the android build changes ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7dbf4dcf
  17. 05 6月, 2010 1 次提交
    • S
      perf buildid: add perfconfig option to specify buildid cache dir · 45de34bb
      Stephane Eranian 提交于
      This patch adds the ability to specify an alternate directory to store the
      buildid cache (buildids, copy of binaries). By default, it is hardcoded to
      $HOME/.debug. This directory contains immutable data. The layout of the
      directory is such that no conflicts in filenames are possible. A modification
      in a file, yields a different buildid and thus a different location in the
      subdir hierarchy.
      
      You may want to put the buildid cache elsewhere because of disk space
      limitation or simply to share the cache between users. It is also useful for
      remote collect vs. local analysis of profiles.
      
      This patch adds a new config option to the perfconfig file.  Under the tag
      'buildid', there is a dir option. For instance, if you have:
      
      $ cat /etc/perfconfig
      [buildid]
      dir = /var/cache/perf-buildid
      
      All buildids and binaries are be saved in the directory specified. The perf
      record, buildid-list, buildid-cache, report, annotate, and archive commands
      will it to pull information out.
      
      The option can be set in the system-wide perfconfig file or in the
      $HOME/.perfconfig file.
      
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <4c055fb7.df0ce30a.5f0d.ffffae52@mx.google.com>
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      45de34bb
  18. 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
  19. 21 1月, 2010 1 次提交
    • A
      perf buildid-cache: Add new command to manage build-id cache · ef12a141
      Arnaldo Carvalho de Melo 提交于
      For now it just has operations to examine a given file, find its
      build-id and add or remove it to/from the cache.
      
      Useful, for instance, when adding binaries sent together with a
      perf.data file, so that we can add them to the cache and have
      the tools find it when resolving symbols.
      
      It'll also manage the size of the cache like 'ccache' does.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1264008525-29025-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ef12a141