提交 353b71c7 编写于 作者: M Mitko Haralanov 提交者: Doug Ledford

IB/hfi1: Add MMU tracing

Add a new tracepoint type for the MMU functions and calls
to that tracepoint to allow tracing of MMU functionality.
Reviewed-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: NDean Luick <dean.luick@intel.com>
Signed-off-by: NMitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: NJubin John <jubin.john@intel.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 df5a00f8
...@@ -157,6 +157,8 @@ int hfi1_mmu_rb_insert(struct rb_root *root, struct mmu_rb_node *mnode) ...@@ -157,6 +157,8 @@ int hfi1_mmu_rb_insert(struct rb_root *root, struct mmu_rb_node *mnode)
return -EINVAL; return -EINVAL;
spin_lock_irqsave(&handler->lock, flags); spin_lock_irqsave(&handler->lock, flags);
hfi1_cdbg(MMU, "Inserting node addr 0x%llx, len %u", mnode->addr,
mnode->len);
node = __mmu_rb_search(handler, mnode->addr, mnode->len); node = __mmu_rb_search(handler, mnode->addr, mnode->len);
if (node) { if (node) {
ret = -EINVAL; ret = -EINVAL;
...@@ -181,7 +183,11 @@ static struct mmu_rb_node *__mmu_rb_search(struct mmu_rb_handler *handler, ...@@ -181,7 +183,11 @@ static struct mmu_rb_node *__mmu_rb_search(struct mmu_rb_handler *handler,
{ {
struct mmu_rb_node *node; struct mmu_rb_node *node;
hfi1_cdbg(MMU, "Searching for addr 0x%llx, len %u", addr, len);
node = __mmu_int_rb_iter_first(handler->root, addr, len); node = __mmu_int_rb_iter_first(handler->root, addr, len);
if (node)
hfi1_cdbg(MMU, "Found node addr 0x%llx, len %u", node->addr,
node->len);
return node; return node;
} }
...@@ -189,6 +195,8 @@ static void __mmu_rb_remove(struct mmu_rb_handler *handler, ...@@ -189,6 +195,8 @@ static void __mmu_rb_remove(struct mmu_rb_handler *handler,
struct mmu_rb_node *node, bool arg) struct mmu_rb_node *node, bool arg)
{ {
/* Validity of handler and node pointers has been checked by caller. */ /* Validity of handler and node pointers has been checked by caller. */
hfi1_cdbg(MMU, "Removing node addr 0x%llx, len %u", node->addr,
node->len);
__mmu_int_rb_remove(node, handler->root); __mmu_int_rb_remove(node, handler->root);
if (handler->ops->remove) if (handler->ops->remove)
handler->ops->remove(handler->root, node, arg); handler->ops->remove(handler->root, node, arg);
...@@ -266,6 +274,8 @@ static void mmu_notifier_mem_invalidate(struct mmu_notifier *mn, ...@@ -266,6 +274,8 @@ static void mmu_notifier_mem_invalidate(struct mmu_notifier *mn,
spin_lock_irqsave(&handler->lock, flags); spin_lock_irqsave(&handler->lock, flags);
for (node = __mmu_int_rb_iter_first(root, start, end); node; for (node = __mmu_int_rb_iter_first(root, start, end); node;
node = __mmu_int_rb_iter_next(node, start, end)) { node = __mmu_int_rb_iter_next(node, start, end)) {
hfi1_cdbg(MMU, "Invalidating node addr 0x%llx, len %u",
node->addr, node->len);
if (handler->ops->invalidate(root, node)) if (handler->ops->invalidate(root, node))
__mmu_rb_remove(handler, node, true); __mmu_rb_remove(handler, node, true);
} }
......
...@@ -232,3 +232,4 @@ __hfi1_trace_fn(DC8051); ...@@ -232,3 +232,4 @@ __hfi1_trace_fn(DC8051);
__hfi1_trace_fn(FIRMWARE); __hfi1_trace_fn(FIRMWARE);
__hfi1_trace_fn(RCVCTRL); __hfi1_trace_fn(RCVCTRL);
__hfi1_trace_fn(TID); __hfi1_trace_fn(TID);
__hfi1_trace_fn(MMU);
...@@ -1340,6 +1340,7 @@ __hfi1_trace_def(DC8051); ...@@ -1340,6 +1340,7 @@ __hfi1_trace_def(DC8051);
__hfi1_trace_def(FIRMWARE); __hfi1_trace_def(FIRMWARE);
__hfi1_trace_def(RCVCTRL); __hfi1_trace_def(RCVCTRL);
__hfi1_trace_def(TID); __hfi1_trace_def(TID);
__hfi1_trace_def(MMU);
#define hfi1_cdbg(which, fmt, ...) \ #define hfi1_cdbg(which, fmt, ...) \
__hfi1_trace_##which(__func__, fmt, ##__VA_ARGS__) __hfi1_trace_##which(__func__, fmt, ##__VA_ARGS__)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册