Skip to content

Commit 007bb7d

Browse files
Sukadev Bhattiprolumpe
authored andcommitted
powerpc/vas: Add a couple of trace points
Add a couple of trace points in the VAS driver Signed-off-by: Sukadev Bhattiprolu <[email protected]> [mpe: Add SPDX tag to new header] Signed-off-by: Michael Ellerman <[email protected]>
1 parent 45ddea8 commit 007bb7d

File tree

2 files changed

+122
-0
lines changed

2 files changed

+122
-0
lines changed
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/* SPDX-License-Identifier: GPL-2.0+ */
2+
3+
#undef TRACE_SYSTEM
4+
#define TRACE_SYSTEM vas
5+
6+
#if !defined(_VAS_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
7+
8+
#define _VAS_TRACE_H
9+
#include <linux/tracepoint.h>
10+
#include <linux/sched.h>
11+
#include <asm/vas.h>
12+
13+
TRACE_EVENT( vas_rx_win_open,
14+
15+
TP_PROTO(struct task_struct *tsk,
16+
int vasid,
17+
int cop,
18+
struct vas_rx_win_attr *rxattr),
19+
20+
TP_ARGS(tsk, vasid, cop, rxattr),
21+
22+
TP_STRUCT__entry(
23+
__field(struct task_struct *, tsk)
24+
__field(int, pid)
25+
__field(int, cop)
26+
__field(int, vasid)
27+
__field(struct vas_rx_win_attr *, rxattr)
28+
__field(int, lnotify_lpid)
29+
__field(int, lnotify_pid)
30+
__field(int, lnotify_tid)
31+
),
32+
33+
TP_fast_assign(
34+
__entry->pid = tsk->pid;
35+
__entry->vasid = vasid;
36+
__entry->cop = cop;
37+
__entry->lnotify_lpid = rxattr->lnotify_lpid;
38+
__entry->lnotify_pid = rxattr->lnotify_pid;
39+
__entry->lnotify_tid = rxattr->lnotify_tid;
40+
),
41+
42+
TP_printk("pid=%d, vasid=%d, cop=%d, lpid=%d, pid=%d, tid=%d",
43+
__entry->pid, __entry->vasid, __entry->cop,
44+
__entry->lnotify_lpid, __entry->lnotify_pid,
45+
__entry->lnotify_tid)
46+
);
47+
48+
TRACE_EVENT( vas_tx_win_open,
49+
50+
TP_PROTO(struct task_struct *tsk,
51+
int vasid,
52+
int cop,
53+
struct vas_tx_win_attr *txattr),
54+
55+
TP_ARGS(tsk, vasid, cop, txattr),
56+
57+
TP_STRUCT__entry(
58+
__field(struct task_struct *, tsk)
59+
__field(int, pid)
60+
__field(int, cop)
61+
__field(int, vasid)
62+
__field(struct vas_tx_win_attr *, txattr)
63+
__field(int, lpid)
64+
__field(int, pidr)
65+
),
66+
67+
TP_fast_assign(
68+
__entry->pid = tsk->pid;
69+
__entry->vasid = vasid;
70+
__entry->cop = cop;
71+
__entry->lpid = txattr->lpid;
72+
__entry->pidr = txattr->pidr;
73+
),
74+
75+
TP_printk("pid=%d, vasid=%d, cop=%d, lpid=%d, pidr=%d",
76+
__entry->pid, __entry->vasid, __entry->cop,
77+
__entry->lpid, __entry->pidr)
78+
);
79+
80+
TRACE_EVENT( vas_paste_crb,
81+
82+
TP_PROTO(struct task_struct *tsk,
83+
struct vas_window *win),
84+
85+
TP_ARGS(tsk, win),
86+
87+
TP_STRUCT__entry(
88+
__field(struct task_struct *, tsk)
89+
__field(struct vas_window *, win)
90+
__field(int, pid)
91+
__field(int, vasid)
92+
__field(int, winid)
93+
__field(unsigned long, paste_kaddr)
94+
),
95+
96+
TP_fast_assign(
97+
__entry->pid = tsk->pid;
98+
__entry->vasid = win->vinst->vas_id;
99+
__entry->winid = win->winid;
100+
__entry->paste_kaddr = (unsigned long)win->paste_kaddr
101+
),
102+
103+
TP_printk("pid=%d, vasid=%d, winid=%d, paste_kaddr=0x%016lx\n",
104+
__entry->pid, __entry->vasid, __entry->winid,
105+
__entry->paste_kaddr)
106+
);
107+
108+
#endif /* _VAS_TRACE_H */
109+
110+
#undef TRACE_INCLUDE_PATH
111+
#define TRACE_INCLUDE_PATH ../../arch/powerpc/platforms/powernv
112+
#define TRACE_INCLUDE_FILE vas-trace
113+
#include <trace/define_trace.h>

arch/powerpc/platforms/powernv/vas-window.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
#include "vas.h"
2222
#include "copy-paste.h"
2323

24+
#define CREATE_TRACE_POINTS
25+
#include "vas-trace.h"
26+
2427
/*
2528
* Compute the paste address region for the window @window using the
2629
* ->paste_base_addr and ->paste_win_id_shift we got from device tree.
@@ -880,6 +883,8 @@ struct vas_window *vas_rx_win_open(int vasid, enum vas_cop_type cop,
880883
struct vas_winctx winctx;
881884
struct vas_instance *vinst;
882885

886+
trace_vas_rx_win_open(current, vasid, cop, rxattr);
887+
883888
if (!rx_win_args_valid(cop, rxattr))
884889
return ERR_PTR(-EINVAL);
885890

@@ -1008,6 +1013,8 @@ struct vas_window *vas_tx_win_open(int vasid, enum vas_cop_type cop,
10081013
struct vas_winctx winctx;
10091014
struct vas_instance *vinst;
10101015

1016+
trace_vas_tx_win_open(current, vasid, cop, attr);
1017+
10111018
if (!tx_win_args_valid(cop, attr))
10121019
return ERR_PTR(-EINVAL);
10131020

@@ -1100,6 +1107,8 @@ int vas_paste_crb(struct vas_window *txwin, int offset, bool re)
11001107
void *addr;
11011108
uint64_t val;
11021109

1110+
trace_vas_paste_crb(current, txwin);
1111+
11031112
/*
11041113
* Only NX windows are supported for now and hardware assumes
11051114
* report-enable flag is set for NX windows. Ensure software

0 commit comments

Comments
 (0)