1. 10 5月, 2016 15 次提交
  2. 07 5月, 2016 10 次提交
    • I
      Merge tag 'perf-core-for-mingo-20160506' of... · ea7c2851
      Ingo Molnar 提交于
      Merge tag 'perf-core-for-mingo-20160506' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      User visible changes:
      
      - Fix ordering of kernel/user entries in 'caller' mode, where the kernel and
        user parts were being correctly inverted but kept in place wrt each other,
        i.e. 'callee' (k1, k2, u3, u4) became 'caller' (k2, k1, u4, u3) when it
        should be 'caller' (u4, u3, k2, k1) (Chris Phlipot)
      
      - In 'perf trace' don't print the raw arg syscall args for a syscall that has
        no arguments, like gettid(). This was happening because just checking if
        the syscall args list is NULL may mean that there are no args (e.g.: gettid)
        or that there is no tracepoint info (e.g.: clone) (Arnaldo Carvalho de Melo)
      
      - Add extra output of counter values with 'perf stat -vv' (Andi Kleen)
      
      Infrastructure changes:
      
      - Expose callchain db export via the python API (Chris Phlipot)
      
      Code reorganization:
      
      - Move some more syscall arg beautifiers from the 'perf trace' main file to
        separate files in tools/perf/trace/beauty/, to reduce the main file line
        count (Arnaldo Carvalho de Melo)
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      ea7c2851
    • A
      perf trace: Move futex_op beautifier to tools/perf/trace/beauty/ · d5d71e86
      Arnaldo Carvalho de Melo 提交于
      To reduce the size of builtin-trace.c.
      
      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-vb8dpy7bptkf219q5c25ulfp@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d5d71e86
    • A
      perf trace: Move open_flags beautifier to tools/perf/trace/beauty/ · 8f48df69
      Arnaldo Carvalho de Melo 提交于
      To reduce the size of builtin-trace.c.
      
      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-jt293541hv9od7gqw6lilioh@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8f48df69
    • A
      perf trace: Move signum beautifier to tools/perf/trace/beauty/ · 12199d8e
      Arnaldo Carvalho de Melo 提交于
      To reduce the size of builtin-trace.c.
      
      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-qecqxwwtreio6eaatfv58yq5@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      12199d8e
    • A
      perf stat: Add extra output of counter values with -vv · 0b1abbf4
      Andi Kleen 提交于
      Add debug output of raw counter values per CPU when perf stat -v is
      specified, together with their cpu numbers.  This is very useful to
      debug problems with per core counters, where we can normally only see
      aggregated values.
      
      v2: Make it depend on -vv, not -v
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1461787251-6702-12-git-send-email-andi@firstfloor.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0b1abbf4
    • C
      perf script: Update export-to-postgresql to support callchain export · 3521f3bc
      Chris Phlipot 提交于
      Update the export-to-postgresql.py to support the newly introduced
      callchain export.
      
      callchains are added into the existing call_paths table and can now
      be associated with samples when the "callpaths" commandline option
      is used with the script.
      
      Ex.:
      
        $ perf script -s export-to-postgresql.py example_db all callchains
      
      Includes the following changes to enable callchain export via the python export
      APIs:
      
      - Add the "callchains" commandline option, which is used to enable
        callchain export by setting the perf_db_export_callchains global
      - Add perf_db_export_callchains checks for call_path table creation
        and population.
      - Add call_path_id to samples_table to conform with the new API
      
      example usage and output using a small test app:
      
        test_app.c:
      
      	volatile int x = 0;
      	void inc_x_loop()
      	{
      		int i;
      		for(i=0; i<100000000; i++)
      			x++;
      	}
      
      	void a()
      	{
      		inc_x_loop();
      	}
      
      	void b()
      	{
      		inc_x_loop();
      	}
      
      	int main()
      	{
      		a();
      		b();
      		return 0;
      	}
      
      example usage:
      
        $ gcc -g -O0 test_app.c
        $ perf record --call-graph=dwarf ./a.out
        [ perf record: Woken up 77 times to write data ]
        [ perf record: Captured and wrote 19.373 MB perf.data (2404 samples) ]
      
        $ perf script -s scripts/python/export-to-postgresql.py
      	example_db all callchains
      
        $ psql example_db
      
        example_db=#
        SELECT
        (SELECT name FROM symbols WHERE id = cps.symbol_id) as symbol,
        (SELECT name FROM symbols WHERE id =
      	(SELECT symbol_id from call_paths where id = cps.parent_id))
      	as parent_symbol,
        sum(period) as event_count
        FROM samples join call_paths as cps on call_path_id = cps.id
        GROUP BY cps.id,evsel_id
        ORDER BY event_count DESC
        LIMIT 5;
      
              symbol      |      parent_symbol       | event_count
        ------------------+--------------------------+-------------
         inc_x_loop       | a                        |   734250982
         inc_x_loop       | b                        |   731028057
         unknown          | unknown                  |     1335858
         task_tick_fair   | scheduler_tick           |     1238842
         update_wall_time | tick_do_update_jiffies64 |      650373
        (5 rows)
      
      The above data shows total "self time" in cycles for each call path that was
      sampled. It is intended to demonstrate how it accounts separately for the two
      ways to reach the "inc_x_loop" function(via "a" and "b").  Recursive common
      table expressions can be used as well to get cumulative time spent in a
      function as well, but that is beyond the scope of this basic example.
      Signed-off-by: NChris Phlipot <cphlipot0@gmail.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1461831551-12213-7-git-send-email-cphlipot0@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3521f3bc
    • C
      perf script: Expose usage of the callchain db export via the python api · 2c15f5eb
      Chris Phlipot 提交于
      This change allows python scripts to be able to utilize the recent
      changes to the db export api allowing the export of call_paths derived
      from sampled callchains. These call paths are also now associated with
      the samples from which they were derived.
      
      - This feature is enabled by setting "perf_db_export_callchains" to true
      
      - When enabled, samples that have callchain information will have the
        callchains exported via call_path_table
      
      - The call_path_id field is added to sample_table to enable association of
        samples with the corresponding callchain stored in the call paths
        table. A call_path_id of 0 will be exported if there is no
        corresponding callchain.
      
      - When "perf_db_export_callchains" and "perf_db_export_calls" are both
        set to True, the call path root data structure will be shared. This
        prevents duplicating of data and call path ids that would result from
        building two separate call path trees in memory.
      
      - The call_return_processor structure definition was relocated to the header
        file to make its contents visible to db-export.c. This enables the
        sharing of call path trees between the two features, as mentioned
        above.
      
      This change is visible to python scripts using the python db export api.
      
      The change is backwards compatible with scripts written against the
      previous API, assuming that the scripts model the sample_table function
      after the one in export-to-postgresql.py script by allowing for
      additional arguments to be added in the future. ie. using *x as the
      final argument of the sample_table function.
      Signed-off-by: NChris Phlipot <cphlipot0@gmail.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1461831551-12213-6-git-send-email-cphlipot0@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2c15f5eb
    • C
      perf script: Add call path id to exported sample in db export · 568850ea
      Chris Phlipot 提交于
      The exported sample now contains a reference to the call_path_id that
      represents its callchain.
      
      While callchains themselves are nice to have, being able to associate
      them with samples makes them much more useful, and can allow for such
      things as determining how much cumulative time is spent in a particular
      function. This information is normally possible to get from the call
      return processor. However, when doing normal sampling, call/return
      information is not available, thus necessitating the need for
      associating samples directly with call paths.
      
      This commit include changes to db-export layer to make this information
      available for subsequent patches in this change set, but by itself, does
      not make any changes visible to the user.
      Signed-off-by: NChris Phlipot <cphlipot0@gmail.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1461831551-12213-5-git-send-email-cphlipot0@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      568850ea
    • C
      perf script: Enable db export to output sampled callchains · 0a3eba3a
      Chris Phlipot 提交于
      This change enables the db export api to export callchains. This is
      accomplished by adding callchains obtained from samples to the
      call_path_root structure and exporting them via the current call path
      export API.
      
      While the current API does support exporting call paths, this is not
      supported when sampling. This commit addresses that missing feature by
      allowing the export of call paths when callchains are present in
      samples.
      
      Summary:
      
      - This feature is activated by initializing the call_path_root member
        inside the db_export structure to a non-null value.
      
      - Callchains are resolved with thread__resolve_callchain() and then stored
        and exported by adding a call path under call path root.
      - Symbol and DSO for each callchain node are exported via db_ids_from_al()
      
      This commit puts in place infrastructure to be used by subsequent commits,
      and by itself, does not introduce any user-visible changes.
      Signed-off-by: NChris Phlipot <cphlipot0@gmail.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1461831551-12213-4-git-send-email-cphlipot0@gmail.com
      [ Made adjustments suggested by Adrian Hunter, see thread via this cset's Link: tag ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0a3eba3a
    • C
      perf tools: Refactor code to move call path handling out of thread-stack · 451db126
      Chris Phlipot 提交于
      Move the call path handling code out of thread-stack.c and
      thread-stack.h to allow other components that are not part of
      thread-stack to create call paths.
      
      Summary:
      
      - Create call-path.c and call-path.h and add them to the build.
      
      - Move all call path related code out of thread-stack.c and thread-stack.h
        and into call-path.c and call-path.h.
      
      - A small subset of structures and functions are now visible through
        call-path.h, which is required for thread-stack.c to continue to
        compile.
      
      This change is a prerequisite for subsequent patches in this change set
      and by itself contains no user-visible changes.
      Signed-off-by: NChris Phlipot <cphlipot0@gmail.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1461831551-12213-3-git-send-email-cphlipot0@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      451db126
  3. 06 5月, 2016 15 次提交