mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: "Liang, Kan" <kan.liang@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Andi Kleen <andi@firstfloor.org>,
	Ulrich Drepper <drepper@gmail.com>,
	Will Deacon <will.deacon@arm.com>,
	Stephane Eranian <eranian@google.com>,
	Don Zickus <dzickus@redhat.com>,
	lkml <linux-kernel@vger.kernel.org>,
	David Ahern <dsahern@gmail.com>, Ingo Molnar <mingo@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCHv3 00/56] perf stat: Add scripting support
Date: Thu, 8 Oct 2015 22:11:09 +0200	[thread overview]
Message-ID: <20151008201109.GA8621@krava.landal.opennet> (raw)
In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F0770196C933@SHSMSX103.ccr.corp.intel.com>

On Thu, Oct 08, 2015 at 06:37:43PM +0000, Liang, Kan wrote:
> 
> Hi Jirka
> 
> I'm doing some test with the perf/stat_script tree.
> Here are the issues I found so far.

hi,
thanks a lot for testing!

> 
> 1 test case failed to build:
> 
>   CC       tests/stat.o
> tests/stat.c: In function âtest__synthesize_statâ:
> tests/stat.c:82:3: error: missing initializer for field âenaâ of
> âstruct <anonymous>â [-Werror=missing-field-initializers]
>    .ena = 200,
>    ^
> In file included from tests/stat.c:5:0:
> /home/lk/group_read/test/perf/tools/perf/util/counts.h:10:8:
> note: âenaâ declared here
>     u64 ena;
>         ^
> tests/stat.c:83:3: error: missing initializer for field ârunâ of
> âstruct <anonymous>â [-Werror=missing-field-initializers]
>    .run = 300,
>    ^
> In file included from tests/stat.c:5:0:
> /home/lk/group_read/test/perf/tools/perf/util/counts.h:11:8:
> note: ârunâ declared here
>     u64 run;
>         ^
> cc1: all warnings being treated as errors
> mv: cannot stat âtests/.stat.o.tmpâ: No such file or directory
> make[3]: *** [tests/stat.o] Error 1
> make[2]: *** [tests] Error 2
> make[1]: *** [perf-in.o] Error 2
> make: *** [all] Error 2

saw this on another server.. have fix already

> 
> 
> 2. it still doesn't work well with uncore event.
> 
> Here is an example:
> sudo ./perf stat -e uncore_imc_1/cas_count_read/ -a --interval-print 100
> --per-socket record -- sleep 1
> #           time socket cpus             counts unit events
>      0.100231142 S0        1               0.04 MiB  uncore_imc_1/cas_count_read/
>      0.100231142 S1        1               0.08 MiB  uncore_imc_1/cas_count_read/
>      0.200583556 S0        1               0.02 MiB  uncore_imc_1/cas_count_read/
>      0.200583556 S1        1               0.02 MiB  uncore_imc_1/cas_count_read/
> 
> sudo ./perf stat report --per-socket
> #           time socket cpus             counts unit events
>      0.100231142 S0       36               0.12 MiB  uncore_imc_1/cas_count_read/
>      0.100231142 S1       28      <not counted> 
> MiB  uncore_imc_1/cas_count_read/
>      0.200583556 S0       36               0.04 MiB  uncore_imc_1/cas_count_read/
>      0.200583556 S1       28      <not counted> 
> MiB  uncore_imc_1/cas_count_read/
> 
> The results are not consistent. 
> 
> I checked the perf report -D result. It looks the wrong CPU id is stored.
> In my system, the uncore event should be monitored in CPU 0 and CPU 19
> But it shows CPU0 and CPU1.
> 
> 0x520 [0x30]: PERF_RECORD_STAT
> ... id 22385, cpu 0, thread 0
> 
> 0x550 [0x30]: PERF_RECORD_STAT
> ... id 22386, cpu 1, thread 0

it's the pmu's cpumask I did not take into account
I think we'll have to send cpumask as attr_update

> 
> 
> 3. I think you have already handled new record type for perf stat record.
> But the "unhandled!" message still show in the perf report -D.      
> 
> 0x598 [0x30]: PERF_RECORD_STAT
> ... id 22385, cpu 0, thread 0
> ... value 1752, enabled 501473097, running 501473097
> : unhandled!      <-------

yep, I was wondering about that as well.. but it's not 'handled' in perf report,
it just displays the raw output of the event.. but I think we could remove that
not to confuse

and perhaps we could also add -D for perf stat report

> 
> 
> 4. Core dump when applying --per-core -a for stat record.
> 
> sudo ./perf stat -e 'cycles' --per-core -a record sleep 1
> 
> ** Error in `./perf': corrupted double-linked list: 0x00000000036eb560 **
> ======= Backtrace: =========
> /lib64/libc.so.6[0x3002e7bbe7]
> /lib64/libc.so.6[0x3002e7d2b5]
> ./perf(perf_env__exit+0xfd)[0x484d1d]
> ./perf[0x47c45f]
> ./perf(main+0x610)[0x421ac0]
> /lib64/libc.so.6(__libc_start_main+0xf5)[0x3002e21b45]
> ./perf[0x421bd9]

could not reproduce this one.. any chance you could compile with
DEBUG=1 and re-run in gdb for more details? like which of the
frees got crazy.. ?

> 5.  perf stat record may not monitor on specific CPU/whole-system.
> However, perf stat report can be set to aggregate per core/socket.
> If so, there is problem to show the data.
> I think we need some warning here.
> 
> For example,
> 
> sudo ./perf stat -e 'cycles' record sleep 1
> 
>  Performance counter stats for 'sleep 1':
> 
>            858,928      cycles
> 
>        1.001120735 seconds time elapsed
> 
> sudo ./perf stat report -A
> 
>  Performance counter stats for '/home/lk/group_read/test/perf/
> tools/perf/perf stat -e cycles record sleep 1':
> 
> CPU-1              858,928      cycles
> 
>        1.001120735 seconds time elapsed

yep, we need to disable those options for process data 

thanks,
jirka

  reply	other threads:[~2015-10-08 20:11 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-06 19:54 Jiri Olsa
2015-10-06 19:54 ` [PATCH 01/56] perf tools: Add thread_map event Jiri Olsa
2015-10-06 19:54 ` [PATCH 02/56] perf tools: Add thread_map event sythesize function Jiri Olsa
2015-10-06 19:54 ` [PATCH 03/56] perf tools: Add thread_map__new_event function Jiri Olsa
2015-10-06 19:54 ` [PATCH 04/56] perf tools: Add perf_event__fprintf_thread_map function Jiri Olsa
2015-10-06 19:54 ` [PATCH 05/56] perf tools: Add cpu_map event Jiri Olsa
2015-10-06 19:54 ` [PATCH 06/56] perf tools: Add cpu_map event synthesize function Jiri Olsa
2015-10-06 19:54 ` [PATCH 07/56] perf tools: Add cpu_map__new_event function Jiri Olsa
2015-10-06 19:54 ` [PATCH 08/56] perf tools: Add perf_event__fprintf_cpu_map function Jiri Olsa
2015-10-06 19:54 ` [PATCH 09/56] perf tools: Add stat config event Jiri Olsa
2015-10-06 19:54 ` [PATCH 10/56] perf tools: Add stat config event synthesize function Jiri Olsa
2015-10-06 19:54 ` [PATCH 11/56] perf tools: Add stat config event read function Jiri Olsa
2015-10-06 19:54 ` [PATCH 12/56] perf tools: Add stat event Jiri Olsa
2015-10-06 19:54 ` [PATCH 13/56] perf tools: Add stat event synthesize function Jiri Olsa
2015-10-06 19:54 ` [PATCH 14/56] perf tools: Add stat event read function Jiri Olsa
2015-10-06 19:54 ` [PATCH 15/56] perf tools: Add stat round event Jiri Olsa
2015-10-06 19:54 ` [PATCH 16/56] perf tools: Add stat round event synthesize function Jiri Olsa
2015-10-06 19:54 ` [PATCH 17/56] perf tools: Add stat events fprintf functions Jiri Olsa
2015-10-06 19:54 ` [PATCH 18/56] perf tools: Add attr_update event Jiri Olsa
2015-10-06 19:54 ` [PATCH 19/56] perf tools: Add attr_update event unit type Jiri Olsa
2015-10-06 19:54 ` [PATCH 20/56] perf tools: Add attr_update event scale type Jiri Olsa
2015-10-06 19:55 ` [PATCH 21/56] perf tools: Add attr_update event name type Jiri Olsa
2015-10-06 19:55 ` [PATCH 22/56] perf tools: Add perf_event__fprintf_attr_update function Jiri Olsa
2015-10-06 19:55 ` [PATCH 23/56] perf report: Display newly added events in raw dump Jiri Olsa
2015-10-06 19:55 ` [PATCH 24/56] perf tools: Introduce stat feature Jiri Olsa
2015-10-06 19:55 ` [PATCH 25/56] perf tools: Move id_offset out of struct perf_evsel union Jiri Olsa
2015-10-06 19:55 ` [PATCH 26/56] perf stat: Rename perf_stat struct into perf_stat_evsel Jiri Olsa
2015-10-06 19:55 ` [PATCH 27/56] perf stat: Add AGGR_UNSET mode Jiri Olsa
2015-10-06 19:55 ` [PATCH 28/56] perf stat record: Add record command Jiri Olsa
2015-10-06 19:55 ` [PATCH 29/56] perf stat record: Initialize record features Jiri Olsa
2015-10-06 19:55 ` [PATCH 30/56] perf stat record: Synthesize stat record data Jiri Olsa
2015-10-06 19:55 ` [PATCH 31/56] perf stat record: Store events IDs in perf data file Jiri Olsa
2015-10-06 19:55 ` [PATCH 32/56] perf stat record: Add pipe support for record command Jiri Olsa
2015-10-06 19:55 ` [PATCH 33/56] perf stat record: Write stat events on record Jiri Olsa
2015-10-06 19:55 ` [PATCH 34/56] perf stat record: Write stat round " Jiri Olsa
2015-10-06 19:55 ` [PATCH 35/56] perf stat record: Do not allow record with multiple runs mode Jiri Olsa
2015-10-06 19:55 ` [PATCH 36/56] perf stat record: Synthesize attr update events Jiri Olsa
2015-10-06 19:55 ` [PATCH 37/56] perf tools: Add cpu_map__empty_new interface Jiri Olsa
2015-10-06 19:55 ` [PATCH 38/56] perf tools: Make cpu_map__build_map global Jiri Olsa
2015-10-06 19:55 ` [PATCH 39/56] perf tools: Add data arg to cpu_map__build_map callback Jiri Olsa
2015-10-06 19:55 ` [PATCH 40/56] perf stat report: Cache aggregated map entries in extra cpumap Jiri Olsa
2015-10-06 19:55 ` [PATCH 41/56] perf stat report: Add report command Jiri Olsa
2015-10-06 19:55 ` [PATCH 42/56] perf stat report: Process cpu/threads maps Jiri Olsa
2015-10-06 19:55 ` [PATCH 43/56] perf stat report: Process stat config event Jiri Olsa
2015-10-06 19:55 ` [PATCH 44/56] perf stat report: Add support to initialize aggr_map from file Jiri Olsa
2015-10-06 19:55 ` [PATCH 45/56] perf stat report: Process stat and stat round events Jiri Olsa
2015-10-06 19:55 ` [PATCH 46/56] perf stat report: Process attr update events Jiri Olsa
2015-10-06 19:55 ` [PATCH 47/56] perf stat report: Move csv_sep initialization before report command Jiri Olsa
2015-10-06 19:55 ` [PATCH 48/56] perf stat report: Allow to override aggr_mode Jiri Olsa
2015-10-06 19:55 ` [PATCH 49/56] perf script: Check output fields only for samples Jiri Olsa
2015-10-06 19:55 ` [PATCH 50/56] perf script: Process cpu/threads maps Jiri Olsa
2015-10-06 19:55 ` [PATCH 51/56] perf script: Process stat config event Jiri Olsa
2015-10-06 19:55 ` [PATCH 52/56] perf script: Add process_stat/process_stat_interval scripting interface Jiri Olsa
2015-10-06 19:55 ` [PATCH 53/56] perf script: Add stat default handlers Jiri Olsa
2015-10-06 19:55 ` [PATCH 54/56] perf script: Display stat events by default Jiri Olsa
2015-10-06 19:55 ` [PATCH 55/56] perf script: Add python support for stat events Jiri Olsa
2015-10-06 19:55 ` [PATCH 56/56] perf script: Add stat-cpi.py script Jiri Olsa
2015-10-08 18:37 ` [PATCHv3 00/56] perf stat: Add scripting support Liang, Kan
2015-10-08 20:11   ` Jiri Olsa [this message]
2015-10-09 18:31     ` Liang, Kan
2015-10-14 10:54       ` Jiri Olsa
2015-10-14 19:41         ` Liang, Kan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151008201109.GA8621@krava.landal.opennet \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=andi@firstfloor.org \
    --cc=drepper@gmail.com \
    --cc=dsahern@gmail.com \
    --cc=dzickus@redhat.com \
    --cc=eranian@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®