xref: /linux/tools/perf/scripts/python/bin/mem-phys-addr-record (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1#!/bin/bash
2
3#
4# Profiling physical memory by all retired load instructions/uops event
5# MEM_INST_RETIRED.ALL_LOADS or MEM_UOPS_RETIRED.ALL_LOADS
6#
7
8load=`perf list | grep mem_inst_retired.all_loads`
9if [ -z "$load" ]; then
10	load=`perf list | grep mem_uops_retired.all_loads`
11fi
12if [ -z "$load" ]; then
13	echo "There is no event to count all retired load instructions/uops."
14	exit 1
15fi
16
17arg=$(echo $load | tr -d ' ')
18arg="$arg:P"
19perf record --phys-data -e $arg $@
20