Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b0a5daa authored by Kan Liang's avatar Kan Liang Committed by Arnaldo Carvalho de Melo
Browse files

perf tools: Support new sample type for physical address



Support new sample type PERF_SAMPLE_PHYS_ADDR for physical address.

Add new option --phys-data to record sample physical address.

Signed-off-by: default avatarKan Liang <kan.liang@intel.com>
Tested-by: default avatarJiri Olsa <jolsa@redhat.com>
Acked-by: default avatarStephane Eranian <eranian@google.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1504026672-7304-2-git-send-email-kan.liang@intel.com


[ Added missing printing in evsel.c patch sent by Jiri Olsa ]
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 2a118e1b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -139,8 +139,9 @@ enum perf_event_sample_format {
	PERF_SAMPLE_IDENTIFIER			= 1U << 16,
	PERF_SAMPLE_TRANSACTION			= 1U << 17,
	PERF_SAMPLE_REGS_INTR			= 1U << 18,
	PERF_SAMPLE_PHYS_ADDR			= 1U << 19,

	PERF_SAMPLE_MAX = 1U << 19,		/* non-ABI */
	PERF_SAMPLE_MAX = 1U << 20,		/* non-ABI */
};

/*
@@ -814,6 +815,7 @@ enum perf_event_type {
	 *	{ u64			transaction; } && PERF_SAMPLE_TRANSACTION
	 *	{ u64			abi; # enum perf_sample_regs_abi
	 *	  u64			regs[weight(mask)]; } && PERF_SAMPLE_REGS_INTR
	 *	{ u64			phys_addr;} && PERF_SAMPLE_PHYS_ADDR
	 * };
	 */
	PERF_RECORD_SAMPLE			= 9,
+4 −1
Original line number Diff line number Diff line
@@ -249,7 +249,10 @@ OPTIONS

-d::
--data::
	Record the sample addresses.
	Record the sample virtual addresses.

--phys-data::
	Record the sample physical addresses.

-T::
--timestamp::
+2 −0
Original line number Diff line number Diff line
@@ -1604,6 +1604,8 @@ static struct option __record_options[] = {
	OPT_BOOLEAN('s', "stat", &record.opts.inherit_stat,
		    "per thread counts"),
	OPT_BOOLEAN('d', "data", &record.opts.sample_address, "Record the sample addresses"),
	OPT_BOOLEAN(0, "phys-data", &record.opts.sample_phys_addr,
		    "Record the sample physical addresses"),
	OPT_BOOLEAN(0, "sample-cpu", &record.opts.sample_cpu, "Record the sample cpu"),
	OPT_BOOLEAN_SET('T', "timestamp", &record.opts.sample_time,
			&record.opts.sample_time_set,
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ struct record_opts {
	bool	     no_samples;
	bool	     raw_samples;
	bool	     sample_address;
	bool	     sample_phys_addr;
	bool	     sample_weight;
	bool	     sample_time;
	bool	     sample_time_set;
+1 −0
Original line number Diff line number Diff line
@@ -200,6 +200,7 @@ struct perf_sample {
	u32 cpu;
	u32 raw_size;
	u64 data_src;
	u64 phys_addr;
	u32 flags;
	u16 insn_len;
	u8  cpumode;
Loading