]> Git Repo - linux.git/commit
perf tools: Support PERF_SAMPLE_WEIGHT_STRUCT
authorKan Liang <[email protected]>
Tue, 2 Feb 2021 20:09:09 +0000 (12:09 -0800)
committerArnaldo Carvalho de Melo <[email protected]>
Mon, 8 Feb 2021 19:25:00 +0000 (16:25 -0300)
commitea8d0ed6eae37b01953a29bca98112d9e2507a84
tree41bb58491de13d741a44b1d4d8c64cbe78d1582e
parentd9d5d767b2c006bbc1993ba3f2124d23ff515e32
perf tools: Support PERF_SAMPLE_WEIGHT_STRUCT

The new sample type, PERF_SAMPLE_WEIGHT_STRUCT, is an alternative of the
PERF_SAMPLE_WEIGHT sample type. Users can apply either the
PERF_SAMPLE_WEIGHT sample type or the PERF_SAMPLE_WEIGHT_STRUCT sample
type to retrieve the sample weight, but they cannot apply both sample
types simultaneously.

The new sample type shares the same space as the PERF_SAMPLE_WEIGHT
sample type. The lower 32 bits are exactly the same for both sample
type. The higher 32 bits may be different for different architecture.

Add arch specific arch_evsel__set_sample_weight() to set the new sample
type for X86. Only store the lower 32 bits for the sample->weight if the
new sample type is applied. In practice, no memory access could last
than 4G cycles. No data will be lost.

If the kernel doesn't support the new sample type. Fall back to the
PERF_SAMPLE_WEIGHT sample type.

There is no impact for other architectures.

Committer notes:

Fixup related to PERF_SAMPLE_CODE_PAGE_SIZE, present in acme/perf/core
but not upstream yet.

Signed-off-by: Kan Liang <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Jin Yao <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Madhavan Srinivasan <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/arch/x86/util/Build
tools/perf/arch/x86/util/evsel.c [new file with mode: 0644]
tools/perf/util/evsel.c
tools/perf/util/evsel.h
tools/perf/util/intel-pt.c
tools/perf/util/perf_event_attr_fprintf.c
tools/perf/util/session.c
tools/perf/util/synthetic-events.c
This page took 0.067726 seconds and 4 git commands to generate.