1. 17 11月, 2010 1 次提交
  2. 01 6月, 2010 1 次提交
    • F
      perf: Use event__process_task from perf sched · af64865b
      Frederic Weisbecker 提交于
      perf sched uses event__process_comm(), which means it can resolve
      comms from:
      
      - tasks that have exec'ed (kernel comm events)
      - tasks that were running when perf record started the actual
        recording (synthetized comm events)
      
      But perf sched can't resolve the pids of tasks that were created
      after the recording started.
      
      To solve this, we need to inherit the comms on fork events using
      event__process_task().
      
      This fixes various unresolved pids in perf sched, easily visible
      with:
      	perf sched record perf bench sched messaging
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Stephane Eranian <eranian@google.com>
      af64865b
  3. 18 5月, 2010 2 次提交
    • A
      perf options: Type check all the remaining OPT_ variants · edb7c60e
      Arnaldo Carvalho de Melo 提交于
      OPT_SET_INT was renamed to OPT_SET_UINT since the only use in these
      tools is to set something that has an enum type, that is builtin
      compatible with unsigned int.
      
      Several string constifications were done to make OPT_STRING require a
      const char * type.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      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>
      edb7c60e
    • A
      perf options: Check v type in OPT_U?INTEGER · 1967936d
      Arnaldo Carvalho de Melo 提交于
      To avoid problems like the one fixed by Stephane Eranian in 3de29cab, now
      we'll got this instead:
      
      	bench/sched-messaging.c:259: error: negative width in bit-field ‘<anonymous>’
      	bench/sched-messaging.c:261: error: negative width in bit-field ‘<anonymous>’
      
      Which is rather cryptic, but is how BUILD_BUG_ON_ZERO works, so kernel
      hackers should be already used to this.
      
      With it in place found some problems, fixed by changing the affected
      variables to sensible types or changed some OPT_INTEGER to OPT_UINTEGER.
      
      Next csets will go thru converting each of the remaining OPT_ so that
      review can be made easier by grouping changes per type per patch.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      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>
      1967936d
  4. 15 5月, 2010 1 次提交
    • A
      perf hist: Clarify events_stats fields usage · cee75ac7
      Arnaldo Carvalho de Melo 提交于
      The events_stats.total field is too generic, rename it to .total_period,
      and also add a comment explaining that it is the sum of all the .period
      fields in samples, that is needed because we use auto-freq to avoid
      sampling artifacts.
      
      Ditto for events_stats.lost, that is the sum of all lost_event.lost
      fields, i.e. the number of events the kernel dropped.
      
      Looking at the users, builtin-sched.c can make use of these fields and
      stop doing it again.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cee75ac7
  5. 03 5月, 2010 1 次提交
    • T
      perf: add perf-inject builtin · 454c407e
      Tom Zanussi 提交于
      Currently, perf 'live mode' writes build-ids at the end of the
      session, which isn't actually useful for processing live mode events.
      
      What would be better would be to have the build-ids sent before any of
      the samples that reference them, which can be done by processing the
      event stream and retrieving the build-ids on the first hit.  Doing
      that in perf-record itself, however, is off-limits.
      
      This patch introduces perf-inject, which does the same job while
      leaving perf-record untouched.  Normal mode perf still records the
      build-ids at the end of the session as it should, but for live mode,
      perf-inject can be injected in between the record and report steps
      e.g.:
      
      perf record -o - ./hackbench 10 | perf inject -v -b | perf report -v -i -
      
      perf-inject reads a perf-record event stream and repipes it to stdout.
      At any point the processing code can inject other events into the
      event stream - in this case build-ids (-b option) are read and
      injected as needed into the event stream.
      
      Build-ids are just the first user of perf-inject - potentially
      anything that needs userspace processing to augment the trace stream
      with additional information could make use of this facility.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1272696080-16435-3-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      454c407e
  6. 24 4月, 2010 1 次提交
    • F
      perf: Use generic sample reordering in perf sched · a64eae70
      Frederic Weisbecker 提交于
      Use the new generic sample events reordering from perf sched,
      this drops the need of multiplexing the buffers on record time,
      improving the scalability of perf sched.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      a64eae70
  7. 14 4月, 2010 1 次提交
    • I
      perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() · c0555642
      Ian Munsie 提交于
      Parsing an option from the command line with OPT_BOOLEAN on a
      bool data type would not work on a big-endian machine due to the
      manner in which the boolean was being cast into an int and
      incremented. For example, running 'perf probe --list' on a
      PowerPC machine would fail to properly set the list_events bool
      and would therefore print out the usage information and
      terminate.
      
      This patch makes OPT_BOOLEAN work as expected with a bool
      datatype. For cases where the original OPT_BOOLEAN was
      intentionally being used to increment an int each time it was
      passed in on the command line, this patch introduces OPT_INCR
      with the old behaviour of OPT_BOOLEAN (the verbose variable is
      currently the only such example of this).
      
      I have reviewed every use of OPT_BOOLEAN to verify that a true
      C99 bool was passed. Where integers were used, I verified that
      they were only being used for boolean logic and changed them to
      bools to ensure that they would not be mistakenly used as ints.
      The major exception was the verbose variable which now uses
      OPT_INCR instead of OPT_BOOLEAN.
      Signed-off-by: NIan Munsie <imunsie@au.ibm.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Cc: <stable@kernel.org> # NOTE: wont apply to .3[34].x cleanly, please backport
      Cc: Git development list <git@vger.kernel.org>
      Cc: Ian Munsie <imunsie@au1.ibm.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Eric B Munson <ebmunson@us.ibm.com>
      Cc: Valdis.Kletnieks@vt.edu
      Cc: WANG Cong <amwang@redhat.com>
      Cc: Thiago Farina <tfransosi@gmail.com>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      Cc: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1271147857-11604-1-git-send-email-imunsie@au.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c0555642
  8. 08 4月, 2010 1 次提交
    • A
      perf tools: Reorganize some structs to save space · eed05fe7
      Arnaldo Carvalho de Melo 提交于
      Using 'pahole --packable' I found some structs that could be reorganized
      to eliminate alignment holes, in some cases getting them to be cacheline
      multiples.
      
      [acme@doppio linux-2.6-tip]$ codiff perf.old ~/bin/perf
      builtin-annotate.c:
        struct perf_session    |   -8
        struct perf_header     |   -8
       2 structs changed
      
      builtin-diff.c:
        struct sample_data         |   -8
       1 struct changed
        diff__process_sample_event |   -8
       1 function changed, 8 bytes removed, diff: -8
      
      builtin-sched.c:
        struct sched_atom      |   -8
       1 struct changed
      
      builtin-timechart.c:
        struct per_pid         |   -8
       1 struct changed
        cmd_timechart          |  -16
       1 function changed, 16 bytes removed, diff: -16
      
      builtin-probe.c:
        struct perf_probe_point |   -8
        struct perf_probe_event |   -8
       2 structs changed
        opt_add_probe_event     |   -3
       1 function changed, 3 bytes removed, diff: -3
      
      util/probe-finder.c:
        struct probe_finder      |   -8
       1 struct changed
        find_kprobe_trace_events |  -16
       1 function changed, 16 bytes removed, diff: -16
      
      /home/acme/bin/perf:
       4 functions changed, 43 bytes removed, diff: -43
      [acme@doppio linux-2.6-tip]$
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      eed05fe7
  9. 16 1月, 2010 1 次提交
  10. 28 12月, 2009 3 次提交
  11. 16 12月, 2009 1 次提交
  12. 15 12月, 2009 1 次提交
  13. 14 12月, 2009 7 次提交
  14. 12 12月, 2009 1 次提交
    • A
      perf tools: Introduce perf_session class · 94c744b6
      Arnaldo Carvalho de Melo 提交于
      That does all the initialization boilerplate, opening the file,
      reading the header, checking if it is valid, etc.
      
      And that will as well have the threads list, kmap (now) global
      variable, etc, so that we can handle two (or more) perf.data files
      describing sessions to compare.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260573842-19720-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      94c744b6
  15. 10 12月, 2009 1 次提交
  16. 09 12月, 2009 1 次提交
    • X
      perf sched: Fix for getting task's execution time · c0c9e721
      Xiao Guangrong 提交于
      In current code, task's execute time is got by reading
      '/proc/<pid>/sched' file, it's wrong if the task is created
      by pthread_create(), because every thread task has same pid.
      
      This way also has two demerits:
      
       1: 'perf sched replay' can't work if the kernel is not
          compiled with the 'CONFIG_SCHED_DEBUG' option
      
       2: perf tool should depend on proc file system
      
      So, this patch uses PERF_COUNT_SW_TASK_CLOCK to get task's
      execution time instead of reading /proc file.
      
      Changelog v2 -> v3:
      use PERF_COUNT_SW_TASK_CLOCK instead of rusage() as Ingo's
      suggestion
      Reported-by: NTorok Edwin <edwintorok@gmail.com>
      Signed-off-by: NXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Xiao Guangrong <ericxiao.gr@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <4B1F7322.80103@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c0c9e721
  17. 07 12月, 2009 4 次提交
    • X
      perf_event: Eliminate raw->size · f48f669d
      Xiao Guangrong 提交于
      raw->size is not used, this patch just cleans it up.
      Signed-off-by: NXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      LKML-Reference: <4B1C8CC4.4050007@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f48f669d
    • X
      perf_event: Fix raw event processing · d8bd9e0a
      Xiao Guangrong 提交于
      We use 'data.raw_data' parameter to call process_raw_event(),
      but data.raw_data buffer not include data size. it can make perf
      tool crash.
      
      This bug was introduced by commit 180f95e2 ("perf: Make common
      SAMPLE_EVENT parser").
      Signed-off-by: NXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Cc: Pekka Enberg <penberg@cs.helsinki.fi>
      Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      LKML-Reference: <4B1C7F45.5080105@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d8bd9e0a
    • X
      perf/sched: Fix 'perf sched trace' · c0777c5a
      Xiao Guangrong 提交于
      If we use 'perf sched trace', it will call symbol__init() again,
      and can lead to a perf tool crash:
      
       [root@localhost perf]# ./perf sched trace
       *** glibc detected *** ./perf: free(): invalid next size (normal): 0x094c1898 ***
       ======= Backtrace: =========
       /lib/libc.so.6[0xb7602404]
       /lib/libc.so.6(cfree+0x96)[0xb76043b6]
       ./perf[0x80730fe]
       ./perf[0x8074c97]
       ./perf[0x805eb59]
       ./perf[0x80536fd]
       ./perf[0x804b618]
       ./perf[0x804bdc3]
       /lib/libc.so.6(__libc_start_main+0xe5)[0xb75a9735]
       ./perf[0x804af81]
       ======= Memory map: ========
       08048000-08158000 r-xp 00000000 fe:00 556831     /home/eric/....
       08158000-08168000 rw-p 0010f000 fe:00 556831     /home/eric/...
       08168000-085fe000 rw-p 00000000 00:00 0
       094ab000-094cc000 rw-p 00000000 00:00 0          [heap]
      Signed-off-by: NXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      LKML-Reference: <4B1C7EE1.8030906@cn.fujitsu.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c0777c5a
    • O
      perf: Make common SAMPLE_EVENT parser · 180f95e2
      OGAWA Hirofumi 提交于
      Currently, sample event data is parsed for each commands, and it
      is assuming that the data is not including other data. (E.g.
      timechart, trace, etc. can't parse the event if it has
      PERF_SAMPLE_CALLCHAIN)
      
      So, even if we record the superset data for multiple commands at
      a time, commands can't parse. etc.
      
      To fix it, this makes common sample event parser, and use it to
      parse sample event correctly. (PERF_SAMPLE_READ is unsupported
      for now though, it seems to be not using.)
      Signed-off-by: NOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <87hbs48imv.fsf@devron.myhome.or.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      180f95e2
  18. 28 11月, 2009 1 次提交
    • A
      perf tools: Reorganize event processing routines, lotsa dups killed · 62daacb5
      Arnaldo Carvalho de Melo 提交于
      While implementing event__preprocess_sample, that will do all of
      the symbol lookup in one convenient function, I noticed that
      util/process_event.[ch] were not being used at all, then started
      looking if there were other functions that could be shared
      and...
      
      All those functions really don't need to receive offset + head,
      the only thing they did was common to all of them, so do it at
      one place instead.
      
      Stats about number of each type of event processed now is done
      in a central place.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1259346563-12568-11-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      62daacb5
  19. 24 11月, 2009 3 次提交
    • A
      perf tools: Introduce zalloc() for the common calloc(1, N) case · 36479484
      Arnaldo Carvalho de Melo 提交于
      This way we type less characters and it looks more like the
      kzalloc kernel counterpart.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1259071517-3242-3-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      36479484
    • A
      perf symbols: Simplify symbol machinery setup · b32d133a
      Arnaldo Carvalho de Melo 提交于
      And also express its configuration toggles via a struct.
      
      Now all one has to do is to call symbol__init(NULL) if the
      defaults are OK, or pass a struct symbol_conf pointer with the
      desired configuration.
      
      If a tool uses kernel_maps__find_symbol() to look at the kernel
      and modules mappings for a symbol but didn't call symbol__init()
      first, that will generate a one time warning too, alerting the
      subcommand developer that symbol__init() must be called.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1259071517-3242-2-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b32d133a
    • A
      perf symbols: Look for vmlinux in more places · cc612d81
      Arnaldo Carvalho de Melo 提交于
      Now that we can check the buildid to see if it really matches,
      this can be done safely:
      
        vmlinux
        /boot/vmlinux
        /boot/vmlinux-<uts.release>
        /lib/modules/<uts.release>/build/vmlinux
        /usr/lib/debug/lib/modules/%s/vmlinux
      
      More can be added - if you know about distros that put the
      vmlinux somewhere else please let us know.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1259001550-8194-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      cc612d81
  20. 02 11月, 2009 1 次提交
  21. 23 10月, 2009 1 次提交
    • A
      perf tools: Unify debug messages mechanisms · 6beba7ad
      Arnaldo Carvalho de Melo 提交于
      We were using eprintf in some places, that looks at a global
      'verbose' level, and at other places passing a 'v' parameter to
      specify the verbosity level, unify it by introducing
      pr_{err,warning,debug,etc}, just like in the kernel.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Mike Galbraith <efault@gmx.de>
      LKML-Reference: <1256153646-10097-1-git-send-email-acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6beba7ad
  22. 19 10月, 2009 1 次提交
  23. 17 10月, 2009 1 次提交
  24. 13 10月, 2009 1 次提交
  25. 12 10月, 2009 2 次提交
    • M
      perf sched: Add -C option to measure on a specific CPU · 55ffb7a6
      Mike Galbraith 提交于
      To refresh, trying to sched record only one CPU results in bogus
      latencies as below.
      
      I fixed^Wmade it stop doing the bad thing today, by
      following task migration events properly.
      
      Before:
      
        marge:/root/tmp # taskset -c 1 perf sched record -C 0 -- sleep 10
        marge:/root/tmp # perf sched lat
         -----------------------------------------------------------------------------------------
          Task                  |   Runtime ms  | Switches | Average delay ms | Maximum delay ms |
         -----------------------------------------------------------------------------------------
          Xorg:4943             |      1.290 ms |        1 | avg: 1670.132 ms | max: 1670.132 ms |
          hald-addon-stor:3569  |      0.091 ms |        3 | avg:  658.609 ms | max: 1975.797 ms |
          hald-addon-stor:3573  |      0.209 ms |        4 | avg:  499.138 ms | max: 1990.565 ms |
          audispd:4270          |      0.012 ms |        1 | avg:    0.015 ms | max:    0.015 ms |
        ....
      
        marge:/root/tmp # perf sched trace|grep 'Xorg:4943'
                 swapper-0     [000]   401.184013288: sched_stat_runtime: task: Xorg:4943 runtime: 1233188 [ns], vruntime: 19105169779 [ns]
         rt2870TimerQHan-4947  [000]   402.854140127: sched_stat_wait: task: Xorg:4943 wait: 580073 [ns]
         rt2870TimerQHan-4947  [000]   402.854141770: sched_migrate_task: task Xorg:4943 [140] from: 1  to: 0
         rt2870TimerQHan-4947  [000]   402.854143854: sched_stat_wait: task: Xorg:4943 wait: 0 [ns]
         rt2870TimerQHan-4947  [000]   402.854145397: sched_switch: task rt2870TimerQHan:4947 [140] (D) ==> Xorg:4943 [140]
                    Xorg-4943  [000]   402.854193133: sched_stat_runtime: task: Xorg:4943 runtime: 56546 [ns], vruntime: 11766332500 [ns]
                    Xorg-4943  [000]   402.854196842: sched_switch: task Xorg:4943 [140] (S) ==> swapper:0 [140]
      
      After:
      
        marge:/root/tmp # taskset -c 1 perf sched record -C 0 -- sleep 10
        marge:/root/tmp # perf sched lat
         -----------------------------------------------------------------------------------------
          Task                  |   Runtime ms  | Switches | Average delay ms | Maximum delay ms |
         -----------------------------------------------------------------------------------------
          amarokapp:11150       |    271.297 ms |      878 | avg:    0.130 ms | max:    1.057 ms |
          konsole:5965          |      1.370 ms |       12 | avg:    0.092 ms | max:    0.855 ms |
          Xorg:4943             |    179.980 ms |     1109 | avg:    0.087 ms | max:    1.206 ms |
          hald-addon-stor:3574  |      0.212 ms |        9 | avg:    0.040 ms | max:    0.169 ms |
          hald-addon-stor:3570  |      0.223 ms |        9 | avg:    0.037 ms | max:    0.223 ms |
          klauncher:5864        |      0.550 ms |        8 | avg:    0.032 ms | max:    0.048 ms |
      
      The 'Maximum delay ms' results are now sane.
      Signed-off-by: NMike Galbraith <efault@gmx.de>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      55ffb7a6
    • R
      perf tools: Fix const char type propagation · cbef79a8
      Randy Dunlap 提交于
      The following perf build warnings/errors in function
      argument types:
      
        builtin-sched.c:1894: warning: passing argument 1 of 'sort_dimension__add' discards qualifiers from pointer target type
        util/trace-event-parse.c:685: warning: passing argument 2 of 'read_expected' discards qualifiers from pointer target type
        util/trace-event-parse.c:741: warning: passing argument 4 of 'test_type_token' discards qualifiers from pointer target type
        util/trace-event-parse.c:706: warning: passing argument 2 of 'read_expected_item' discards qualifiers from pointer target type
      
      ... trigger because older GCC is not able to prove that
      sort_dimension__add() does not change the string.
      
      Some goes for test_type_token().
      
      Fix this by improving type consistency.
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Acked-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <20091005131729.78444bfb.randy.dunlap@oracle.com>
      [ Also remove ugly type cast now unnecessary. ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      cbef79a8