All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL 00/43] perf/core new feature: 'perf stat record/report'
@ 2015-12-17 19:46 Arnaldo Carvalho de Melo
  2015-12-17 19:46 ` [PATCH 01/43] perf thread_map: Add thread_map user level event Arnaldo Carvalho de Melo
                   ` (43 more replies)
  0 siblings, 44 replies; 47+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-12-17 19:46 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern, Jiri Olsa,
	Kan Liang, Namhyung Kim, Peter Zijlstra, Wang Nan

From: Arnaldo Carvalho de Melo <acme@redhat.com>

Hi Ingo,

	Please consider pulling, cool new feature! This is on top of the
perf-core-for-mingo-2.1 tag, with that RHEL6.7 bugfix, I had also to go
over this one fixing stuff in many spots :-\

- Arnaldo

The following changes since commit 1843b4e057b7717db21a3ad96fa16d6b4ee8f6c4:

  tools subcmd: Rename subcmd header include guards (2015-12-17 14:27:14 -0300)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-3

for you to fetch changes up to 89af4e05c21d68f22e07fe66940ea675615a49ed:

  perf stat report: Allow to override aggr_mode (2015-12-17 16:30:30 -0300)

----------------------------------------------------------------
perf/core improvement.

User visible:

- Generate perf.data files from 'perf stat', to tap into the scripting
  capabilities perf has instead of defining a 'perf stat' specific scripting
  support to calculate event ratios, etc. Simple example:

  $ perf stat record -e cycles usleep 1

   Performance counter stats for 'usleep 1':

         1,134,996      cycles

       0.000670644 seconds time elapsed

  $ perf stat report

   Performance counter stats for '/home/acme/bin/perf stat record -e cycles usleep 1':

         1,134,996      cycles

       0.000670644 seconds time elapsed

  $

  It generates PERF_RECORD_ userspace records to store the details:

  $ perf report -D | grep PERF_RECORD
  0xf0 [0x28]: PERF_RECORD_THREAD_MAP nr: 1 thread: 27637
  0x118 [0x12]: PERF_RECORD_CPU_MAP nr: 1 cpu: 65535
  0x12a [0x40]: PERF_RECORD_STAT_CONFIG
  0x16a [0x30]: PERF_RECORD_STAT
  -1 -1 0x19a [0x40]: PERF_RECORD_MMAP -1/0: [0xffffffff81000000(0x1f000000) @ 0xffffffff81000000]: x [kernel.kallsyms]_text
  0x1da [0x18]: PERF_RECORD_STAT_ROUND
  [acme@ssdandy linux]$

  An effort was made to make perf.data files generated like this to not
  generate cryptic messages when processed by older tools.

  The 'perf script' bits need rebasing, will go up later.

Jiri's cover letter for this series:

The initial attempt defined its own formula lang and allowed triggering user's
script on the end of the stat command:

  http://marc.info/?l=linux-kernel&m=136742146322273&w=2

This patchset abandons the idea of new formula language and rather adds support
to:

  - store stat data into perf.data file
  - add python support to process stat events

Basically it allows to store stat data into perf.data and post process it with
python scripts in a similar way we do for sampling data.

The stat data are stored in new stat, stat-round, stat-config user events.
  stat        - stored for each read syscall of the counter
  stat round  - stored for each interval or end of the command invocation
  stat config - stores all the config information needed to process data
                so report tool could restore the same output as record

The python script can now define 'stat__<eventname>_<modifier>' functions
to get stat events data and 'stat__interval' to get stat-round data.

See CPI script example in scripts/python/stat-cpi.py.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Jiri Olsa (43):
      perf thread_map: Add thread_map user level event
      perf thread_map: Add thread_map event sythesize function
      perf thread_map: Add thread_map__new_event function
      perf thread_map: Add perf_event__fprintf_thread_map function
      perf cpu_map: Add cpu_map user level event
      perf cpu_map: Add cpu_map event synthesize function
      perf cpu_map: Add cpu_map__new_event function
      perf cpu_map: Add perf_event__fprintf_cpu_map function
      perf tools: Add stat config user level event
      perf tools: Add stat config event synthesize function
      perf tools: Add stat config event read function
      perf tools: Add stat user level event
      perf tools: Add stat event synthesize function
      perf tools: Add stat event read function
      perf tools: Add stat round user level event
      perf tools: Add stat round event synthesize function
      perf tools: Add stat events fprintf functions
      perf tools: Add event_update user level event
      perf tools: Add event_update event unit type
      perf tools: Add event_update event scale type
      perf tools: Add event_update event name type
      perf tools: Add event_update event cpus type
      perf tools: Add perf_event__fprintf_event_update function
      perf report: Display newly added events in raw dump
      perf tools: Introduce stat perf.data header feature
      perf stat record: Add record command
      perf stat record: Initialize record features
      perf stat record: Synthesize stat record data
      perf evlist: Export id_add_fd()
      perf stat record: Store events IDs in perf data file
      perf stat record: Add pipe support for record command
      perf stat record: Write stat events on record
      perf stat record: Write stat round events on record
      perf stat record: Do not allow record with multiple runs mode
      perf stat record: Synthesize event update events
      perf stat report: Add report command
      perf stat report: Process cpu/threads maps
      perf stat report: Process stat config event
      perf stat report: Add support to initialize aggr_map from file
      perf stat report: Move csv_sep initialization before report command
      perf stat report: Process stat and stat round events
      perf stat report: Process event update events
      perf stat report: Allow to override aggr_mode

 tools/perf/Documentation/perf-stat.txt |  34 ++
 tools/perf/builtin-record.c            |   2 +
 tools/perf/builtin-stat.c              | 614 ++++++++++++++++++++++++++++++++-
 tools/perf/tests/Build                 |   3 +
 tools/perf/tests/builtin-test.c        |  24 ++
 tools/perf/tests/cpumap.c              |  88 +++++
 tools/perf/tests/event_update.c        | 117 +++++++
 tools/perf/tests/stat.c                | 111 ++++++
 tools/perf/tests/tests.h               |   6 +
 tools/perf/tests/thread-map.c          |  43 +++
 tools/perf/util/cpumap.c               |  42 +++
 tools/perf/util/cpumap.h               |   1 +
 tools/perf/util/event.c                | 308 +++++++++++++++++
 tools/perf/util/event.h                | 150 +++++++-
 tools/perf/util/evlist.c               |   6 +-
 tools/perf/util/evlist.h               |   3 +
 tools/perf/util/header.c               | 205 +++++++++++
 tools/perf/util/header.h               |  17 +
 tools/perf/util/session.c              | 189 ++++++++++
 tools/perf/util/stat.c                 |  62 ++++
 tools/perf/util/stat.h                 |  10 +
 tools/perf/util/thread_map.c           |  27 ++
 tools/perf/util/thread_map.h           |   3 +
 tools/perf/util/tool.h                 |   8 +-
 24 files changed, 2054 insertions(+), 19 deletions(-)
 create mode 100644 tools/perf/tests/cpumap.c
 create mode 100644 tools/perf/tests/event_update.c
 create mode 100644 tools/perf/tests/stat.c

^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2015-12-18 10:11 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-17 19:46 [GIT PULL 00/43] perf/core new feature: 'perf stat record/report' Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 01/43] perf thread_map: Add thread_map user level event Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 02/43] perf thread_map: Add thread_map event sythesize function Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 03/43] perf thread_map: Add thread_map__new_event function Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 04/43] perf thread_map: Add perf_event__fprintf_thread_map function Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 05/43] perf cpu_map: Add cpu_map user level event Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 06/43] perf cpu_map: Add cpu_map event synthesize function Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 07/43] perf cpu_map: Add cpu_map__new_event function Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 08/43] perf cpu_map: Add perf_event__fprintf_cpu_map function Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 09/43] perf tools: Add stat config user level event Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 10/43] perf tools: Add stat config event synthesize function Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 11/43] perf tools: Add stat config event read function Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 12/43] perf tools: Add stat user level event Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 13/43] perf tools: Add stat event synthesize function Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 14/43] perf tools: Add stat event read function Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 15/43] perf tools: Add stat round user level event Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 16/43] perf tools: Add stat round event synthesize function Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 17/43] perf tools: Add stat events fprintf functions Arnaldo Carvalho de Melo
2015-12-17 19:46 ` [PATCH 18/43] perf tools: Add event_update user level event Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 19/43] perf tools: Add event_update event unit type Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 20/43] perf tools: Add event_update event scale type Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 21/43] perf tools: Add event_update event name type Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 22/43] perf tools: Add event_update event cpus type Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 23/43] perf tools: Add perf_event__fprintf_event_update function Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 24/43] perf report: Display newly added events in raw dump Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 25/43] perf tools: Introduce stat perf.data header feature Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 26/43] perf stat record: Add record command Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 27/43] perf stat record: Initialize record features Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 28/43] perf stat record: Synthesize stat record data Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 29/43] perf evlist: Export id_add_fd() Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 30/43] perf stat record: Store events IDs in perf data file Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 31/43] perf stat record: Add pipe support for record command Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 32/43] perf stat record: Write stat events on record Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 33/43] perf stat record: Write stat round " Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 34/43] perf stat record: Do not allow record with multiple runs mode Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 35/43] perf stat record: Synthesize event update events Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 36/43] perf stat report: Add report command Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 37/43] perf stat report: Process cpu/threads maps Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 38/43] perf stat report: Process stat config event Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 39/43] perf stat report: Add support to initialize aggr_map from file Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 40/43] perf stat report: Move csv_sep initialization before report command Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 41/43] perf stat report: Process stat and stat round events Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 42/43] perf stat report: Process event update events Arnaldo Carvalho de Melo
2015-12-17 19:47 ` [PATCH 43/43] perf stat report: Allow to override aggr_mode Arnaldo Carvalho de Melo
2015-12-18  8:48 ` [GIT PULL 00/43] perf/core new feature: 'perf stat record/report' Ingo Molnar
2015-12-18  8:55   ` Ingo Molnar
2015-12-18 10:11     ` Jiri Olsa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.