1. 11 12月, 2015 1 次提交
  2. 20 7月, 2015 1 次提交
  3. 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
  4. 26 6月, 2015 4 次提交
  5. 24 6月, 2015 1 次提交
  6. 16 6月, 2015 1 次提交
  7. 15 10月, 2014 1 次提交
  8. 28 12月, 2013 2 次提交
  9. 25 5月, 2012 1 次提交
  10. 22 2月, 2012 1 次提交
    • S
      perf tools: fix broken perf record -a mode · 6b1bee90
      Stephane Eranian 提交于
      The following commit:
      b52956c9 perf tools: Allow multiple threads or processes in record, stat, top
      
      introduced a bug in the thread_map code which caused perf record -a to
      not setup system-wide monitoring properly.
      
      $ taskset -c 1 noploop 1000 &
      $ perf record -a -C 1 sleep 10
      $ perf report -D | tail -20
      cycles stats:
                 TOTAL events:       4413
                  MMAP events:       4025
                  COMM events:        340
                SAMPLE events:         48
      
      Here I was expecting about 10,000 samples and not 48.
      
      In system-wide mode, the PID passed to perf_event_open() must be -1 and
      it was 0. That caused the kernel to setup a per-process event on PID:0.
      Consequently, the number of samples captured does not correspond to the
      requested measurement.
      
      The following one-liner fixes the problem for me with or without -C.
      
      I would also suggest to change the malloc() to something that matches
      the struct definition. thread_map->map[] is declared as int map[] and
      not pid_t map[]. If map[] can only contain pids, then change the struct
      definition.
      Acked-by: NDavid Ahern <dsahern@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20120221145424.GA6757@quadSigned-off-by: NStephane Eranian <eranian@google.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6b1bee90
  11. 14 2月, 2012 1 次提交
  12. 25 1月, 2012 2 次提交
  13. 24 1月, 2011 1 次提交
    • A
      perf threads: Move thread_map to separate file · fd78260b
      Arnaldo Carvalho de Melo 提交于
      To untangle it from struct thread handling, that is tied to symbols, etc.
      
      Right now in the python bindings I'm working on I need just a subset of
      the util/ files, untangling it allows me to do that.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      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: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fd78260b