1. 04 8月, 2015 7 次提交
  2. 31 7月, 2015 17 次提交
  3. 30 7月, 2015 4 次提交
  4. 29 7月, 2015 7 次提交
    • 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: Make twatch.py use soft dummy event, freq=0 · 58b32c1b
      Arnaldo Carvalho de Melo 提交于
      To not sample, what we want are just the PERF_RECORD_ lifetime events
      for threads, using the default, PERF_TYPE_HARDWARE +
      PERF_COUNT_HW_CYCLES and freq=1 (the default), makes perf reenable
      irq_vectors:local_timer_entry, disabling nohz, not good for some use
      cases where all we want is to get notifications when threads comes and
      goes...
      
      Fix it by using PERF_TYPE_SOFTWARE (no counter rotation) and
      PERF_COUNT_SW_DUMMY (created by Adrian so that we could have access to
      those PERF_RECORD_ goodies).
      Reported-by: NLuiz Fernando Capitulino <lcapitulino@redhat.com>
      Suggested-by: NPeter Zijlstra <peterz@infradead.org>
      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: Jaroslav Skarvada <jskarvad@redhat.com>
      Cc: Jeremy Eder <jeder@redhat.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-kfsijirfrs6xfhkcdxeoen06@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      58b32c1b
    • 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
    • P
      perf tools: Fix test build error when bindir contains double slash · 0927beec
      Pawel Moll 提交于
      When building with a prefix ending with a slash, for example:
      
      	$ make prefix=/usr/local/
      
      one of the perf tests fail to compile due to BUILD_STR macro mishandling
      bindir_SQ string containing with two slashes:
      
      	-DBINDIR="BUILD_STR(/usr/local//bin)"
      
      with the following error:
      
      	  CC       tests/attr.o
      	tests/attr.c: In function ‘test__attr’:
      	tests/attr.c:168:50: error: expected ‘)’ before ‘;’ token
      	  snprintf(path_perf, PATH_MAX, "%s/perf", BINDIR);
                                                        ^
      	tests/attr.c:176:1: error: expected ‘;’ before ‘}’ token
      	 }
      	 ^
      	tests/attr.c:176:1: error: control reaches end of non-void function [-Werror=return-type]
      	 }
      	 ^
      	cc1: all warnings being treated as errors
      
      This patch works around the problem by "cleaning" the bindir string
      using make's abspath function.
      Signed-off-by: NPawel Moll <pawel.moll@arm.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1438092613-21014-1-git-send-email-pawel.moll@arm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0927beec
  5. 28 7月, 2015 1 次提交
  6. 27 7月, 2015 4 次提交
    • I
      Merge tag 'perf-core-for-mingo' of... · 4b0c53e9
      Ingo Molnar 提交于
      Merge tag 'perf-core-for-mingo' 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:
      
      New features:
      
        - Introduce PERF_RECORD_SWITCH(_CPU_WIDE) and use it in 'record' to
          ask for context switches, allowing non priviledged tasks to know
          when they are switched in and out, which wasn't possible with
          the other context switch tracepoint and software events, see the
          patch description for a comprehensive justification (Adrian Hunter)
      
        - Stop collecting /proc/kallsyms in perf.data files, saving about
          4.5MB on a typical x86-64 system, use the the symbol resolution
          routines used in all the other tools (report, top, etc) now that
          we can ask libtraceevent to use perf's symbol resolution code.
          (Arnaldo Carvalho de Melo)
      
      User visible fixes:
      
        - Expose perf's symbol resolver to libtraceevent, so that its plugins can
          resolve tracepoint fields to kernel functions, like the 'function' field
          in the "timer:hrtimer_start tracepoint" (Arnaldo Carvalho de Melo)
      
      Infrastructure changes:
      
        - Map propagation of thread and cpu maps improvements, prep work for
          'perf stat' new features (Jiri Olsa)
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      4b0c53e9
    • P
      perf: Fix running time accounting · 00a2916f
      Peter Zijlstra 提交于
      A recent fix to the shadow timestamp inadvertly broke the running time
      accounting.
      
      We must not update the running timestamp if we fail to schedule the
      event, the event will not have ran. This can (and did) result in
      negative total runtime because the stopped timestamp was before the
      running timestamp (we 'started' but never stopped the event -- because
      it never really started we didn't have to stop it either).
      Reported-and-Tested-by: NVince Weaver <vincent.weaver@maine.edu>
      Fixes: 72f669c0 ("perf: Update shadow timestamp before add event")
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: stable@vger.kernel.org # 4.1
      Cc: Shaohua Li <shli@fb.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      00a2916f
    • L
      Linux 4.2-rc4 · cbfe8fa6
      Linus Torvalds 提交于
      cbfe8fa6
    • L
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 2579d019
      Linus Torvalds 提交于
      Pull perf fix from Thomas Gleixner:
       "A single fix for the intel cqm perf facility to prevent IPIs from
        interrupt context"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/x86/intel/cqm: Return cached counter value from IRQ context
      2579d019