Skip to content
  1. Oct 03, 2012
    • Arnaldo Carvalho de Melo's avatar
      perf inject: Remove unused 'input_name' static var · 5852a445
      Arnaldo Carvalho de Melo authored
      
      
      If we ever want to allow inject to work with something other than stdin,
      we can put it back, but so far it is completely unused, so ditch it.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-qmwpnktckhd43eynnkxgqfpm@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5852a445
    • Arnaldo Carvalho de Melo's avatar
      perf trace: Use evsel->handler.func · ba3d7dee
      Arnaldo Carvalho de Melo authored
      
      
      I.e. we don't need to resolve the evsel via the id and then check if it
      is this or that event, just stash the right handler at evsel creation
      time, then use evsel->handler.func() straight away.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-bpz3axzr4f2cjppf4egm28wf@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ba3d7dee
    • Namhyung Kim's avatar
      perf tools: Convert to HAVE_STRLCPY · d6e66832
      Namhyung Kim authored
      
      
      For similar reason of previous patches, convert NO_STRLCPY to positive
      HAVE_STRLCPY.
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1348824728-14025-13-git-send-email-namhyung@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d6e66832
    • Namhyung Kim's avatar
      perf tools: Convert to GTK2_SUPPORT · f9f526ec
      Namhyung Kim authored
      
      
      For building perf without gtk+2, we can set NO_GTK2=1 as a argument of
      make.  It then defines NO_GTK2_SUPPORT macro for C code to do the
      proper handling.  However it usually used in a negative semantics -
      e.g. #ifndef - so we saw double negations which can be misleading.
      Convert it to a positive form to make it more readable.
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1348824728-14025-8-git-send-email-namhyung@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f9f526ec
    • Namhyung Kim's avatar
      perf tools: Convert to NEWT_SUPPORT · 1254b51e
      Namhyung Kim authored
      
      
      For building perf without libnewt, we can set NO_NEWT=1 as a argument of
      make.  It then defines NO_NEWT_SUPPORT macro for C code to do the proper
      handling.  However it usually used in a negative semantics - e.g.  #ifndef -
      so we saw double negations which can be misleading.  Convert it to a
      positive form to make it more readable.
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1348824728-14025-7-git-send-email-namhyung@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1254b51e
    • Namhyung Kim's avatar
      perf tools: Convert to LIBAUDIT_SUPPORT · f315e168
      Namhyung Kim authored
      
      
      For building perf without libaudit, we can set NO_LIBAUDIT=1 as a
      argument of make.  It then defines NO_LIBAUDIT_SUPPORT macro for C code
      to do the proper handling.  However it usually used in a negative
      semantics - e.g. #ifndef - so we saw double negations which can be
      misleading.  Convert it to a positive form to make it more readable.
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1348824728-14025-6-git-send-email-namhyung@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f315e168
    • Namhyung Kim's avatar
      perf tools: Convert to LIBUNWIND_SUPPORT · 95485b1c
      Namhyung Kim authored
      
      
      For building perf without libunwind, we can set NO_LIBUNWIND=1 as a
      argument of make.  It then defines NO_LIBUNWIND_SUPPORT macro for C code
      to do the proper handling.  However it usually used in a negative
      semantics - e.g. #ifndef - so we saw double negations which can be
      misleading.  Convert it to a positive form to make it more readable.
      
      Also change NO_PERF_REGS macro to HAVE_PERF_REGS for the same reason.
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1348824728-14025-5-git-send-email-namhyung@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      95485b1c
  2. Sep 29, 2012
  3. Sep 28, 2012
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 1d787d37
      Ingo Molnar authored
      
      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:
      
       * Improve listing of accessible enum perf probe variables, from Hyeoncheol Lee.
      
       * Don't stop the build if the audit libraries are not installed, fix from Namhyung Kim.
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      1d787d37
    • Arnaldo Carvalho de Melo's avatar
      perf trace: Add aliases for some syscalls · aec1930b
      Arnaldo Carvalho de Melo authored
      
      
      What we get from audit_syscall_to_name isn't what we find in the
      syscalls: tracepoint events, so add the alias that allows the tool to
      find prctl, fstat, fstatat and stat.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-3m9su7jhwnxvepnr3ne1du5k@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      aec1930b
  4. Sep 27, 2012
    • Hyeoncheol Lee's avatar
      perf probe: Print an enum type variable in "enum variable-name" format when... · bb2d17a0
      Hyeoncheol Lee authored
      
      perf probe: Print an enum type variable in "enum variable-name" format when showing accessible variables
      
      When showing accessible variables, an enum type variable was printed in
      "variable-name" format. Change this format into "enum variable-name".
      
      Signed-off-by: default avatarHyeoncheol Lee <hyc.lee@gmail.com>
      Acked-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Link: http://lkml.kernel.org/r/1348713399-4541-1-git-send-email-hyc.lee@gmail.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      bb2d17a0
    • Namhyung Kim's avatar
      perf tools: Check libaudit availability for perf-trace builtin · 4d29089c
      Namhyung Kim authored
      
      
      The newly added trace command requires an external audit library.
      
      However it can cause a build error because it's not checked whether the
      libaudit is installed on system:
      
          CC builtin-trace.o
        builtin-trace.c:7:22: fatal error: libaudit.h: No such file or directory
        compilation terminated.
        make: *** [builtin-trace.o] Error 1
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1348745018-21744-1-git-send-email-namhyung@kernel.org
      [ committer note: Added ", disables 'trace tool' to the feature warning msg ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4d29089c
    • Namhyung Kim's avatar
      perf hists: Add missing period_* fields when collapsing a hist entry · 9ec60972
      Namhyung Kim authored
      
      
      So that the perf report won't lost the cpu utilization information.
      
      For example, if there're two process that have same name.
      
        $ perf report --stdio --showcpuutilization -s pid
        [SNIP]
        #   Overhead       sys        us  Command:  Pid
        #   ........  ........  ........  .............
        #
              55.12%     0.01%    55.10%  noploop:28781
              44.88%     0.06%    44.83%  noploop:28782
      
      Before:
        $ perf report --stdio --showcpuutilization -s comm
        [SNIP]
        #   Overhead       sys        us
        #   ........  ........  ........
        #
             100.00%     0.06%    44.83%
      
      After:
        $ perf report --stdio --showcpuutilization -s comm
        [SNIP]
        #   Overhead       sys        us
        #   ........  ........  ........
        #
             100.00%     0.07%    99.93%
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1348645663-25303-2-git-send-email-namhyung@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9ec60972
    • Arnaldo Carvalho de Melo's avatar
      perf trace: New tool · 514f1c67
      Arnaldo Carvalho de Melo authored
      
      
      Initially should look loosely like the venerable 'strace' tool, but
      using the infrastructure in the perf tools to allow tracing extra
      targets:
      
        [acme@sandy linux]$ perf trace --hell
        Error: unknown option `hell'
      
         usage: perf trace <PID>
      
            -p, --pid <pid>       trace events on existing process id
                --tid <tid>       trace events on existing thread id
                --all-cpus        system-wide collection from all CPUs
                --cpu <cpu>       list of cpus to monitor
                --no-inherit      child tasks do not inherit counters
                --mmap-pages <n>  number of mmap data pages
                --uid <user>      user to profile
      
        [acme@sandy linux]$
      
      Those should have the same semantics as when using with 'perf record'.
      
      It gets stuck sometimes, but hey, it works sometimes too!
      
      In time it should support perf.data based workloads, i.e. it should have
      a:
      	-o filename
      
      Command line option that will produce a perf.data file that can then be
      used with 'perf trace' or any of the other perf tools (script, report,
      etc).
      
      It will also eventually have the set of functionalities described in the
      previous 'trace' prototype by Thomas Gleixner:
      
         "Announcing a new utility: 'trace'"
         http://lwn.net/Articles/415728/
      
      Also planned is to have some of the features suggested in the comments
      of that LWN article.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/n/tip-v9x3q9rv4caxtox7wtjpchq5@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      514f1c67
    • Arnaldo Carvalho de Melo's avatar
      perf evsel: Export the event_format constructor · 201b7334
      Arnaldo Carvalho de Melo authored
      
      
      It'll be needed in the next patches, where it'll be not associated
      directly to an evsel.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-v9x3q9rv4caxtox7wtjpchq5@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      201b7334
    • Arnaldo Carvalho de Melo's avatar
      perf evsel: Introduce rawptr() method · 5d2074ea
      Arnaldo Carvalho de Melo authored
      
      
      Will be used for things like the args field in the raw_syscalls:sys_enter
      tracepoint.
      
      Implement strval with it, its basicaly strval returning void *.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-v9x3q9rv4caxtox7wtjpchq5@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5d2074ea
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Use perf_evsel__newtp in the event parser · 82fe1c29
      Arnaldo Carvalho de Melo authored
      
      
      Elliminating code duplication.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-9v4zl7ldlp8v6azrpsu5lupk@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      82fe1c29
    • Arnaldo Carvalho de Melo's avatar
      perf evsel: The tracepoint constructor should store sys:name · e48ffe2b
      Arnaldo Carvalho de Melo authored
      
      
      Not event_format->name, that doesn't contains the sys: part.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-v9x3q9rv4caxtox7wtjpchq5@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e48ffe2b
    • Arnaldo Carvalho de Melo's avatar
      perf evlist: Introduce set_filter() method · 745cefc5
      Arnaldo Carvalho de Melo authored
      
      
      To apply a filter to all the evsels in an evlist.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-v9x3q9rv4caxtox7wtjpchq5@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      745cefc5
    • Arnaldo Carvalho de Melo's avatar
      perf evlist: Renane set_filters method to apply_filters · 1491a632
      Arnaldo Carvalho de Melo authored
      
      
      Because that is what it really does, i.e. it applies the filters that
      were parsed from the command line and stashed into the evsels they refer
      to.
      
      We'll need the set_filter method name to actually apply a filter to all
      the evsels in an evlist, for instance, to ask that a syswide tracer
      doesn't trace itself.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-v9x3q9rv4caxtox7wtjpchq5@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1491a632
    • Arnaldo Carvalho de Melo's avatar
      perf test: Add test to check we correctly parse and match syscall open parms · eb2f2703
      Arnaldo Carvalho de Melo authored
      
      
      It will set up a syscall open tracepoint event, generate an open with
      invalid flags, then check those flags were the ones reported in the
      tracepoint fired.
      
      For the filename we need vfs:getname, but that will go thru some more
      iterations as the vfs getname codebase is going thru changes lately.
      
      When that is in I'll just check that the perf_evsel__newtp constructor
      is not bailing out and then add it to the evlist, catch the event and
      check the filename against the one used in the 'open' call used to
      trigger the event.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jeff Layton <jlayton@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-p5w9aq0jcbb91ghzqomowm16@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      eb2f2703
    • Arnaldo Carvalho de Melo's avatar
      perf evsel: Handle endianity in intval method · e6b6f679
      Arnaldo Carvalho de Melo authored
      
      
      We were relying on the info in pevent, but since we have it in
      perf_evsel, set up by the perf_session routine if read from a perf.data
      file or by whoever creates the evsels, use it.
      
      New 'perf test' entries will use it to parse locally generated events,
      in a non perf.data centered workflow.
      
      As well as use byteswap.h to get per arch optimized swap routines, like
      other parts of perf (header, perf_evsel__parse_sample, symbol, etc)
      already do.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-8tjuxk09mlsfmh7macgkxsip@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e6b6f679
  5. Sep 26, 2012
    • Arnaldo Carvalho de Melo's avatar
      perf evsel: Know if byte swap is needed · 0807d2d8
      Arnaldo Carvalho de Melo authored
      
      
      Instead of passing it around for parsing as an explicit parameter, will
      help with reading tracepoint fields when not using a perf session or
      pevent structure, i.e. for non perf.data centered workflows.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-qa67ikv2sm49cwa7dyjhhp6g@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0807d2d8
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Allow handling a NULL cpu_map as meaning "all cpus" · a14bb7a6
      Arnaldo Carvalho de Melo authored
      
      
      Or one with cpu_map->map[0] == -1.
      
      Reducing the boilerplate in setting up an evlist by nor requiring a
      cpu_map to be created at all.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-rnaqn3dtnsfo1wlbbf3fhx00@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a14bb7a6
    • Arnaldo Carvalho de Melo's avatar
      perf evsel: Improve tracepoint constructor setup · 0b80f8b3
      Arnaldo Carvalho de Melo authored
      
      
      It needs to properly set the sample_type, sample_period and the KVM
      related perf_event_attr fields.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-v9x3q9rv4caxtox7wtjpchq5@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0b80f8b3
    • Ingo Molnar's avatar
      Merge branch 'tip/perf/core' of... · ac2ba2b3
      Ingo Molnar authored
      
      Merge branch 'tip/perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace into perf/core
      
      Pull tracing updates from Steve Rostedt.
      
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      ac2ba2b3
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · a91f408e
      Ingo Molnar authored
      
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core fixes from Arnaldo Carvalho de Melo:
      
       * The new perf_evsel__tp_sched_test 'perf test' broke the build by setting the
         'ret' variable but not using it, caught by newer gcc
         -Werror=unused-but-set-variable, fix from Namhyung Kim.
      
       * pevent_parse_event should return a proper PEVENT_ERRNO__ and call
         pevent_free_format on its failure path, fixes from Namhyung Kim.
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      a91f408e
  6. Sep 25, 2012
    • Namhyung Kim's avatar
      tools lib traceevent: Fix error path on pevent_parse_event · f1b2256d
      Namhyung Kim authored
      
      
      If __pevent_parse_format() succeeded but add_event() failed, 'ret' didn't
      have a proper error code.  Set it to PEVENT_ERRNO__MEM_ALLOC_FAILED.
      
      In addition, at that point 'event' also has fields and format
      information and they all need to be freed.  Call pevent_free_format() to
      handle it.
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1348575919-4954-1-git-send-email-namhyung@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f1b2256d
    • Namhyung Kim's avatar
      perf test: Fix build failure · af9da88f
      Namhyung Kim authored
      The commit 6a6cd11d
      
       ("perf test: Add test for the sched tracepoint
      format fields") added following build error:
      
          CC builtin-test.o
        builtin-test.c: In function ‘perf_evsel__test_field’:
        builtin-test.c:1216:6: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable]
        builtin-test.c: In function ‘perf_evsel__tp_sched_test’:
        builtin-test.c:1242:6: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable]
        cc1: all warnings being treated as errors
        make: *** [builtin-test.o] Error 1
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1348539628-3821-1-git-send-email-namhyung@kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      af9da88f
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · f74eb728
      Ingo Molnar authored
      
      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:
      
       * Convert the trace builtins to use the growing evsel/evlist
         tracepoint infrastructure, removing several open coded constructs
         like switch like series of strcmp to dispatch events, etc.
         Basically what had already been showcased in 'perf sched'.
      
       * Add evsel constructor for tracepoints, that uses libtraceevent
         just to parse the /format events file, use it in a new 'perf test'
         to make sure the libtraceevent format parsing regressions can
         be more readily caught.
      
       * Some strange errors were happening in some builds, but not on the
         next, reported by several people, problem was some parser related
         files, generated during the build, didn't had proper make deps,
         fix from Eric Sandeen.
      
       * Fix some compiling errors on 32-bit, from Feng Tang.
      
       * Don't use sscanf extension %as, not available on bionic, reimplementation
         by Irina Tirdea.
      
       * Fix bfd.h/libbfd detection with recent binutils, from Markus Trippelsdorf.
      
       * Introduce struct and cache information about the environment where a
         perf.data file was captured, from Namhyung Kim.
      
       * Fix several error paths in libtraceevent, from Namhyung Kim.
      
         Print event causing perf_event_open() to fail in 'perf record',
         from Stephane Eranian.
      
       * New 'kvm' analysis tool, from Xiao Guangrong.
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f74eb728
    • Ezequiel Garcia's avatar
      trace: Move trace event enable from fs_initcall to core_initcall · 8781915a
      Ezequiel Garcia authored
      
      
      This patch splits trace event initialization in two stages:
       * ftrace enable
       * sysfs event entry creation
      
      This allows to capture trace events from an earlier point
      by using 'trace_event' kernel parameter and is important
      to trace boot-up allocations.
      
      Note that, in order to enable events at core_initcall,
      it's necessary to move init_ftrace_syscalls() from
      core_initcall to early_initcall.
      
      Link: http://lkml.kernel.org/r/1347461277-25302-1-git-send-email-elezegarcia@gmail.com
      
      Signed-off-by: default avatarEzequiel Garcia <elezegarcia@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      8781915a
    • Mandeep Singh Baines's avatar
      tracing: Add an option for disabling markers · 5224c3a3
      Mandeep Singh Baines authored
      
      
      In our application, we have trace markers spread through user-space.
      We have markers in GL, X, etc. These are super handy for Chrome's
      about:tracing feature (Chrome + system + kernel trace view), but
      can be very distracting when you're trying to debug a kernel issue.
      
      I normally, use "grep -v tracing_mark_write" but it would be nice
      if I could just temporarily disable markers all together.
      
      Link: http://lkml.kernel.org/r/1347066739-26285-1-git-send-email-msb@chromium.org
      
      CC: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarMandeep Singh Baines <msb@chromium.org>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      5224c3a3
  7. Sep 24, 2012
    • Namhyung Kim's avatar
      tools lib traceevent: Handle alloc_arg failure · b1ac754b
      Namhyung Kim authored
      
      
      Now alloc_arg returns NULL if memory allocation failed, it should be
      handled on callsites properly.
      
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/87k3vpzbqo.fsf_-_@sejong.aot.lge.com
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b1ac754b
    • Arnaldo Carvalho de Melo's avatar
      perf test: Add test for the sched tracepoint format fields · 6a6cd11d
      Arnaldo Carvalho de Melo authored
      
      
      So that we make sure the routines that do event format parsing are
      working on at least two well know scheduler tracepoints.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-g3rm9b3wtim4djx3z8dkftrj@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6a6cd11d
    • Arnaldo Carvalho de Melo's avatar
      perf evsel: Provide a new constructor for tracepoints · efd2b924
      Arnaldo Carvalho de Melo authored
      
      
      The existing constructor receives a perf_event_attr filled with the
      event type and the config.
      
      To reduce the boilerplate for tracepoints, provide a new constructor,
      perf_evsel__newtp() that receives the tracepoint name and will open
      the debugfs file, call into libtraceevent new pevent_parse_format file
      to fill its ->tp_format member, so that users can then just call
      perf_evsel__field() to access its fields.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/n/tip-6du8dl1hz0y5l4cybodye7hn@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      efd2b924
    • Arnaldo Carvalho de Melo's avatar
      tools lib traceevent: Carve out events format parsing routine · 2b29175d
      Arnaldo Carvalho de Melo authored
      
      
      The pevent_parse_event() routine will parse a events/sys/tp/format file
      and add an event_format instance to the pevent struct.
      
      This patch introduces a pevent_parse_format() routine with just the bits
      needed to parse the event/sys/tp/format file and just return the
      event_format instance, useful for when all we want is to parse the
      format file, without requiring the pevent struct.
      
      Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/n/tip-lge0afl47arh86om0m6a5bqr@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2b29175d
    • Arnaldo Carvalho de Melo's avatar
      tools lib traceevent: Remove some die() calls · a6d2a61a
      Arnaldo Carvalho de Melo authored
      
      
      Cleaned event-parse.c this time, just propagate the errors and in handle
      them the call sites.
      
      Reviewed-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/n/tip-9ebpr2vgfk2qs2841i99sa8y@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a6d2a61a
    • Arnaldo Carvalho de Melo's avatar
      tools lib traceevent: Fix afterlife gotos · b8511920
      Arnaldo Carvalho de Melo authored
      
      
      Instead of dying, just use do_warning and let the goto that is there to
      take place.
      
      Reviewed-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/n/tip-aoaus46ngnt9oc2pt7ckot5d@git.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b8511920