2009-10-27 01:47:42 +07:00
|
|
|
#undef TRACE_SYSTEM
|
|
|
|
#define TRACE_SYSTEM powerpc
|
|
|
|
|
|
|
|
#if !defined(_TRACE_POWERPC_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
|
|
#define _TRACE_POWERPC_H
|
|
|
|
|
|
|
|
#include <linux/tracepoint.h>
|
|
|
|
|
|
|
|
struct pt_regs;
|
|
|
|
|
2012-05-23 01:47:48 +07:00
|
|
|
DECLARE_EVENT_CLASS(ppc64_interrupt_class,
|
2009-10-27 01:47:42 +07:00
|
|
|
|
|
|
|
TP_PROTO(struct pt_regs *regs),
|
|
|
|
|
|
|
|
TP_ARGS(regs),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(struct pt_regs *, regs)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->regs = regs;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("pt_regs=%p", __entry->regs)
|
|
|
|
);
|
|
|
|
|
2012-05-23 01:47:48 +07:00
|
|
|
DEFINE_EVENT(ppc64_interrupt_class, irq_entry,
|
2009-10-27 01:47:42 +07:00
|
|
|
|
|
|
|
TP_PROTO(struct pt_regs *regs),
|
|
|
|
|
2012-05-23 01:47:48 +07:00
|
|
|
TP_ARGS(regs)
|
2009-10-27 01:47:42 +07:00
|
|
|
);
|
|
|
|
|
2012-05-23 01:47:48 +07:00
|
|
|
DEFINE_EVENT(ppc64_interrupt_class, irq_exit,
|
2009-10-27 01:49:14 +07:00
|
|
|
|
|
|
|
TP_PROTO(struct pt_regs *regs),
|
|
|
|
|
2012-05-23 01:47:48 +07:00
|
|
|
TP_ARGS(regs)
|
2009-10-27 01:49:14 +07:00
|
|
|
);
|
|
|
|
|
2012-05-23 01:47:48 +07:00
|
|
|
DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_entry,
|
2009-10-27 01:49:14 +07:00
|
|
|
|
|
|
|
TP_PROTO(struct pt_regs *regs),
|
|
|
|
|
2012-05-23 01:47:48 +07:00
|
|
|
TP_ARGS(regs)
|
|
|
|
);
|
2009-10-27 01:49:14 +07:00
|
|
|
|
2012-05-23 01:47:48 +07:00
|
|
|
DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_exit,
|
2009-10-27 01:49:14 +07:00
|
|
|
|
2012-05-23 01:47:48 +07:00
|
|
|
TP_PROTO(struct pt_regs *regs),
|
2009-10-27 01:49:14 +07:00
|
|
|
|
2012-05-23 01:47:48 +07:00
|
|
|
TP_ARGS(regs)
|
2009-10-27 01:49:14 +07:00
|
|
|
);
|
|
|
|
|
2009-10-27 01:50:29 +07:00
|
|
|
#ifdef CONFIG_PPC_PSERIES
|
2016-11-29 01:03:21 +07:00
|
|
|
extern int hcall_tracepoint_regfunc(void);
|
2009-10-27 01:50:29 +07:00
|
|
|
extern void hcall_tracepoint_unregfunc(void);
|
|
|
|
|
2015-12-15 03:18:06 +07:00
|
|
|
TRACE_EVENT_FN_COND(hcall_entry,
|
2009-10-27 01:50:29 +07:00
|
|
|
|
2009-10-27 01:51:09 +07:00
|
|
|
TP_PROTO(unsigned long opcode, unsigned long *args),
|
2009-10-27 01:50:29 +07:00
|
|
|
|
2009-10-27 01:51:09 +07:00
|
|
|
TP_ARGS(opcode, args),
|
2009-10-27 01:50:29 +07:00
|
|
|
|
2015-12-15 03:18:06 +07:00
|
|
|
TP_CONDITION(cpu_online(raw_smp_processor_id())),
|
|
|
|
|
2009-10-27 01:50:29 +07:00
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned long, opcode)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->opcode = opcode;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("opcode=%lu", __entry->opcode),
|
|
|
|
|
|
|
|
hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc
|
|
|
|
);
|
|
|
|
|
2015-12-15 03:18:06 +07:00
|
|
|
TRACE_EVENT_FN_COND(hcall_exit,
|
2009-10-27 01:50:29 +07:00
|
|
|
|
2009-10-27 01:51:09 +07:00
|
|
|
TP_PROTO(unsigned long opcode, unsigned long retval,
|
|
|
|
unsigned long *retbuf),
|
2009-10-27 01:50:29 +07:00
|
|
|
|
2009-10-27 01:51:09 +07:00
|
|
|
TP_ARGS(opcode, retval, retbuf),
|
2009-10-27 01:50:29 +07:00
|
|
|
|
2015-12-15 03:18:06 +07:00
|
|
|
TP_CONDITION(cpu_online(raw_smp_processor_id())),
|
|
|
|
|
2009-10-27 01:50:29 +07:00
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned long, opcode)
|
|
|
|
__field(unsigned long, retval)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->opcode = opcode;
|
|
|
|
__entry->retval = retval;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("opcode=%lu retval=%lu", __entry->opcode, __entry->retval),
|
|
|
|
|
|
|
|
hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc
|
|
|
|
);
|
|
|
|
#endif
|
|
|
|
|
2014-07-03 14:20:50 +07:00
|
|
|
#ifdef CONFIG_PPC_POWERNV
|
2016-11-29 01:03:21 +07:00
|
|
|
extern int opal_tracepoint_regfunc(void);
|
2014-07-03 14:20:50 +07:00
|
|
|
extern void opal_tracepoint_unregfunc(void);
|
|
|
|
|
|
|
|
TRACE_EVENT_FN(opal_entry,
|
|
|
|
|
|
|
|
TP_PROTO(unsigned long opcode, unsigned long *args),
|
|
|
|
|
|
|
|
TP_ARGS(opcode, args),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned long, opcode)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->opcode = opcode;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("opcode=%lu", __entry->opcode),
|
|
|
|
|
|
|
|
opal_tracepoint_regfunc, opal_tracepoint_unregfunc
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT_FN(opal_exit,
|
|
|
|
|
|
|
|
TP_PROTO(unsigned long opcode, unsigned long retval),
|
|
|
|
|
|
|
|
TP_ARGS(opcode, retval),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned long, opcode)
|
|
|
|
__field(unsigned long, retval)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->opcode = opcode;
|
|
|
|
__entry->retval = retval;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("opcode=%lu retval=%lu", __entry->opcode, __entry->retval),
|
|
|
|
|
|
|
|
opal_tracepoint_regfunc, opal_tracepoint_unregfunc
|
|
|
|
);
|
|
|
|
#endif
|
|
|
|
|
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>
2015-04-14 14:35:57 +07:00
|
|
|
TRACE_EVENT(hash_fault,
|
|
|
|
|
|
|
|
TP_PROTO(unsigned long addr, unsigned long access, unsigned long trap),
|
|
|
|
TP_ARGS(addr, access, trap),
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned long, addr)
|
|
|
|
__field(unsigned long, access)
|
|
|
|
__field(unsigned long, trap)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->addr = addr;
|
|
|
|
__entry->access = access;
|
|
|
|
__entry->trap = trap;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("hash fault with addr 0x%lx and access = 0x%lx trap = 0x%lx",
|
|
|
|
__entry->addr, __entry->access, __entry->trap)
|
|
|
|
);
|
|
|
|
|
2017-04-11 12:23:25 +07:00
|
|
|
|
|
|
|
TRACE_EVENT(tlbie,
|
|
|
|
|
|
|
|
TP_PROTO(unsigned long lpid, unsigned long local, unsigned long rb,
|
|
|
|
unsigned long rs, unsigned long ric, unsigned long prs,
|
|
|
|
unsigned long r),
|
|
|
|
TP_ARGS(lpid, local, rb, rs, ric, prs, r),
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned long, lpid)
|
|
|
|
__field(unsigned long, local)
|
|
|
|
__field(unsigned long, rb)
|
|
|
|
__field(unsigned long, rs)
|
|
|
|
__field(unsigned long, ric)
|
|
|
|
__field(unsigned long, prs)
|
|
|
|
__field(unsigned long, r)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->lpid = lpid;
|
|
|
|
__entry->local = local;
|
|
|
|
__entry->rb = rb;
|
|
|
|
__entry->rs = rs;
|
|
|
|
__entry->ric = ric;
|
|
|
|
__entry->prs = prs;
|
|
|
|
__entry->r = r;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("lpid=%ld, local=%ld, rb=0x%lx, rs=0x%lx, ric=0x%lx, "
|
|
|
|
"prs=0x%lx, r=0x%lx", __entry->lpid, __entry->local,
|
|
|
|
__entry->rb, __entry->rs, __entry->ric, __entry->prs,
|
|
|
|
__entry->r)
|
|
|
|
);
|
|
|
|
|
2009-10-27 01:47:42 +07:00
|
|
|
#endif /* _TRACE_POWERPC_H */
|
|
|
|
|
|
|
|
#undef TRACE_INCLUDE_PATH
|
|
|
|
#undef TRACE_INCLUDE_FILE
|
|
|
|
|
|
|
|
#define TRACE_INCLUDE_PATH asm
|
|
|
|
#define TRACE_INCLUDE_FILE trace
|
|
|
|
|
|
|
|
#include <trace/define_trace.h>
|