1. 05 11月, 2019 1 次提交
  2. 01 9月, 2019 1 次提交
    • T
      libtraceevent, perf tools: Changes in tep_print_event_* APIs · 38847db9
      Tzvetomir Stoyanov 提交于
      Libtraceevent APIs for printing various trace events information are
      complicated, there are complex extra parameters. To control the way
      event information is printed, the user should call a set of functions in
      a specific sequence.
      
      These APIs are reimplemented to provide a more simple interface for
      printing event information.
      
      Removed APIs:
      
       	tep_print_event_task()
      	tep_print_event_time()
      	tep_print_event_data()
      	tep_event_info()
      	tep_is_latency_format()
      	tep_set_latency_format()
      	tep_data_latency_format()
      	tep_set_print_raw()
      
      A new API for printing event information is introduced:
         void tep_print_event(struct tep_handle *tep, struct trace_seq *s,
      		        struct tep_record *record, const char *fmt, ...);
      where "fmt" is a printf-like format string, followed by the event
      fields to be printed. Supported fields:
       TEP_PRINT_PID, "%d" - event PID
       TEP_PRINT_CPU, "%d" - event CPU
       TEP_PRINT_COMM, "%s" - event command string
       TEP_PRINT_NAME, "%s" - event name
       TEP_PRINT_LATENCY, "%s" - event latency
       TEP_PRINT_TIME, %d - event time stamp. A divisor and precision
         can be specified as part of this format string:
         "%precision.divisord". Example:
         "%3.1000d" - divide the time by 1000 and print the first 3 digits
         before the dot. Thus, the time stamp "123456000" will be printed as
         "123.456"
       TEP_PRINT_INFO, "%s" - event information.
       TEP_PRINT_INFO_RAW, "%s" - event information, in raw format.
      
      Example:
        tep_print_event(tep, s, record, "%16s-%-5d [%03d] %s %6.1000d %s %s",
      		  TEP_PRINT_COMM, TEP_PRINT_PID, TEP_PRINT_CPU,
      		  TEP_PRINT_LATENCY, TEP_PRINT_TIME, TEP_PRINT_NAME, TEP_PRINT_INFO);
      Output:
      	ls-11314 [005] d.h. 185207.366383 function __wake_up
      Signed-off-by: NTzvetomir Stoyanov <tstoyanov@vmware.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: linux-trace-devel@vger.kernel.org
      Cc: Patrick McLean <chutzpah@gentoo.org>
      Link: http://lore.kernel.org/linux-trace-devel/20190801074959.22023-2-tz.stoyanov@gmail.com
      Link: http://lore.kernel.org/lkml/20190805204355.041132030@goodmis.orgSigned-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      38847db9
  3. 30 8月, 2019 1 次提交
  4. 26 6月, 2019 1 次提交
    • A
      tools perf: Move from sane_ctype.h obtained from git to the Linux's original · 3052ba56
      Arnaldo Carvalho de Melo 提交于
      We got the sane_ctype.h headers from git and kept using it so far, but
      since that code originally came from the kernel sources to the git
      sources, perhaps its better to just use the one in the kernel, so that
      we can leverage tools/perf/check_headers.sh to be notified when our copy
      gets out of sync, i.e. when fixes or goodies are added to the code we've
      copied.
      
      This will help with things like tools/lib/string.c where we want to have
      more things in common with the kernel, such as strim(), skip_spaces(),
      etc so as to go on removing the things that we have in tools/perf/util/
      and instead using the code in the kernel, indirectly and removing things
      like EXPORT_SYMBOL(), etc, getting notified when fixes and improvements
      are made to the original code.
      
      Hopefully this also should help with reducing the difference of code
      hosted in tools/ to the one in the kernel proper.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-7k9868l713wqtgo01xxygn12@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3052ba56
  5. 05 6月, 2019 1 次提交
  6. 02 4月, 2019 1 次提交
  7. 18 12月, 2018 1 次提交
  8. 09 10月, 2018 2 次提交
  9. 20 9月, 2018 2 次提交
  10. 31 8月, 2018 1 次提交
  11. 14 8月, 2018 6 次提交
  12. 11 8月, 2018 1 次提交
  13. 27 6月, 2017 1 次提交
  14. 20 4月, 2017 1 次提交
  15. 26 1月, 2017 1 次提交
  16. 12 12月, 2015 1 次提交
  17. 24 7月, 2015 1 次提交
  18. 27 5月, 2015 1 次提交
  19. 06 2月, 2015 1 次提交
  20. 18 2月, 2014 1 次提交
  21. 05 12月, 2013 1 次提交
  22. 09 10月, 2013 1 次提交
  23. 20 9月, 2013 1 次提交
    • I
      perf tools: Fix old GCC build error in trace-event-parse.c:parse_proc_kallsyms() · 0f965429
      Ingo Molnar 提交于
      Old GCC (4.1) does not see through the code flow of parse_proc_kallsyms()
      and gets confused about the status of 'fmt':
      
       util/trace-event-parse.c: In function ‘parse_proc_kallsyms’:
       util/trace-event-parse.c:189: warning: ‘fmt’ may be used uninitialized in this function
       make: *** [util/trace-event-parse.o] Error 1
      
      Help out GCC by initializing 'fmt' to NULL.
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: H. Peter Anvin <hpa@zytor.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: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20130912131649.GC23826@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0f965429
  24. 13 7月, 2013 2 次提交
  25. 16 3月, 2013 1 次提交
  26. 24 9月, 2012 1 次提交
  27. 11 9月, 2012 1 次提交
    • I
      perf tools: Use __maybe_used for unused variables · 1d037ca1
      Irina Tirdea 提交于
      perf defines both __used and __unused variables to use for marking
      unused variables. The variable __used is defined to
      __attribute__((__unused__)), which contradicts the kernel definition to
      __attribute__((__used__)) for new gcc versions. On Android, __used is
      also defined in system headers and this leads to warnings like: warning:
      '__used__' attribute ignored
      
      __unused is not defined in the kernel and is not a standard definition.
      If __unused is included everywhere instead of __used, this leads to
      conflicts with glibc headers, since glibc has a variables with this name
      in its headers.
      
      The best approach is to use __maybe_unused, the definition used in the
      kernel for __attribute__((unused)). In this way there is only one
      definition in perf sources (instead of 2 definitions that point to the
      same thing: __used and __unused) and it works on both Linux and Android.
      This patch simply replaces all instances of __used and __unused with
      __maybe_unused.
      Signed-off-by: NIrina Tirdea <irina.tirdea@intel.com>
      Acked-by: NPekka Enberg <penberg@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1347315303-29906-7-git-send-email-irina.tirdea@intel.com
      [ committer note: fixed up conflict with a116e05d in builtin-sched.c ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1d037ca1
  28. 14 8月, 2012 1 次提交
  29. 08 8月, 2012 2 次提交
    • A
      perf script: Stop using pevent directly · 97822433
      Arnaldo Carvalho de Melo 提交于
      We can get all that is needed using just event_format, that is available
      via evsel->tp_format now.
      
      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-2hsr1686epa9f0vx4yg7z2zj@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      97822433
    • A
      perf evsel: Cache associated event_format · fcf65bf1
      Arnaldo Carvalho de Melo 提交于
      We already lookup the associated event_format when reading the perf.data
      header, so that we can cache the tracepoint name in evsel->name, so do
      it a little further and save the event_format itself, so that we can
      avoid relookups in tools that need to access it.
      
      Change the tools to take the most obvious advantage, when they were
      using pevent_find_event directly. More work is needed for further
      removing the need of a pointer to pevent, such as when asking for event
      field values ("common_pid" and the other common fields and per
      event_format fields).
      
      This is something that was planned but only got actually done when
      Andrey Wagin needed to do this lookup at perf_tool->sample() time, when
      we don't have access to pevent (session->pevent) to use with
      pevent_find_event().
      
      Cc: Andrey Wagin <avagin@gmail.com>
      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>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Link: http://lkml.kernel.org/n/tip-txkvew2ckko0b594ae8fbnyk@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fcf65bf1
  30. 02 7月, 2012 1 次提交
    • D
      perf script: Fix format regression due to libtraceevent merge · 76a8349d
      David Ahern 提交于
      Consider the commands:
          perf record -e sched:sched_switch -fo /tmp/perf.data  -a -- sleep 1
          perf script -i /tmp/perf.data
      
      In v3.4 the output has the form (lines wrapped here)
          perf 29214 [005] 821043.582596: sched_switch:
      prev_comm=perf prev_pid=29214 prev_prio=120
      prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120
      
      In 3.5 that same line has become:
          perf 29214 [005] 821043.582596: sched_switch:
      <...>-29214 [005]     0.000000000: sched_switch:
      prev_comm=perf prev_pid=29214 prev_prio=120
      prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120
      
      Note the duplicates in the output -- pid, cpu, event name. With
      this patch the v3.4 output is restored:
          perf 29214 [005] 821043.582596: sched_switch:
      prev_comm=perf prev_pid=29214 prev_prio=120
      prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120
      
      v3:
      Remove that pesky newline too. Output now matches v3.4 (pre-libtracevent).
      
      v2:
      Change print_trace_event function local to perf per Steve's comments.
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1339698977-68962-1-git-send-email-dsahern@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      76a8349d
  31. 28 6月, 2012 1 次提交
    • A
      perf tools: Stop using a global trace events description list · da378962
      Arnaldo Carvalho de Melo 提交于
      The pevent thing is per perf.data file, so I made it stop being static
      and become a perf_session member, so tools processing perf.data files
      use perf_session and _there_ we read the trace events description into
      session->pevent and then change everywhere to stop using that single
      global pevent variable and use the per session one.
      
      Note that it _doesn't_ fall backs to trace__event_id, as we're not
      interested at all in what is present in the
      /sys/kernel/debug/tracing/events in the workstation doing the analysis,
      just in what is in the perf.data file.
      
      This patch also introduces perf_session__set_tracepoints_handlers that
      is the perf perf.data/session way to associate handlers to tracepoint
      events by resolving their IDs using the events descriptions stored in a
      perf.data file. Make 'perf sched' use it.
      Reported-by: NDmitry Antipov <dmitry.antipov@linaro.org>
      Tested-by: NDmitry Antipov <dmitry.antipov@linaro.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: linaro-dev@lists.linaro.org
      Cc: patches@linaro.org
      Link: http://lkml.kernel.org/r/20120625232016.GA28525@infradead.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      da378962