linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@linux.intel.com>
To: Jiri Olsa <jolsa@redhat.com>, Kan Liang <kan.liang@linux.intel.com>
Cc: linux-perf-users@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Joe Mario <jmario@redhat.com>, Jin Yao <yao.jin@linux.intel.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Subject: Re: problem with 'perf script -F weight'
Date: Tue, 28 Sep 2021 13:38:45 -0700	[thread overview]
Message-ID: <5f182be7-1e6e-b864-66db-c5588601784a@linux.intel.com> (raw)
In-Reply-To: <YVNq9av/3Lwmom4T@krava>


On 9/28/2021 12:20 PM, Jiri Olsa wrote:
> hi,
> Joe reported broken -F weight in perf script with (on x86):
>
>    # ./perf mem record
>    # ./perf script -F weight
>    Samples for 'dummy:HG' event do not have WEIGHT attribute set. Cannot print 'weight' field.
>
> the problem seems to be introduced with the WEIGHT_STRUCT change:
>    ea8d0ed6eae3 perf tools: Support PERF_SAMPLE_WEIGHT_STRUCT
>
> which enables WEIGHT_STRUCT sample_type on x86 instead of WEIGHT,
> and leaves 'perf script -F weight' in the dark
>
> I'm not sure what the fix should look like.. should we allow user
> to use just 'WEIGHT' sample type? or is there a way to get original
> weight from 'WEIGHT_STRUCT' data, so we could fix just perf script?

We would need to support both in perf script, to handle both perf.data 
generated by old and new kernels on both big and little endian

So probably try one first and then the other while parsing

The same is true for all other users, so probably there needs to be a 
library function for this somewhere.

-Andi



  reply	other threads:[~2021-09-28 20:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28 19:20 problem with 'perf script -F weight' Jiri Olsa
2021-09-28 20:38 ` Andi Kleen [this message]
2021-09-28 21:35 ` Liang, Kan
2021-09-29  6:08   ` Jiri Olsa
2021-09-29 15:13     ` 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=5f182be7-1e6e-b864-66db-c5588601784a@linux.intel.com \
    --to=ak@linux.intel.com \
    --cc=acme@kernel.org \
    --cc=jmario@redhat.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=peterz@infradead.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).