linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* problem with 'perf script -F weight'
@ 2021-09-28 19:20 Jiri Olsa
  2021-09-28 20:38 ` Andi Kleen
  2021-09-28 21:35 ` Liang, Kan
  0 siblings, 2 replies; 5+ messages in thread
From: Jiri Olsa @ 2021-09-28 19:20 UTC (permalink / raw)
  To: Kan Liang
  Cc: linux-perf-users, Peter Zijlstra, Joe Mario, Andi Kleen, Jin Yao,
	Arnaldo Carvalho de Melo


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);
 }


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

end of thread, other threads:[~2021-09-29 15:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-28 19:20 problem with 'perf script -F weight' Jiri Olsa
2021-09-28 20:38 ` Andi Kleen
2021-09-28 21:35 ` Liang, Kan
2021-09-29  6:08   ` Jiri Olsa
2021-09-29 15:13     ` Liang, Kan

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).