1. 05 8月, 2015 1 次提交
  2. 30 7月, 2015 2 次提交
  3. 29 7月, 2015 5 次提交
    • A
      perf session env: Rename exit method · 4c7de49a
      Arnaldo Carvalho de Melo 提交于
      The semantic associated in tools/perf/ with foo__delete(instance) is to
      release all resources referenced by 'instance' members and then release
      the memory for 'instance' itself.
      
      The perf_session_env__delete() function isn't doing this, it just does
      the first part, but the space used by 'instance' itself isn't freed, as
      it is embedded in a larger structure, that will be freed at other stage.
      
      For these cases we se foo__exit(), i.e. the usage is:
      
       void foo__delete(foo)
       {
               if (foo) {
                       foo__exit(foo);
                       free(foo);
               }
       }
      
      But when we have something like:
      
       struct bar {
               struct foo foo;
               . . .
       }
      
      Then we can't really call foo__delete(&bar.foo), we must have this
      instead:
      
       void bar__exit(bar)
       {
               foo__exit(&bar.foo);
               /* free other bar-> resources */
       }
      
       void bar__delete(bar)
       {
               if (bar) {
      		bar__exit(bar);
                      free(bar);
               }
       }
      
      So just rename perf_session_env__delete() to perf_session_env__exit().
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-djbgpcfo5udqptx3q0flwtmk@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4c7de49a
    • A
      perf symbols: Fix mismatched declarations for elf_getphdrnum · f785f235
      Arnaldo Carvalho de Melo 提交于
      When HAVE_ELF_GETPHDRNUM_SUPPORT is false we trip on this problem:
      
          CC       /tmp/build/perf/util/symbol-elf.o
        util/symbol-elf.c:41:12: error: static declaration of ‘elf_getphdrnum’ follows non-static declaration
         static int elf_getphdrnum(Elf *elf, size_t *dst)
                  ^
        In file included from util/symbol.h:19:0,
                         from util/symbol-elf.c:8:
        /usr/include/libelf.h:206:12: note: previous declaration of ‘elf_getphdrnum’ was here
         extern int elf_getphdrnum (Elf *__elf, size_t *__dst);
                  ^
          MKDIR    /tmp/build/perf/bench/
        /home/git/linux/tools/build/Makefile.build:68: recipe for target '/tmp/build/perf/util/symbol-elf.o' failed
        make[3]: *** [/tmp/build/perf/util/symbol-elf.o] Error 1
      
      Fix it.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-qcmekyfedmov4sxr0wahcikr@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f785f235
    • A
      perf python: Add missing PERF_RECORD_{MMAP2,AUX,etc} · 84576da2
      Arnaldo Carvalho de Melo 提交于
      Those were added to the kernel and tooling but we forgot to
      expose them via the python binding, fix it.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-sg1m6t2c58gchidfce4hmitg@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      84576da2
    • A
      perf python: Add macro to simplify maintainance of the constants array · 5865fe36
      Arnaldo Carvalho de Melo 提交于
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/n/tip-ffuchgsbr5mqu91xl9oggfss@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5865fe36
    • A
      perf python: Remove dependency on 'machine' methods · 959c2199
      Arnaldo Carvalho de Melo 提交于
      The python binding still doesn't provide symbol resolving facilities,
      but the recent addition of the trace_event__register_resolver() function
      made it add as a dependency the machine__resolve_kernel_addr() method,
      that in turn drags all the symbol resolving code.
      
      The problem:
      
        [root@zoo ~]# perf test -v python
        17: Try 'import perf' in python, checking link problems      :
        --- start ---
        test child forked, pid 6853
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
        ImportError: /tmp/build/perf/python/perf.so: undefined symbol: machine__resolve_kernel_addr
        test child finished with -1
        ---- end ----
        Try 'import perf' in python, checking link problems: FAILED!
        [root@zoo ~]#
      
      Fix it by requiring this function to receive the resolver as a
      parameter, just like pevent_register_function_resolver(), i.e. do
      not explicitely refer to an object file not included in
      tools/perf/util/python-ext-sources.
      
        [root@zoo ~]# perf test python
        17: Try 'import perf' in python, checking link problems      : Ok
        [root@zoo ~]#
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Fixes: c3168b0d ("perf symbols: Provide libtraceevent callback to resolve kernel symbols")
      Link: http://lkml.kernel.org/n/tip-vxlhh95v2em9zdbgj3jm7xi5@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      959c2199
  4. 28 7月, 2015 1 次提交
  5. 24 7月, 2015 5 次提交
  6. 23 7月, 2015 2 次提交
  7. 22 7月, 2015 4 次提交
  8. 21 7月, 2015 7 次提交
  9. 20 7月, 2015 1 次提交
  10. 16 7月, 2015 1 次提交
  11. 15 7月, 2015 1 次提交
  12. 13 7月, 2015 1 次提交
    • A
      perf symbols: Store if there is a filter in place · 0bc2f2f7
      Arnaldo Carvalho de Melo 提交于
      When setting yup the symbols library we setup several filter lists,
      for dsos, comms, symbols, etc, and there is code that, if there are
      filters, do certain operations, like recalculate the number of non
      filtered histogram entries in the top/report TUI.
      
      But they were considering just the "Zoom" filters, when they need to
      take into account as well the above mentioned filters (perf top --comms,
      --dsos, etc).
      
      So store in symbol_conf.has_filter true if any of those filters is in
      place.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-f5edfmhq69vfvs1kmikq1wep@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0bc2f2f7
  13. 10 7月, 2015 2 次提交
  14. 09 7月, 2015 1 次提交
    • A
      perf thread_map: Fix the sizeof() calculation for map entries · 08ae217b
      Arnaldo Carvalho de Melo 提交于
      When we started adding extra stuff per array entry, growing the size of
      those entries to more than sizeof(pid_t), we had to convert those sizeof
      operations to the more robust sizeof(map->map[0]) idiom, that is future
      proof, i.e. if/when we add more stuff to those entries, that expression
      will produce the new per-entry size.
      
      And besides that, we need to zero out those extra fields, that sometimes
      may not get filled, like when we couldn't care less about the comms,
      since we don't need those, but since we will try freeing it at
      thread_map__delete(), we better fix it.
      
      That is why a thread_map__realloc() was provided.
      
      But that method wasn't used in thread_map__new_by_uid(), fix it.
      Reported-by: NIngo Molnar <mingo@kernel.org>
      Fixes: 792402fd ("perf thrad_map: Add comm string into array")
      Fixes: 9d7e8c3a ("perf tools: Add thread_map__(alloc|realloc) helpers")
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-6a0swlm6m8lnu3wpjv284hkb@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      08ae217b
  15. 07 7月, 2015 1 次提交
  16. 06 7月, 2015 5 次提交
    • A
      perf record: Let user have timestamps with per-thread recording · 3abebc55
      Adrian Hunter 提交于
      If the option -T is used with option --per-thread, then time is still
      not sampled.  Fix that by using OPT_BOOLEAN_SET to distinguish when the
      user used the -T option as opposed to the default case when timestamps
      are enabled but only for per-cpu recording.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/1436183461-1918-1-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3abebc55
    • A
      perf evsel: Introduce append_filter() method · 64ec84f5
      Arnaldo Carvalho de Melo 提交于
      To allow building filters in evsel->filter, that will eventually be
      applied via perf_evsel__apply_filter().
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-sjfoes3pycx7nlpmgedca13v@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      64ec84f5
    • A
      perf evlist: Make perf_evlist__set_filter use perf_evsel__set_filter · 94ad89bc
      Arnaldo Carvalho de Melo 提交于
      Instead of calling perf_evsel__apply_filter straight away, so that
      we can, in the next patches, expand the filter with more conditions
      before actually calling the ioctl to pass the end result filter to
      the kernel.
      
      Now we need to call perf_evlist__apply_filters() after the filter
      is completely setup, i.e. do the ioctl calls.
      
      The perf_evlist__apply_filters() method was already in place, because
      that is the model for the other tools that receives filters in the
      command line: go on setting then in the evsel->filter and only at
      the end, after parsing the whole command line, apply them.
      
      We get, as a bonus, a more expressive message that states which
      event, if any, failed to have the filter applied to, with an
      error message stating what happened.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-f429pgz75ryz7tpe6v74etre@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      94ad89bc
    • A
      perf evsel: Introduce set_filter method · 12467ae4
      Arnaldo Carvalho de Melo 提交于
      Replaces existing filter string with the one provided.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-jst49z83li0yx3g18o54u51a@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      12467ae4
    • A
      perf evsel: Rename set_filter to apply_filter · f47805a2
      Arnaldo Carvalho de Melo 提交于
      We need to be able to go on constructing a complex filter in multiple
      stages, since we can only set one filter per event.
      
      For instance, we need to be able, in 'perf trace' to filter by the
      'common_pid' field all the time, if only for the tracer itself, to
      avoid a feedback loop, and, in addition, we may want to filter the
      raw_syscalls:sys_{enter,exit} events by its 'id' filter, when using
      'perf trace -e open,close' or 'perf trace -e !open,close', i.e. when
      we are interested in just a subset of syscalls or when we are not
      interested in it.
      
      So we will have:
      
         perf_evsel__set_filter(evsel, char *filter)
      
             Replaces whatever is in evsel->filter.
      
         perf_evsel__append_filter(evsel, const char *op, char *filter)
      
             Appends, using op ("&&" or "||") with what is in evsel->filter.
      
         perf_evsel__apply_filter(evsel, filter):
      
              That actually applies a filter, be it the one being
              constructed in evsel->filter, or any other, for tools
              with more specific ways to build the filter, issuing
              the appropriate ioctl for all the evsel fds.
      
      The same changes will be made to the evlist__{set,apply} variants to
      keep everything consistent.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-2s5z9xtpnc2lwio3cv5x0jek@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f47805a2