Skip to content

Commit cfcb3d8

Browse files
kvaneeshmpe
authored andcommitted
powerpc/mm: Add trace point for tracking hash pte fault
This enables us to understand how many hash fault we are taking when running benchmarks. For ex: -bash-4.2# ./perf stat -e powerpc:hash_fault -e page-faults /tmp/ebizzy.ppc64 -S 30 -P -n 1000 ... Performance counter stats for '/tmp/ebizzy.ppc64 -S 30 -P -n 1000': 1,10,04,075 powerpc:hash_fault 1,10,03,429 page-faults 30.865978991 seconds time elapsed NOTE: The impact of the tracepoint was not noticeable when running test. It was within the run-time variance of the test. For ex: without-patch: -------------- Performance counter stats for './a.out 3000 300': 643 page-faults # 0.089 M/sec 7.236562 task-clock (msec) # 0.928 CPUs utilized 2,179,213 stalled-cycles-frontend # 0.00% frontend cycles idle 17,174,367 stalled-cycles-backend # 0.00% backend cycles idle 0 context-switches # 0.000 K/sec 0.007794658 seconds time elapsed And with-patch: --------------- Performance counter stats for './a.out 3000 300': 643 page-faults # 0.089 M/sec 7.233746 task-clock (msec) # 0.921 CPUs utilized 0 context-switches # 0.000 K/sec 0.007854876 seconds time elapsed Performance counter stats for './a.out 3000 300': 643 page-faults # 0.087 M/sec 649 powerpc:hash_fault # 0.087 M/sec 7.430376 task-clock (msec) # 0.938 CPUs utilized 2,347,174 stalled-cycles-frontend # 0.00% frontend cycles idle 17,524,282 stalled-cycles-backend # 0.00% backend cycles idle 0 context-switches # 0.000 K/sec 0.007920284 seconds time elapsed Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 809fac6 commit cfcb3d8

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

arch/powerpc/include/asm/trace.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,26 @@ TRACE_EVENT_FN(opal_exit,
144144
);
145145
#endif
146146

147+
TRACE_EVENT(hash_fault,
148+
149+
TP_PROTO(unsigned long addr, unsigned long access, unsigned long trap),
150+
TP_ARGS(addr, access, trap),
151+
TP_STRUCT__entry(
152+
__field(unsigned long, addr)
153+
__field(unsigned long, access)
154+
__field(unsigned long, trap)
155+
),
156+
157+
TP_fast_assign(
158+
__entry->addr = addr;
159+
__entry->access = access;
160+
__entry->trap = trap;
161+
),
162+
163+
TP_printk("hash fault with addr 0x%lx and access = 0x%lx trap = 0x%lx",
164+
__entry->addr, __entry->access, __entry->trap)
165+
);
166+
147167
#endif /* _TRACE_POWERPC_H */
148168

149169
#undef TRACE_INCLUDE_PATH

arch/powerpc/mm/hash_utils_64.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
#include <asm/fadump.h>
5858
#include <asm/firmware.h>
5959
#include <asm/tm.h>
60+
#include <asm/trace.h>
6061

6162
#ifdef DEBUG
6263
#define DBG(fmt...) udbg_printf(fmt)
@@ -1004,6 +1005,7 @@ int hash_page_mm(struct mm_struct *mm, unsigned long ea,
10041005

10051006
DBG_LOW("hash_page(ea=%016lx, access=%lx, trap=%lx\n",
10061007
ea, access, trap);
1008+
trace_hash_fault(ea, access, trap);
10071009

10081010
/* Get region & vsid */
10091011
switch (REGION_ID(ea)) {

0 commit comments

Comments
 (0)