All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
To: Jin Yao <yao.jin@linux.intel.com>
Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org,
	mingo@redhat.com, alexander.shishkin@linux.intel.com,
	Linux-kernel@vger.kernel.org, ak@linux.intel.com,
	kan.liang@intel.com, yao.jin@intel.com,
	Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Subject: Re: [PATCH v3] perf stat: Show percore counts in per CPU output
Date: Thu, 13 Feb 2020 18:50:56 +0530	[thread overview]
Message-ID: <54bea6fe-26a1-a08c-7a61-ac5f5d43ad8c@linux.ibm.com> (raw)
In-Reply-To: <20200213071555.17239-1-yao.jin@linux.intel.com>

Hi Jin,

On 2/13/20 12:45 PM, Jin Yao wrote:
> With this patch, for example,
> 
>   # perf stat -e cpu/event=cpu-cycles,percore/ -a -A --percore-show-thread  -- sleep 1
> 
>    Performance counter stats for 'system wide':
> 
>   CPU0               2,453,061      cpu/event=cpu-cycles,percore/
>   CPU1               1,823,921      cpu/event=cpu-cycles,percore/
>   CPU2               1,383,166      cpu/event=cpu-cycles,percore/
>   CPU3               1,102,652      cpu/event=cpu-cycles,percore/
>   CPU4               2,453,061      cpu/event=cpu-cycles,percore/
>   CPU5               1,823,921      cpu/event=cpu-cycles,percore/
>   CPU6               1,383,166      cpu/event=cpu-cycles,percore/
>   CPU7               1,102,652      cpu/event=cpu-cycles,percore/
> 
> We can see counts are duplicated in CPU pairs
> (CPU0/CPU4, CPU1/CPU5, CPU2/CPU6, CPU3/CPU7).
> 

I was trying this patch and I am getting bit weird results when any cpu
is offline. Ex,

   $ lscpu | grep list
   On-line CPU(s) list:             0-4,6,7
   Off-line CPU(s) list:            5

   $ sudo ./perf stat -e cpu/event=cpu-cycles,percore/ -a -A --percore-show-thread -vv -- sleep 1
     ...
   cpu/event=cpu-cycles,percore/: 0: 23746491 1001189836 1001189836
   cpu/event=cpu-cycles,percore/: 1: 19802666 1001291299 1001291299
   cpu/event=cpu-cycles,percore/: 2: 24211983 1001394318 1001394318
   cpu/event=cpu-cycles,percore/: 3: 54051396 1001516816 1001516816
   cpu/event=cpu-cycles,percore/: 4: 6378825 1001064048 1001064048
   cpu/event=cpu-cycles,percore/: 5: 21299840 1001166297 1001166297
   cpu/event=cpu-cycles,percore/: 6: 13075410 1001274535 1001274535
   
    Performance counter stats for 'system wide':
   
   CPU0              30,125,316      cpu/event=cpu-cycles,percore/
   CPU1              19,802,666      cpu/event=cpu-cycles,percore/
   CPU2              45,511,823      cpu/event=cpu-cycles,percore/
   CPU3              67,126,806      cpu/event=cpu-cycles,percore/
   CPU4              30,125,316      cpu/event=cpu-cycles,percore/
   CPU7              67,126,806      cpu/event=cpu-cycles,percore/
   CPU0              30,125,316      cpu/event=cpu-cycles,percore/
   
          1.001918764 seconds time elapsed

I see proper result without --percore-show-thread:

   $ sudo ./perf stat -e cpu/event=cpu-cycles,percore/ -a -A -vv -- sleep 1
     ...
   cpu/event=cpu-cycles,percore/: 0: 11676414 1001190709 1001190709
   cpu/event=cpu-cycles,percore/: 1: 39119617 1001291459 1001291459
   cpu/event=cpu-cycles,percore/: 2: 41821512 1001391158 1001391158
   cpu/event=cpu-cycles,percore/: 3: 46853730 1001492799 1001492799
   cpu/event=cpu-cycles,percore/: 4: 14448274 1001095948 1001095948
   cpu/event=cpu-cycles,percore/: 5: 42238217 1001191187 1001191187
   cpu/event=cpu-cycles,percore/: 6: 33129641 1001292072 1001292072
   
    Performance counter stats for 'system wide':
   
   S0-D0-C0             26,124,688      cpu/event=cpu-cycles,percore/
   S0-D0-C1             39,119,617      cpu/event=cpu-cycles,percore/
   S0-D0-C2             84,059,729      cpu/event=cpu-cycles,percore/
   S0-D0-C3             79,983,371      cpu/event=cpu-cycles,percore/
   
          1.001961563 seconds time elapsed

[...]

> +--percore-show-thread::
> +The event modifier "percore" has supported to sum up the event counts
> +for all hardware threads in a core and show the counts per core.
> +
> +This option with event modifier "percore" enabled also sums up the event
> +counts for all hardware threads in a core but show the sum counts per
> +hardware thread. This is essentially a replacement for the any bit and
> +convenient for posting process.

s/posting process/post processing/ ? :)

Ravi


  reply	other threads:[~2020-02-13 13:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13  7:15 [PATCH v3] perf stat: Show percore counts in per CPU output Jin Yao
2020-02-13 13:20 ` Ravi Bangoria [this message]
2020-02-13 15:10   ` Jin, Yao
2020-02-14  5:16     ` Ravi Bangoria
2020-02-14  6:06       ` Jin, Yao

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=54bea6fe-26a1-a08c-7a61-ac5f5d43ad8c@linux.ibm.com \
    --to=ravi.bangoria@linux.ibm.com \
    --cc=Linux-kernel@vger.kernel.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@intel.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=yao.jin@intel.com \
    --cc=yao.jin@linux.intel.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 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.