1. 15 9月, 2015 5 次提交
  2. 14 9月, 2015 13 次提交
  3. 04 9月, 2015 14 次提交
  4. 03 9月, 2015 7 次提交
    • A
      perf tools: Fix use of wrong event when processing exit events · 53ff6bc3
      Adrian Hunter 提交于
      In a couple of cases the 'comm' member of 'union event' has been used
      instead of the correct member ('fork') when processing exit events.
      
      In the cases where it has been used incorrectly, only the 'pid' and
      'tid' are affected.  The 'pid' value would be correct anyway because it
      is in the same position in 'comm' and 'fork' events, but the 'tid' would
      have been incorrectly assigned from 'ppid'.
      
      However, for exit events, the kernel puts the current task in the 'ppid'
      and 'ttid' which is the same as the exiting task.  That is 'ppid' ==
      'pid' and if the task is not multi-threaded, 'pid' == 'tid' i.e. the
      data goes wrong only when tracing multi-threaded programs.
      
      It is hard to find an example of how this would produce an error in
      practice.  There are 3 occurences of the fix:
      
      1. perf script is only affected if !sample_id_all which only happens on
        old kernels.
      
      2. intel_pt is only affected when decoding without timestamps
         and would probably still decode correctly - the exit event is
         only used to flush out data which anyway gets flushed at the
         end of the session
      
      3. intel_bts also uses the exit event to flush data which
         would probably not cause errors as it would get flushed at
         the end of the session instead
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/1439888825-27708-1-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      53ff6bc3
    • J
      perf tools: Move tracing_path stuff under same namespace · 65d4b265
      Jiri Olsa 提交于
      Renaming all functions touching tracing_path under same namespace. New
      interface is:
      
        char tracing_path[];
        - tracing mount path
      
        char tracing_events_path[];
        - tracing mount/events path
      
        void tracing_path_set(const char *mountpoint);
        - setting directly tracing_path(_events), used by --debugfs-dir option
      
        const char *tracing_path_mount(void);
        - initial setup of tracing_(events)_path, called from perf.c
          mounts debugfs/tracefs if needed and possible
      
        char *get_tracing_file(const char *name);
        void put_tracing_file(char *file);
        - get/put tracing file path
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Raphael Beamonte <raphael.beamonte@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Matt Fleming <matt@codeblueprint.co.uk>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1441180605-24737-4-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      65d4b265
    • J
      perf tools: Remove mountpoint arg from perf_debugfs_mount · f6a09af7
      Jiri Olsa 提交于
      It's not used by any caller. We either detect the mountpoint or use
      hardcoded one.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Raphael Beamonte <raphael.beamonte@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Matt Fleming <matt@codeblueprint.co.uk>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1441180605-24737-3-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f6a09af7
    • K
      perf tools: Store the cpu socket and core ids in the perf.data header · 2bb00d2f
      Kan Liang 提交于
      This patch stores the cpu socket_id and core_id in a perf.data header,
      and reads them into the perf_env struct when processing perf.data files.
      
      The changes modifies the CPU_TOPOLOGY section, making sure it is
      backward/forward compatible.
      
      The patch checks the section size before reading the core and socket ids.
      
      It never reads data crossing the section boundary.  An old perf binary
      without this patch can also correctly read the perf.data from a new perf
      with this patch.
      
      Because the new info is added at the end of the cpu_topology section, an
      old perf tool ignores the extra data.
      
      Examples:
      
      1. New perf with this patch read perf.data from an old perf without the
         patch:
      
        $ perf_new report -i perf_old.data --header-only -I
        ......
        # sibling threads : 33
        # sibling threads : 34
        # sibling threads : 35
        # Core ID and Socket ID information is not available
        # node0 meminfo  : total = 32823872 kB, free = 29315548 kB
        # node0 cpu list : 0-17,36-53
        ......
      
      2. Old perf without the patch reads perf.data from a new perf with the
         patch:
      
        $ perf_old report -i perf_new.data --header-only -I
        ......
        # sibling threads : 33
        # sibling threads : 34
        # sibling threads : 35
        # node0 meminfo  : total = 32823872 kB, free = 29190932 kB
        # node0 cpu list : 0-17,36-53
        ......
      
      3. New perf read new perf.data:
      
        $ perf_new report -i perf_new.data --header-only -I
        ......
        # sibling threads : 33
        # sibling threads : 34
        # sibling threads : 35
        # CPU 0: Core ID 0, Socket ID 0
        # CPU 1: Core ID 1, Socket ID 0
        ......
        # CPU 61: Core ID 10, Socket ID 1
        # CPU 62: Core ID 11, Socket ID 1
        # CPU 63: Core ID 16, Socket ID 1
        # node0 meminfo  : total = 32823872 kB, free = 29190932 kB
        # node0 cpu list : 0-17,36-53
      Signed-off-by: NKan Liang <kan.liang@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/1441115893-22006-2-git-send-email-kan.liang@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2bb00d2f
    • K
      perf cpumap: Factor out functions to get core_id and socket_id · 193b6bd3
      Kan Liang 提交于
      This patch moves the code which reads core_id and socket_id into
      separate functions.
      Signed-off-by: NKan Liang <kan.liang@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/1441115893-22006-1-git-send-email-kan.liang@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      193b6bd3
    • H
      tools lib traceevent: Support function __get_dynamic_array_len · 76055940
      He Kuang 提交于
      Support helper function __get_dynamic_array_len() in libtraceevent, this
      function is used accompany with __print_array() or __print_hex(), but
      currently it is not an available function in the function list of
      process_function().
      
      The total allocated length of the dynamic array is embedded in the top
      half of __data_loc_##item field. This patch adds new arg type
      PRINT_DYNAMIC_ARRAY_LEN to return the length to eval_num_arg(),
      Signed-off-by: NHe Kuang <hekuang@huawei.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Alexei Starovoitov <ast@plumgrid.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1440822125-52691-32-git-send-email-wangnan0@huawei.comSigned-off-by: NWang Nan <wangnan0@huawei.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      76055940
    • A
      perf tools: Always use non inlined file name for 'srcfile' sort key · 2f84b42b
      Andi Kleen 提交于
      When profiling the kernel with the 'srcfile' sort key it's common to
      "get stuck" in include. For example a lot of code uses current or other
      inlines, so they get accounted to some random include file. This is not
      very useful as a high level categorization.
      
      For example just profiling the idle loop usually shows mostly inlines,
      so you never see the actual cpuidle file.
      
      This patch changes the 'srcfile' sort key to always unwind the inline
      stack using BFD/DWARF. So we always account to the base function that
      called the inline.
      
      In a few cases include is still shown (for example for MSR accesses),
      but that is because they get inlining expanded as part of assigning to a
      global function pointer. For the majority it works fine though.
      
      v2: Use simpler while loop. Add maximum iteration count.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/1441133239-31254-1-git-send-email-andi@firstfloor.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2f84b42b
  5. 02 9月, 2015 1 次提交