All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Kan Liang <kan.liang@linux.intel.com>
Cc: linux-perf-users@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Joe Mario <jmario@redhat.com>, Andi Kleen <ak@linux.intel.com>,
	Jin Yao <yao.jin@linux.intel.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Subject: problem with 'perf script -F weight'
Date: Tue, 28 Sep 2021 21:20:21 +0200	[thread overview]
Message-ID: <YVNq9av/3Lwmom4T@krava> (raw)


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?

FYI when I switch back the WEIGHT_STRUCT to WEIGHT again it seems
to work as before.. as expected ;-)

any thoughts? thanks
jirka


---
diff --git a/tools/perf/arch/x86/util/evsel.c b/tools/perf/arch/x86/util/evsel.c
index 2f733cdc8dbb..6bdd744894ad 100644
--- a/tools/perf/arch/x86/util/evsel.c
+++ b/tools/perf/arch/x86/util/evsel.c
@@ -4,5 +4,5 @@
 
 void arch_evsel__set_sample_weight(struct evsel *evsel)
 {
-	evsel__set_sample_bit(evsel, WEIGHT_STRUCT);
+	evsel__set_sample_bit(evsel, WEIGHT);
 }


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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-28 19:20 Jiri Olsa [this message]
2021-09-28 20:38 ` problem with 'perf script -F weight' Andi Kleen
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=YVNq9av/3Lwmom4T@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=jmario@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 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.